Skip to content

Commit a8535a0

Browse files
Merge pull request #150 from CodeForPhilly/development
Release: laddr v2.3.2
2 parents cf80b88 + 4fcf381 commit a8535a0

36 files changed

Lines changed: 921 additions & 70 deletions

File tree

html-templates/contact/contact.tpl

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,48 @@
22

33
{block "title"}Contact — {$dwoo.parent}{/block}
44

5+
{block js-top}
6+
{$dwoo.parent}
7+
8+
{if RemoteSystems\ReCaptcha::$siteKey}
9+
<script src='https://www.google.com/recaptcha/api.js'></script>
10+
{/if}
11+
{/block}
12+
513
{block "content"}
6-
<header class="page-header">
7-
<h2>Contact Us</h2>
8-
</header>
9-
10-
<form action="/contact" method="POST" class="contact-form">
11-
{if $validationErrors}
12-
<div class="notify error">
13-
<strong>Please double-check the fields highlighted below.</strong>
14-
</div>
15-
{/if}
16-
17-
<fieldset class="shrink show-required left-labels">
18-
19-
{* field name label='' error='' type=text placeholder='' hint='' required=false attribs='' *}
20-
21-
{field inputName=Name label=Name error=$validationErrors.Name required=true attribs='autofocus autocapitalize="words"'}
22-
{field inputName=Email label=Email error=$validationErrors.Email type=email required=true}
23-
{field inputName=Phone label=Phone error=$validationErrors.Phone type=tel hint='Optional. Include your area code.'}
24-
25-
{textarea inputName=Message label=Message error=$validationErrors.Message required=true}
26-
27-
<div class="submit-area">
28-
<input type="submit" class="btn btn-primary btn-block" value="Send">
14+
<div class="row">
15+
<div class="col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3">
16+
17+
<div class="page-header">
18+
<h1>Contact Us</h1>
2919
</div>
30-
31-
</fieldset>
32-
</form>
3320

21+
<form action="/contact" method="POST" class="contact-form">
22+
{if $validationErrors}
23+
<div class="alert alert-danger">
24+
Please double-check the fields highlighted below.
25+
</div>
26+
{/if}
27+
28+
{* field name label='' error='' type=text placeholder='' hint='' required=false attribs='' *}
29+
30+
{field inputName=Name label=Name error=$validationErrors.Name required=true attribs='autofocus autocapitalize="words"'}
31+
{field inputName=Email label=Email error=$validationErrors.Email type=email required=true}
32+
{field inputName=Phone label=Phone error=$validationErrors.Phone type=tel hint='Optional. Include your area code.'}
33+
34+
{textarea inputName=Message label=Message error=$validationErrors.Message required=true}
35+
36+
{if RemoteSystems\ReCaptcha::$siteKey}
37+
<div class="form-group g-recaptcha" data-sitekey="{RemoteSystems\ReCaptcha::$siteKey|escape}"></div>
38+
{/if}
39+
40+
{if $validationErrors.ReCaptcha}
41+
<p class="text-danger">{$validationErrors.ReCaptcha}</p>
42+
{/if}
43+
44+
<button type="submit" class="btn btn-primary">Send</button>
45+
</form>
46+
47+
</div>
48+
</div>
3449
{/block}

