Skip to content

Event segment editing #200

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 6 commits into from
Aug 14, 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
9 changes: 8 additions & 1 deletion .holo/branches/emergence-site/_skeleton-v2.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
[holomapping]
files = [
"*/**",
"!php-config/Git.config.d/"
"!php-config/Git.config.d/",
"!sencha-workspace/ext/**/rtl/**",
"!sencha-workspace/ext/**/test/**",
"!sencha-workspace/ext/classic/theme-aria/**",
"!sencha-workspace/ext/classic/theme-classic/**",
"!sencha-workspace/ext/classic/theme-classic-sandbox/**",
"!sencha-workspace/ext/classic/theme-gray/**",
"!sencha-workspace/ext/modern/theme-*/**"
]
before = "*"
2 changes: 2 additions & 0 deletions .holo/branches/emergence-vfs-site.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[holobranch]
extend = "emergence-site"
2 changes: 2 additions & 0 deletions .holo/branches/emergence-vfs-site/_layer-vfs.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[holomapping]
files = "*/**"
3 changes: 3 additions & 0 deletions .holo/sources/layer-vfs.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[holosource]
url = "https://github.com/EmergencePlatform/layer-vfs.git"
ref = "refs/heads/emergence/layer"
3 changes: 2 additions & 1 deletion html-templates/designs/site.subtemplates.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
{load_templates subtemplates/forms.tpl}
{load_templates subtemplates/projects.tpl}
{load_templates subtemplates/buzz.tpl}
{load_templates subtemplates/updates.tpl}
{load_templates subtemplates/updates.tpl}
{load_templates subtemplates/events.tpl}
174 changes: 98 additions & 76 deletions html-templates/events/event.tpl
Original file line number Diff line number Diff line change
@@ -1,107 +1,129 @@
{extends "designs/site.tpl"}

{block title}{_ 'Event'} — {$dwoo.parent}{/block}
{block title}{$data->Title|escape} — {$dwoo.parent}{/block}

{block css}
{$dwoo.parent}

<style>
.event-description p:last-child {
margin-bottom: 0;
}

.event-details dt {
font-size: 130%;
}
.event-details dd {
margin-bottom: 1em;
}

.event-segments h4 {
margin-top: 0;
}
.event-segments dl {
margin-bottom: 0;
}
.event-segments dd {
margin-bottom: 0.5em;
}
.event-segments .event-location {
display: block;
margin-top: 1em;
margin-bottom: 1em;
}
.event-segments .event-location dt {
font-size: 200%;
}
</style>
{/block}

{block content}
{$Event = $data}

<div class="page-header">
{*
<ol class="breadcrumb">
<li><a href="/events">{_ "Events"}</a></li>
<li><a href="{$Event->getUrl()}">{$Event->Title|escape}</a></li>
<li>{tif $Event->EndTime > $.now ? 'Upcoming' : 'Past'}</li>
</ol>
*}
<div class="btn-toolbar pull-right">
{if $.User}
<form action="{$Event->getUrl(edit)}">
<button class="btn btn-success" type="submit">{icon "pencil"}&nbsp;{_ "Edit Event&hellip;"}</button>
</form>
<a class="btn btn-success" href="{$Event->getUrl(edit)}">{icon "pencil"}&nbsp;{_ "Edit Event"}</a>
<a class="btn btn-success" href="{$Event->getUrl('segments/*create')}">{icon "plus"}&nbsp;{_ "Add Segment"}</a>
{/if}
</div>
<h1>{$Event->Title|escape}</h1>
</div>
<div class="row">
<div class="col-md-3">
<ul class="row list-unstyled">
{if $Event->Status != 'published'}
<li class="col-sm-3 col-md-12">
<p>
<b>Status</b><br/>
{$Event->Status}
</p>
</li>
{/if}

<li class="col-sm-3 col-md-12">
<p>
<b>Start time</b><br/>
{timestamp $Event->StartTime time=yes}
</p>
</li>

{if $Event->EndTime}
<li class="col-sm-3 col-md-12">
<p>
<b>End time</b><br/>
{timestamp $Event->EndTime time=yes}
</p>
</li>
{/if}

