diff --git a/.holo/branches/emergence-site/_laddr.toml b/.holo/branches/emergence-site/_laddr.toml new file mode 100644 index 00000000..9f7f75b0 --- /dev/null +++ b/.holo/branches/emergence-site/_laddr.toml @@ -0,0 +1,3 @@ +[holomapping] +files = "*/**" +after = "skeleton-v2" diff --git a/.holo/branches/emergence-site/_skeleton-v2.toml b/.holo/branches/emergence-site/_skeleton-v2.toml new file mode 100644 index 00000000..76c4570c --- /dev/null +++ b/.holo/branches/emergence-site/_skeleton-v2.toml @@ -0,0 +1,2 @@ +[holomapping] +files = "*/**" diff --git a/.holo/branches/emergence-skeleton.toml b/.holo/branches/emergence-skeleton.toml new file mode 100644 index 00000000..45d9325b --- /dev/null +++ b/.holo/branches/emergence-skeleton.toml @@ -0,0 +1,2 @@ +[holobranch] +lens = false \ No newline at end of file diff --git a/.holo/branches/emergence-skeleton/_emergence-github.toml b/.holo/branches/emergence-skeleton/_emergence-github.toml new file mode 100644 index 00000000..b1d3ace4 --- /dev/null +++ b/.holo/branches/emergence-skeleton/_emergence-github.toml @@ -0,0 +1,4 @@ +[holomapping] +files = "*/**" +after = "skeleton-v2" +before = "laddr" diff --git a/.holo/branches/emergence-skeleton/_emergence-redirects.toml b/.holo/branches/emergence-skeleton/_emergence-redirects.toml new file mode 100644 index 00000000..b1d3ace4 --- /dev/null +++ b/.holo/branches/emergence-skeleton/_emergence-redirects.toml @@ -0,0 +1,4 @@ +[holomapping] +files = "*/**" +after = "skeleton-v2" +before = "laddr" diff --git a/.holo/branches/emergence-skeleton/_emergence-saml2.toml b/.holo/branches/emergence-skeleton/_emergence-saml2.toml new file mode 100644 index 00000000..b1d3ace4 --- /dev/null +++ b/.holo/branches/emergence-skeleton/_emergence-saml2.toml @@ -0,0 +1,4 @@ +[holomapping] +files = "*/**" +after = "skeleton-v2" +before = "laddr" diff --git a/.holo/branches/emergence-skeleton/_emergence-slack.toml b/.holo/branches/emergence-skeleton/_emergence-slack.toml new file mode 100644 index 00000000..b1d3ace4 --- /dev/null +++ b/.holo/branches/emergence-skeleton/_emergence-slack.toml @@ -0,0 +1,4 @@ +[holomapping] +files = "*/**" +after = "skeleton-v2" +before = "laddr" diff --git a/.holo/branches/emergence-skeleton/_laddr.toml b/.holo/branches/emergence-skeleton/_laddr.toml new file mode 100644 index 00000000..9f7f75b0 --- /dev/null +++ b/.holo/branches/emergence-skeleton/_laddr.toml @@ -0,0 +1,3 @@ +[holomapping] +files = "*/**" +after = "skeleton-v2" diff --git a/.holo/branches/emergence-skeleton/_skeleton-v2.toml b/.holo/branches/emergence-skeleton/_skeleton-v2.toml new file mode 100644 index 00000000..76c4570c --- /dev/null +++ b/.holo/branches/emergence-skeleton/_skeleton-v2.toml @@ -0,0 +1,2 @@ +[holomapping] +files = "*/**" diff --git a/.holo/branches/emergence-skeleton/php-classes/ReCaptcha.toml b/.holo/branches/emergence-skeleton/php-classes/ReCaptcha.toml new file mode 100644 index 00000000..34ec5f9e --- /dev/null +++ b/.holo/branches/emergence-skeleton/php-classes/ReCaptcha.toml @@ -0,0 +1,6 @@ +[holomapping] +holosource = "recaptcha" +root = "src/ReCaptcha" +files = "**/*.php" +after = "skeleton-v2" +before = "laddr" diff --git a/.holo/branches/example-codeforphilly/_codeforphilly.toml b/.holo/branches/example-codeforphilly/_codeforphilly.toml new file mode 100644 index 00000000..e9a07744 --- /dev/null +++ b/.holo/branches/example-codeforphilly/_codeforphilly.toml @@ -0,0 +1,3 @@ +[holomapping] +files = "*/**" +after = [ "laddr" ] diff --git a/.holo/branches/example-codeforphilly/_laddr.toml b/.holo/branches/example-codeforphilly/_laddr.toml new file mode 100644 index 00000000..ad787e40 --- /dev/null +++ b/.holo/branches/example-codeforphilly/_laddr.toml @@ -0,0 +1,3 @@ +[holomapping] +files = "*/**" +after = [ "skeleton-v2" ] diff --git a/.holo/branches/example-codeforphilly/_skeleton-v2.toml b/.holo/branches/example-codeforphilly/_skeleton-v2.toml new file mode 100644 index 00000000..76c4570c --- /dev/null +++ b/.holo/branches/example-codeforphilly/_skeleton-v2.toml @@ -0,0 +1,2 @@ +[holomapping] +files = "*/**" diff --git a/.holo/config.toml b/.holo/config.toml new file mode 100644 index 00000000..4da1d2ff --- /dev/null +++ b/.holo/config.toml @@ -0,0 +1,2 @@ +[holospace] +name = "laddr" diff --git a/.holo/sources/codeforphilly.toml b/.holo/sources/codeforphilly.toml new file mode 100644 index 00000000..c84c3da8 --- /dev/null +++ b/.holo/sources/codeforphilly.toml @@ -0,0 +1,3 @@ +[holosource] +url = "https://github.com/CodeForPhilly/codeforphilly.org" +ref = "refs/heads/master" diff --git a/.holo/sources/emergence-github.toml b/.holo/sources/emergence-github.toml new file mode 100644 index 00000000..c1b7278e --- /dev/null +++ b/.holo/sources/emergence-github.toml @@ -0,0 +1,3 @@ +[holosource] +url = "https://github.com/JarvusInnovations/emergence-github" +ref = "refs/heads/master" diff --git a/.holo/sources/emergence-redirects.toml b/.holo/sources/emergence-redirects.toml new file mode 100644 index 00000000..bbe39017 --- /dev/null +++ b/.holo/sources/emergence-redirects.toml @@ -0,0 +1,3 @@ +[holosource] +url = "https://github.com/JarvusInnovations/emergence-redirects" +ref = "refs/heads/master" diff --git a/.holo/sources/emergence-saml2.toml b/.holo/sources/emergence-saml2.toml new file mode 100644 index 00000000..dc487480 --- /dev/null +++ b/.holo/sources/emergence-saml2.toml @@ -0,0 +1,3 @@ +[holosource] +url = "https://github.com/JarvusInnovations/emergence-saml2" +ref = "refs/heads/master" diff --git a/.holo/sources/emergence-slack.toml b/.holo/sources/emergence-slack.toml new file mode 100644 index 00000000..d92ce542 --- /dev/null +++ b/.holo/sources/emergence-slack.toml @@ -0,0 +1,3 @@ +[holosource] +url = "https://github.com/JarvusInnovations/emergence-slack" +ref = "refs/heads/master" diff --git a/.holo/sources/recaptcha.toml b/.holo/sources/recaptcha.toml new file mode 100644 index 00000000..2ea6fd9e --- /dev/null +++ b/.holo/sources/recaptcha.toml @@ -0,0 +1,3 @@ +[holosource] +url = "https://github.com/google/recaptcha" +ref = "refs/heads/master" diff --git a/.holo/sources/skeleton-v2.toml b/.holo/sources/skeleton-v2.toml new file mode 100644 index 00000000..2ddcea63 --- /dev/null +++ b/.holo/sources/skeleton-v2.toml @@ -0,0 +1,3 @@ +[holosource] +url = "https://github.com/JarvusInnovations/emergence-skeleton-v2" +ref = "refs/heads/emergence-skeleton" diff --git a/.studiorc b/.studiorc new file mode 100644 index 00000000..e682e5d4 --- /dev/null +++ b/.studiorc @@ -0,0 +1,4 @@ +#!/bin/bash + +hab pkg install emergence/studio +source "$(hab pkg path emergence/studio)/studio.sh" diff --git a/README.md b/README.md index 10ffab0f..69449713 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,36 @@ # laddr -Laddr -- pronounced "ladder" and named after the essential tool for fire brigades -- is a web application designed to create an online home-base for [Code for America brigades](http://brigade.codeforamerica.org). +Laddr -- pronounced "ladder" and named after the essential tool for fire brigades -- is an online homebase for your local [Code for America Brigade](http://brigade.codeforamerica.org). It is designed to be cheap-to-host and easy-to-hack platform for civic hacking groups to maintain an online precense and automate support for their real-world operations. -## Hosting -Code for Philly hosts and maintains instances for free for other brigades on our multi-tenant infrastructure. Email [hello@codeforphilly.org](mailto:hello@codeforphilly.org) to get started with a sandbox instance. +## Getting started -## Help / Support / Questions / Chat -Guides and support are available at our Discourse foreum at [forum.laddr.us](http://forum.laddr.us/) +There are three ways to get started with Laddr: -Join Code for Philly's Slack channel for Laddr, you can self-register via codeforphilly.org: [codeforphilly.org/chat/laddr](https://codeforphilly.org/chat/laddr) +- [Request free hosting of a copy for your brigade](http://forum.laddr.us/c/hosting-requests), courtesy of Code for Philly +- [Clone laddr](#clone-laddr) to work on and contribute to its core, shared functionality +- [Extend laddr](#extend-laddr) to create a workspace for customizing a copy of laddr for your brigade without forking the whole thing + +### Clone Laddr + +*TODO: document me* + +### Extend Laddr + +*TODO: document me* + +## Support + +- [Laddr forum/wiki](http://forum.laddr.us/) +- [#laddr channel in Code for Philly's Slack](https://codeforphilly.org/chat/laddr) +- #laddr channel in Code for America's Slack +- [laddr issues on GitHub](https://github.com/CodeForPhilly/laddr/issues) + +Guides and support are available at our Discourse forum at + +Join Code for Philly's Slack channel for Laddr, you can self-register via codeforphilly.org: ## Features + - [Projects Directory] - Each project can have a users URL, developers URL, markdown README - Projects can be tagged by topic, tech, and event @@ -39,30 +59,16 @@ Join Code for Philly's Slack channel for Laddr, you can self-register via codefo - Croatian and Korean translations in progress ## Brigades using Laddr + - [Code for Philly](http://codeforphilly.org) + - [Extending repository](https://github.com/CodeForPhilly/codeforphilly.org) - [Code for Dayton](http://codefordayton.org) -- [Code for Miami](http://projects.codeformiami.org) - [Code for Croatia](http://codeforcroatia.org) - [Creative Commons Korea](http://labs.cckorea.org/) - [Code for Cary](http://www.codeforcary.org/) -- [Code for Charlotte](http://codeforcharlotte.org) - [Code for Durham](http://codefordurham.com/) - [Code for Raleigh](http://www.codeforraleigh.com/) - -## Requirements -Laddr is built on the Emergence PHP framework and deployement engine, and requires an Emergence server to host it. - -Emergence takes just a few minutes to setup on a Linux VM, and is designed to have a fresh system to itself. Once launched -it will configure services on the machine as-needed to host an instance of the application along with any other -sites, clones, or child sites. The guides for Ubuntu and Gentoo are most up-to-date: http://emr.ge/docs/setup - -## Installation via Emergence (linked child) -- Create an emergence site that extends v1.laddr.io (access key: MaPG1YxorgU6ew64) - -## Installation from Git -- Create an emergence site that extends skeleton.emr.ge (access key: 8U6kydil36bl3vlJ) -- Upload contents of git repository using WebDAV client (CyberDuck is the best open-source option) - +- [Open Charlotte Brigade](https://brigade.opencharlotte.org/) [Projects Directory]: http://codeforphilly.org/projects [Projects list available via dynamic CSV]: http://codeforphilly.org/projects.csv diff --git a/docs/laddr/development/clone-from-git.md b/docs/laddr/development/clone-from-git.md index 3847fda3..76c98d16 100644 --- a/docs/laddr/development/clone-from-git.md +++ b/docs/laddr/development/clone-from-git.md @@ -1,16 +1,33 @@ # Clone Laddr from git + This guide is for developers who want to work on Laddr's core code. It will walk you through setting up a fresh site instance and cloning a version of Laddr into it from a remote git repository. ## Step 1: Obtain an emergence host + You will need a host server dedicated to running emergence. If you don't have access to one already, -the easiest way to get started is to spin up a small **Ubuntu 14.04 LTS** virtual machine with a cloud +the easiest way to get started is to spin up a small **Ubuntu 16.04 LTS** virtual machine with a cloud provider like Digital Ocean, Google Cloud Compute, AWS, or countless others. Once you are logged in -to your fresh Ubuntu 14.04 machine, follow [emergence's installation guide][emergence-install] +to your fresh Ubuntu 16.04 machine, follow [emergence's installation guide][emergence-install] to prepare it for hosting emergence-powered sites like Laddr. -## Step 2: Create a site +Alternatively, if you're familiar with Docker, you can spin up an emergence container: + +```bash +docker run -d \ + -it \ + --name emergence \ + -v /emergence:/emergence \ + -p 127.0.0.10:80:80 \ + -p 127.0.0.10:3306:3306 \ + -p 127.0.0.10:9083:9083 \ + jarvus/emergence \ + tmux new -s emergence emergence-kernel +``` + +## Step 2: Create a site for your laddr development instance + Laddr is based on emergence's `skeleton-v2` site template. Unlike when provising a *deployment* instance of Laddr, for development you want to create a site extending Laddr's parent site like Laddr does rather than Laddr itself. Laddr's code will be cloned from git and applied @@ -20,30 +37,28 @@ Use emergence's host control panel to create a new site with your desired hostna be sure to select `skeleton-v2.emr.ge` as the parent hostname. After the site is created login to /develop with your initial user developer account. -## Step 3: Configure git link -To configure a link between your emergence instance and a git repository, create a file called -Git.config.php in the top level of the `php-config` directory and copy its initial contents -from the [latest version of Laddr's development Git.config.php][Git.config.php] +## Step 3: Configure mapping to the laddr git repository + +To configure a link between your emergence instance and a git repository, create a new file at `php-config/Git.config.d/laddr.php` and copy its initial contents +from the [the file at the same path in Laddr's develop branch][git-config] on Github. -You may change `originBranch` to select a different source and change `workingBranch` to change which branch you'll -be initially setup to commit to (both can be set to the same thing.) +Optionally, edit the `remote` option to point at your own fork, and switch it to the SSH protocol if you'd like to be able to push changes from the web UI. -See the [emergence manual page on git integration][emergence-git] for full details on all the configuration -options. +## Step 4: Initialize git repository -## Step 4: Initialize git links -Visit /git/status to view initialize the link with the configured git repository. If you are -cloning via HTTPS or don't need to push changes back to origin from the web interfaces, you can leave the deploy key field -empty and skip setting one up. Without a deploy key you will need to SSH into the server and use the git CLI to push changes. -[Setting up a deploy key][emergence-git] will enable you to use emergence's (currently minimal) web interface -for commiting/pushing changes. +Visit /site-admin/sources to initialize the configured git repository. If you switch the remote to an SSH git URL before initializing, a deploy key will be generated for you that you can install on GitHub before continueing to enable web-based read/write access. Otherwise, if you are +cloning via HTTPS, you will need to SSH into the server and use the git CLI to push changes after initializing the repository. ## Step 5: Pull code from git -Visit /git/status and click **Pull** if needed to pull the latest commits from github into your -git working copy. Then click the **Disk -> VFS** button to import the git working tree copy into your + +Visit /site-admin/sources/laddr and click **Pull** if needed to pull the latest commits from github into your +git working copy. Then click the **Sync** -> **Update emergence VFS** button to import the git working tree copy into your emergence instance. -[emergence-install]: http://emr.ge/docs/setup/ubuntu/14.04 -[emergence-git]: http://emr.ge/docs/git/init -[Git.config.php]: https://github.com/CfABrigadePhiladelphia/laddr/blob/development/php-config/Git.config.php \ No newline at end of file +## Next steps + +If you run into any trouble, need to reconfigure the repository, or execute any advanced maneuvers, use `emergence-git-shell my-instance-name laddr` on your host machine to drop into a properly-configured git shell where you can make full use of the git CLI client without any permissions issues. + +[emergence-install]: https://emergenceplatform.gitbook.io/emergence-book/server-setup/installation/ubuntu-16.04 +[git-config]: https://github.com/CodeForPhilly/laddr/blob/develop/php-config/Git.config.d/laddr.php diff --git a/html-templates/blog/blogPost.tpl b/html-templates/blog/blogPost.tpl index 91ae2395..39d73b32 100644 --- a/html-templates/blog/blogPost.tpl +++ b/html-templates/blog/blogPost.tpl @@ -90,7 +90,7 @@
- Status
- {$Event->Status}
-
- Start time
- {timestamp $Event->StartTime time=yes}
-
- End time
- {timestamp $Event->EndTime time=yes}
-
- Location
- {$Event->Location|escape}
-
{_("Your event has been created: %s")|sprintf:$eventLink}
diff --git a/html-templates/events/eventSegment.tpl b/html-templates/events/eventSegment.tpl new file mode 100644 index 00000000..72d79ab2 --- /dev/null +++ b/html-templates/events/eventSegment.tpl @@ -0,0 +1,63 @@ +{extends "designs/site.tpl"} + +{block title}{$data->Title|escape} @ {$data->Event->Title|escape} — {$dwoo.parent}{/block} + +{block css} + {$dwoo.parent} + + +{/block} + +{block content} + {$Segment = $data} + {$Event = $Segment->Event} + {load_templates "subtemplates.tpl"} + +{_("Your event has been created: %s")|sprintf:$linkHtml}
+ {else} +{_("Your changes to %s have been saved.")|sprintf:$linkHtml}
+ {/if} +{/block} \ No newline at end of file diff --git a/html-templates/events/subtemplates.tpl b/html-templates/events/subtemplates.tpl new file mode 100644 index 00000000..3d316c7a --- /dev/null +++ b/html-templates/events/subtemplates.tpl @@ -0,0 +1,16 @@ +{template eventLocation name address link=yes} + {if $link} + + {/if} + + {if $name && $address} + {$name|escape}