html-templates/events/event.tpl

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
{extends "designs/site.tpl"}
2+
3+
{block title}{_ 'Event'} &mdash; {$dwoo.parent}{/block}
4+
5+
{block content}
6+
{$Event = $data}
7+
8+
<div class="page-header">
9+
{*
10+
<ol class="breadcrumb">
11+
<li><a href="/events">{_ "Events"}</a></li>
12+
<li><a href="{$Event->getUrl()}">{$Event->Title|escape}</a></li>
13+
</ol>
14+
*}
15+
<div class="btn-toolbar pull-right">
16+
{if $.User}
17+
<form action="{$Event->getUrl(edit)}">
18+
<button class="btn btn-success" type="submit">{glyph "pencil"}&nbsp;{_ "Edit Event&hellip;"}</button>
19+
</form>
20+
{/if}
21+
</div>
22+
<h1>{$Event->Title|escape}</h1>
23+
</div>
24+
<div class="row">
25+
<div class="col-md-3">
26+
<ul class="row list-unstyled">
27+
{if $Event->Status != 'published'}
28+
<li class="col-sm-3 col-md-12">
29+
<p>
30+
<b>Status</b><br/>
31+
{$Event->Status}
32+
</p>
33+
</li>
34+
{/if}
35+
36+
<li class="col-sm-3 col-md-12">
37+
<p>
38+
<b>Start time</b><br/>
39+
{timestamp $Event->StartTime time=yes}
40+
</p>
41+
</li>
42+
43+
{if $Event->EndTime}
44+
<li class="col-sm-3 col-md-12">
45+
<p>
46+
<b>End time</b><br/>
47+
{timestamp $Event->EndTime time=yes}
48+
</p>
49+
</li>
50+
{/if}
51+
52+
{if $Event->Location}
53+
<li class="col-sm-3 col-md-12">
54+
<p>
55+
<b>Location</b><br/>
56+
<a href="https://www.google.com/maps?q={$Event->Location|escape:url}">{$Event->Location|escape}</a>
57+
</p>
58+
</li>
59+
{/if}
60+
</ul>
61+
</div>
62+
63+
<div class="col-md-9">
64+
{if $Event->Description}
65+
<div class="well">
66+
<div class="content-markdown event-description">{$Event->Description|truncate:600|escape|markdown}</div>
67+
</div>
68+
{/if}
69+
70+
{if $Event->Segments}
71+
<h2>Segments</h2>
72+
73+
{$lastDate = null}
74+
75+
{foreach item=Segment from=$Event->Segments}
76+
{$thisDate = date("l, F jS", $Segment->StartTime)}
77+
78+
{if $lastDate != $thisDate}
79+
{if $lastDate}
80+
</dl>
81+
{/if}
82+
<h3>{$thisDate}</h3>
83+
<dl class="dl-horizontal">
84+
{$lastDate = $thisDate}
85+
{/if}
86+
<dt>{time_range $Segment->StartTime $Segment->EndTime}</dt>
87+
<dd>
88+
<a href="{$Event->getUrl("segments/$Segment->Handle")}">{$Segment->Title|escape}</a>
89+
{if $Segment->LocationName || $Segment->LocationAddress}
90+
<p>
91+
<strong>Location</strong>
92+
<a target="_blank" href="https://maps.google.com?q={implode(', ', array_filter(array($Segment->LocationName, $Segment->LocationAddress)))|escape:url}">
93+
{if $Segment->LocationName && $Segment->LocationAddress}
94+
{$Segment->LocationName|escape} ({$Segment->LocationAddress|escape})
95+
{else}
96+
{$Segment->LocationName|default:$Segment->LocationAddress|escape}
97+
{/if}
98+
</a>
99+
</p>
100+
{/if}
101+
<div class="content-markdown event-segment-description">{$Segment->Description|escape|markdown}</div>
102+
</dd>
103+
{/foreach}
104+
{/if}
105+
</div>
106+
</div>
107+
{/block}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{extends designs/site.tpl}
2+
3+
{block title}{if $data->isPhantom}{_ 'Create'}{else}{_('Edit %s')|sprintf:$data->Title|escape}{/if} &mdash; {_ 'Events'} &mdash; {$dwoo.parent}{/block}
4+
5+
{block js-bottom}
6+
{$dwoo.parent}
7+
{jsmin "epiceditor.js"}
8+
{jsmin "pages/event-edit.js"}
9+
{/block}
10+
11+
{block content}
12+
{$Event = $data}
13+
14+
<div class="container">
15+
<div class="row">
16+
<div class="col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3">
17+
<div class="page-header">
18+
<h1>
19+
{if $Event->isPhantom}
20+
{_ "Create new event"}
21+
{else}
22+
{_("Edit event %s")|sprintf:$Event->Title|escape}
23+
{/if}
24+
</h1>
25+
</div>
26+
27+
{if !$Event->isValid}
28+
<div class="error well">
29+
<strong>{_ "There were problems with your entry:"}</strong>
30+
<ul class="errors">
31+
{foreach item=error key=field from=$Event->validationErrors}
32+
<li>{$error}</li>
33+
{/foreach}
34+
</ul>
35+
</div>
36+
{/if}
37+
38+
<form method="POST">
39+
<div class="form-group">
40+
<label for="field-title">{_ "Title"}:</label>
41+
<input name="Title" id="field-title" class="form-control" placeholder="{_ 'Workshop #125'}" value="{refill field=Title default=$Event->Title}" />
42+
</div>
43+
<div class="form-group">
44+
<label for="field-handle">{_ "Handle"} ({_ "optional"}):</label>
45+
<input name="Handle" id="field-handle" class="form-control" placeholder="{_ 'workshop-125'}" value="{refill field=Handle default=$Event->Handle}" />
46+
<p class="help-block">Must be unique &mdash; leave blank to auto-generate</p>
47+
</div>
48+
<div class="form-group">
49+
<label for="field-status">{_ "Status"}:</label>
50+
<select name="Status" id="field-status" class="form-control">
51+
{foreach item=status from=Emergence\Events\Event::getFieldOptions(Status, values)}
52+
<option {refill field=Status default=$Event->Status selected=$status}>{$status}</option>
53+
{/foreach}
54+
</select>
55+
</div>
56+
<div class="form-group">
57+
<label for="field-time-start">{_ "StartTime"}:</label>
58+
<input type="date" name="StartTime" id="field-time-start" class="form-control" value="{refill field=StartTime default=$Event->StartTime}"/>
59+
</div>
60+
<div class="form-group">
61+
<label for="field-time-end">{_ "EndTime"}:</label>
62+
<input type="date" name="EndTime" id="field-time-end" class="form-control" value="{refill field=EndTime default=$Event->EndTime}"/>
63+
</div>
64+
<div class="form-group">
65+
<label for="field-location">{_ "Location"}:</label>
66+
<input type="text" name="Location" id="field-location" class="form-control" placeholder="908 N 3rd St, Philadelphia PA" value="{refill field=Location default=$Event->Location}"/>
67+
</div>
68+
69+
<div class="form-group">
70+
<label for="field-description">{_ 'Description(.md)'}</label>
71+
<div class="controls">
72+
<textarea name="Description" class="input-block-level" rows="10">{refill field=Description default=$Event->Description}</textarea>
73+
</div>
74+
</div>
75+
76+
<button type="submit" class="btn btn-primary">{if $Event->isPhantom}{_ 'Create Event'}{else}{_ 'Save Changes'}{/if}</button>
77+
</form>
78+
</div>
79+
</div>
80+
</div>
81+
{/block}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{extends designs/site.tpl}
2+
3+
{block title}Saved {$data->Title|escape} &mdash; Events &mdash; {$dwoo.parent}{/block}
4+
5+
{block content}
6+
{$Event = $data}
7+
8+
{capture assign=eventLink}<a href="{$Event->getUrl()|escape}">{$Event->getTitle()|escape}</a>{/capture}
9+
10+
<div class="page-header">
11+
<h1>Event Created</h1>
12+
</div>
13+
{if $Event->isNew}
14+
<p>{_("Your event has been created: %s")|sprintf:$eventLink}</p>
15+
{else}
16+
<p>{_("Your changes to %s have been saved.")|sprintf:$eventLink}</p>
17+
{/if}
18+
{/block}