{if $Event->Location}
<li class="col-sm-3 col-md-12">
<p>
<b>Location</b><br/>
<a href="https://www.google.com/maps?q={$Event->Location|escape:url}">{$Event->Location|escape}</a>
</p>
</li>
{/if}
</ul>
</div>

<div class="row">
<div class="col-md-9">
{if $Event->Description}
<div class="well">
<div class="content-markdown event-description">{$Event->Description|truncate:600|escape|markdown}</div>
</div>
<div class="content-markdown event-description well">{$Event->Description|escape|markdown}</div>
{/if}

{if $Event->Segments}
<h2>Segments</h2>
<section class="event-segments">
<h2>Schedule</h2>

{$lastDate = null}
{$lastDate = null}
{$lastLocationName = null}
{$lastLocationAddress = null}

{foreach item=Segment from=$Event->Segments}
{$thisDate = date("l, F jS", $Segment->StartTime)}
{foreach item=Segment from=$Event->Segments}
{$thisDate = date("l, F jS", $Segment->StartTime)}

{if $lastDate != $thisDate}
{if $lastDate}
</dl>
{if $lastDate != $thisDate}
{if $lastDate}
</dl>
{/if}
<h3>{$thisDate}</h3>
<dl class="dl-horizontal">
{$lastDate = $thisDate}
{$lastLocationName = null}
{$lastLocationAddress = null}
{/if}
<h3>{$thisDate}</h3>
<dl class="dl-horizontal">
{$lastDate = $thisDate}
{/if}
<dt>{time_range $Segment->StartTime $Segment->EndTime}</dt>
<dd>
<a href="{$Event->getUrl("segments/$Segment->Handle")}">{$Segment->Title|escape}</a>
{if $Segment->LocationName || $Segment->LocationAddress}
<p>
<strong>Location</strong>
<a target="_blank" href="https://maps.google.com?q={implode(', ', array_filter(array($Segment->LocationName, $Segment->LocationAddress)))|escape:url}">
{if $Segment->LocationName && $Segment->LocationAddress}
{$Segment->LocationName|escape} ({$Segment->LocationAddress|escape})
{else}
{$Segment->LocationName|default:$Segment->LocationAddress|escape}
{/if}
</a>
</p>
{if
(
$Segment->LocationName != $lastLocationName
|| $Segment->LocationAddress != $lastLocationAddress
)
&& ($Segment->LocationName || $Segment->LocationAddress)
}
<div class="event-location">
<dt>{icon "map-marker"}</dt>
<dd>{eventLocation name=$Segment->LocationName address=$Segment->LocationAddress}</dd>
</div>
{/if}
<div class="content-markdown event-segment-description">{$Segment->Description|escape|markdown}</div>
</dd>
{/foreach}
<dt>{time_range $Segment->StartTime $Segment->EndTime}</dt>
<dd>
<h4><a href="{$Segment->getUrl()}">{$Segment->Title|escape}</a></h4>
<div class="content-markdown event-segment-description">{$Segment->Description|escape|markdown}</div>
</dd>

{$lastLocationName = $Segment->LocationName}
{$lastLocationAddress = $Segment->LocationAddress}
{/foreach}
</foreach>
{/if}
</div>

<dl class="event-details col-md-3">
{if $Event->Status != 'published'}
<dt>Status</dt>
<dd>{$Event->Status}</dd>
{/if}

<dt>Starts</dt>
<dd>{timestamp $Event->StartTime time='auto'}</dd>

{if $Event->EndTime}
<dt>Ends</dt>
<dd>{timestamp $Event->EndTime time='auto'}</dd>
{/if}

{if $Event->LocationName || $Event->LocationAddress}
<dt>Location</dt>
<dd>{eventLocation name=$Event->LocationName address=$Event->LocationAddress}</dd>
{/if}
</dl>
</div>
{/block}
18 changes: 11 additions & 7 deletions html-templates/events/eventEdit.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{block js-bottom}
{$dwoo.parent}
{jsmin "epiceditor.js"}
{jsmin "lib/epiceditor.js"}
{jsmin "pages/event-edit.js"}
{/block}

