/
event.tpl
107 lines (96 loc) · 4.09 KB
/
event.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{extends "designs/site.tpl"}
{block title}{_ 'Event'} — {$dwoo.parent}{/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>
</ol>
*}
<div class="btn-toolbar pull-right">
{if $.User}
<form action="{$Event->getUrl(edit)}">
<button class="btn btn-success" type="submit">{glyph "pencil"} {_ "Edit Event…"}</button>
</form>
{/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="col-md-9">
{if $Event->Description}
<div class="well">
<div class="markdown event-description">{$Event->Description|truncate:600|escape|markdown}</div>
</div>
{/if}
{if $Event->Segments}
<h2>Segments</h2>
{$lastDate = null}
{foreach item=Segment from=$Event->Segments}
{$thisDate = date("l, F jS", $Segment->StartTime)}
{if $lastDate != $thisDate}
{if $lastDate}
</dl>
{/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->Description|escape|markdown}
</dd>
{/foreach}
{/if}
</div>
</div>
{/block}