html-templates/events/events.tpl

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{extends "designs/site.tpl"}
2+
3+
{block title}{_ 'Events'} &mdash; {$dwoo.parent}{/block}
4+
5+
{block content}
6+
<header class="page-header">
7+
<div class="btn-toolbar pull-right">
8+
{if $.User}
9+
<form action="/events/create">
10+
<button class="btn btn-success" type="submit">{glyph "plus"}&nbsp;{_ "Add Event&hellip;"}</button>
11+
</form>
12+
{/if}
13+
</div>
14+
<h1>{_ "Events"} <span class="badge">{$total|number_format}</span></h1>
15+
</header>
16+
17+
<div class="row">
18+
<div class="col-sm-4 col-md-3">
19+
<ul>
20+
<li><a href="/events/*past">Past Events</a></li>
21+
<li><a href="/events/*upcoming">Upcoming Events</a></li>
22+
<li><a href="/events/*all">All Events</a></li>
23+
</ul>
24+
</div>
25+
<div class="col-sm-8 col-md-9">
26+
{foreach item=Event from=$data}
27+
<article class="post panel panel-default">
28+
<div class="panel-body">
29+
<h2 class="post-title">
30+
<a name="{$Event->Handle}" href="{$Event->getUrl()}">{$Event->Title|escape}</a>
31+
</h2>
32+
<ul class="row list-unstyled">
33+
{if $Event->Status != 'published'}
34+
<li class="col-md-3">
35+
<p>
36+
<b>Status</b><br/>
37+
{$Event->Status}
38+
</p>
39+
</li>
40+
{/if}
41+
42+
<li class="col-md-3">
43+
<p>
44+
<b>Start time</b><br/>
45+
{timestamp $Event->StartTime time=yes}
46+
</p>
47+
</li>
48+
49+
{if $Event->EndTime}
50+
<li class="col-md-3">
51+
<p>
52+
<b>End time</b><br/>
53+
{timestamp $Event->EndTime time=yes}
54+
</p>
55+
</li>
56+
{/if}
57+
58+
{if $Event->Location}
59+
<li class="col-md-3">
60+
<p>
61+
<b>Location</b><br/>
62+
<a href="https://www.google.com/maps?q={$Event->Location|escape:url}">{$Event->Location|escape}</a>
63+
</p>
64+
</li>
65+
{/if}
66+
</ul>
67+
{if $Event->Description}
68+
<div class="well">
69+
<div class="content-markdown event-description">{$Event->Description|truncate:600|escape|markdown}</div>
70+
</div>
71+
{/if}
72+
</div>
73+
</article>
74+
{foreachelse}
75+
<p><em>No events were found, try creating one{if count($conditions)} or <a href="?">browse without any filters</a>{/if}.</em></p>
76+
{/foreach}
77+
</div>
78+
</div>
79+
{/block}

0 commit comments

Comments
 (0)