Expand Down Expand Up @@ -54,16 +54,20 @@
</select>
</div>
<div class="form-group">
<label for="field-time-start">{_ "StartTime"}:</label>
<input type="date" name="StartTime" id="field-time-start" class="form-control" value="{refill field=StartTime default=$Event->StartTime}"/>
<label for="field-time-start">{_ "Start time"}:</label>
<input type="datetime-local" name="StartTime" id="field-time-start" class="form-control" value="{refill field=StartTime default=tif($Event->StartTime, date('Y-m-d\TH:i', $Event->StartTime))}"/>
</div>
<div class="form-group">
<label for="field-time-end">{_ "EndTime"}:</label>
<input type="date" name="EndTime" id="field-time-end" class="form-control" value="{refill field=EndTime default=$Event->EndTime}"/>
<label for="field-time-end">{_ "End time"}:</label>
<input type="datetime-local" name="EndTime" id="field-time-end" class="form-control" value="{refill field=EndTime default=tif($Event->EndTime, date('Y-m-d\TH:i', $Event->EndTime))}"/>
</div>
<div class="form-group">
<label for="field-location">{_ "Location"}:</label>
<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}"/>
<label for="field-location-name">{_ "Location name"}:</label>
<input type="text" name="LocationName" id="field-location-name" class="form-control" placeholder="Localhost" value="{refill field=LocationName default=$Event->LocationName}"/>
</div>
<div class="form-group">
<label for="field-location-address">{_ "Location address"}:</label>
<input type="text" name="LocationAddress" id="field-location-address" class="form-control" placeholder="908 N 3rd St, Philadelphia PA" value="{refill field=LocationAddress default=$Event->LocationAddress}"/>
</div>

<div class="form-group">
Expand Down
2 changes: 1 addition & 1 deletion html-templates/events/eventSaved.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{capture assign=eventLink}<a href="{$Event->getUrl()|escape}">{$Event->getTitle()|escape}</a>{/capture}

<div class="page-header">
<h1>Event Created</h1>
<h1>Event Saved</h1>
</div>
{if $Event->isNew}
<p>{_("Your event has been created: %s")|sprintf:$eventLink}</p>
Expand Down
62 changes: 62 additions & 0 deletions html-templates/events/eventSegment.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{extends "designs/site.tpl"}

{block title}{$data->Title|escape} @ {$data->Event->Title|escape} &mdash; {$dwoo.parent}{/block}

{block css}
{$dwoo.parent}

<style>
.event-segment-description p:last-child {
margin-bottom: 0;
}

.event-segment-details dt {
font-size: 130%;
}
.event-segment-details dd {
margin-bottom: 1em;
}
</style>
{/block}

{block content}
{$Segment = $data}
{$Event = $Segment->Event}

<div class="page-header">
<ol class="breadcrumb">
<li><a href="/events">{_ "Events"}</a></li>
<li><a href="{$Event->getUrl()}">{$Event->Title|escape}</a></li>
<li>Schedule</li>
</ol>
<div class="btn-toolbar pull-right">
{if $.User}
<a class="btn btn-success" href="{$Segment->getUrl(edit)}">{icon "pencil"}&nbsp;{_ "Edit Segment"}</a>
{/if}
</div>
<h1>{$Segment->Title|escape}</h1>
</div>

<div class="row">
<div class="col-md-9">
{if $Segment->Description}
<div class="content-markdown event-segment-description well">{$Segment->Description|escape|markdown}</div>
{/if}
</div>

<dl class="event-segment-details col-md-3">
<dt>Starts</dt>
<dd>{timestamp $Segment->StartTime time='auto'}</dd>

{if $Segment->EndTime}
<dt>Ends</dt>
<dd>{timestamp $Segment->EndTime time='auto'}</dd>
{/if}

{if $Segment->LocationName || $Segment->LocationAddress}
<dt>Location</dt>
<dd>{eventLocation name=$Segment->LocationName address=$Segment->LocationAddress}</dd>
{/if}
</dl>
</div>
{/block}
Loading