Skip to content

Release: laddr v2.3.11 #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Feb 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 33 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +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.

## Getting started

There are three ways to get started with 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
Expand Down Expand Up @@ -31,32 +59,16 @@ Laddr -- pronounced "ladder" and named after the essential tool for fire brigade
- Croatian and Korean translations in progress

## Brigades using Laddr

- [Code for Philly](http://codeforphilly.org)
- [Code for Miami](http://projects.codeformiami.org)
- [Extending repository](https://github.com/CodeForPhilly/codeforphilly.org)
- [Code for Dayton](http://codefordayton.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/)

## Help / Support / Questions / Chat
Join Code for Philly's Slack channel for Laddr, you can self-register via codeforphilly.org: https://codeforphilly.slack.com/messages/laddr

## 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
Expand Down
59 changes: 37 additions & 22 deletions docs/laddr/development/clone-from-git.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 <kbd>/develop</kbd>
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
<kbd>Git.config.php</kbd> 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 <kbd>/git/status</kbd> 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 <kbd>/site-admin/sources</kbd> 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 <kbd>/git/status</kbd> 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 <kbd>/site-admin/sources/laddr</kbd> 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
## 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
2 changes: 1 addition & 1 deletion html-templates/blog/blogPost.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<h1 class="header-title"><a href="{$Post->getURL()}">{$Post->Title|escape}</a></h1>

<div class="article-meta">
by {personLink $Post->Author photo=yes photoSize=36 pixelRatio=2}
by {personLink $Post->Author photo=yes photoSize=36 pixelRatio=2 summary=no}
on <a href="{$Post->getURL()}">{timestamp $Post->Published}</a>
</div>

Expand Down
1 change: 1 addition & 0 deletions html-templates/designs/site.subtemplates.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{load_templates subtemplates/personName.tpl}
{load_templates subtemplates/glyphicons.tpl}
{load_templates subtemplates/icon.tpl}
{load_templates subtemplates/timestamp.tpl}
{load_templates subtemplates/people.tpl}
{load_templates subtemplates/contentBlocks.tpl}
Expand Down
2 changes: 1 addition & 1 deletion html-templates/includes/site.header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"> {include includes/site.brand.tpl}</a>
<a class="navbar-brand" href="/"> {include includes/site.brand.tpl}</a>
</div>


Expand Down
23 changes: 13 additions & 10 deletions html-templates/subtemplates/forms.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,24 @@
{/template}

{template checkbox inputName value label='' error='' hint='' attribs='' default=null class=null unsetValue=null}
<div class="form-group">
{capture assign=html}
<div class="checkbox">
{if $unsetValue !== null}
<input type="hidden" name="{$inputName|escape}" value="{$unsetValue|escape}">
{/if}

<label>
<input type="checkbox"
class="field-control form-control {$class}"
class="{$class}"
name="{$inputName|escape}"
value="{$value|escape}"
{$attribs}
{refill field=$inputName default=$default checked=$value}>
{/capture}

{if $unsetValue !== null}
<input type="hidden" name="{$inputName|escape}" value="{$unsetValue|escape}">
{/if}

{labeledField html=$html type=checkbox label=$label error=$error hint=$hint required=$required}

{$label}
</label>

{if $error}<p class="error-text">{$error}</p>{/if}
{if $hint}<p class="hint help-block">{$hint}</p>{/if}
</div>
{/template}

Expand Down
4 changes: 2 additions & 2 deletions html-templates/subtemplates/people.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{/if}
{/strip}{/template}

{template personLink Person photo=no photoSize=64 pixelRatio=2 linkCls=no imgCls=no nameCls=no}{strip}
{template personLink Person photo=no photoSize=64 pixelRatio=2 linkCls=no imgCls=no nameCls=no summary=yes}{strip}
<a href="{$Person->getURL()}" title="{personName $Person}" {if $linkCls}class="{$linkCls}"{/if}>
{if $photo}
{$pixels = $photoSize}
Expand All @@ -30,6 +30,6 @@
{/if}
<img src="{$src}" class="avatar {if $imgCls}{$imgCls}{/if}" width="{$photoSize}" height="{$photoSize}" />
{/if}
<span class="name {$imgCls}">{personName $Person}</span>
<span class="name {$imgCls}">{personName $Person summary=$summary}</span>
</a>
{/strip}{/template}
9 changes: 8 additions & 1 deletion html-templates/subtemplates/timestamp.tpl
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
{template timestamp timestamp time=no}<time datetime="{date($.const.DATE_W3C, $timestamp)}" title="{$timestamp|date_format:"%c"}">{$timestamp|date_format:tif($time, "%-d %b %Y&mdash;%I:%M %P", "%-d %b %Y")}</time>{/template}
{template timestamp timestamp time=no}{strip}
{if $time === 'auto'}
{$time = tif(date('Hi', $timestamp) == '0000' ? false : true)}
{/if}
<time datetime="{date($.const.DATE_W3C, $timestamp)}" title="{$timestamp|date_format:"%c"}">
{$timestamp|date_format:tif($time, "%-d %b %Y&mdash;%I:%M %P", "%-d %b %Y")}
</time>
{/strip}{/template}
9 changes: 6 additions & 3 deletions php-classes/Laddr/MemberCheckin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace Laddr;

use Emergence\People\Person;


class MemberCheckin extends \ActiveRecord
{
// ActiveRecord configuration
Expand All @@ -16,18 +19,18 @@ class MemberCheckin extends \ActiveRecord
'MemberID' => 'uint',
'ProjectID' => [
'type' => 'uint',
'notnull' => false
'default' => null
],
'MeetupID' => [
'type' => 'string',
'notnull' => false
'default' => null
]
];

public static $relationships = [
'Member' => [
'type' => 'one-one',
'class' => \Emergence\People\Person::class
'class' => \Person::class
],
'Project' => [
'type' => 'one-one',
Expand Down
Loading