11{ extends " designs/site.tpl" }
22
3- { block title} { _ ' Event' } &mdash ; { $dwoo .parent} { /block }
3+ { block title} { $data -> Title |escape } &mdash ; { $dwoo .parent} { /block }
4+
5+ { block css}
6+ { $dwoo .parent}
7+
8+ <style >
9+ .event-description p :last-child {
10+ margin-bottom: 0;
11+ }
12+
13+ .event-details dt {
14+ font-size: 130% ;
15+ }
16+ .event-details dd {
17+ margin-bottom: 1em;
18+ }
19+
20+ .event-segments h4 {
21+ margin-top: 0;
22+ }
23+ .event-segments dl {
24+ margin-bottom: 0;
25+ }
26+ .event-segments dd {
27+ margin-bottom: 0.5em;
28+ }
29+ .event-segments .event-location {
30+ display: block ;
31+ margin-top: 1em;
32+ margin-bottom: 1em;
33+ }
34+ .event-segments .event-location dt {
35+ font-size: 200% ;
36+ }
37+ </style >
38+ { /block }
439
540{ block content}
641 { $Event = $data }
742
843 <div class =" page-header" >
9- { *
1044 <ol class =" breadcrumb" >
1145 <li ><a href =" /events" >{ _ " Events" } </a ></li >
12- <li><a href="{ $Event->getUrl()}">{$Event->Title|escape}</a> </li>
46+ <li >{ tif $Event -> EndTime > $.now ? ' Upcoming ' : ' Past ' } </li >
1347 </ol >
14- *}
1548 <div class =" btn-toolbar pull-right" >
1649 { if $.User}
17- <form action =" { $Event -> getUrl (edit)} " >
18- <button class =" btn btn-success" type =" submit" >{ icon " pencil" }   ; { _ " Edit Event…" } </button >
19- </form >
50+ <a class =" btn btn-success" href =" { $Event -> getUrl (edit)} " >{ icon " pencil" }   ; { _ " Edit Event" } </a >
51+ <a class =" btn btn-success" href =" { $Event -> getUrl (' segments/*create' )} " >{ icon " plus" }   ; { _ " Add Segment" } </a >
2052 { /if }
2153 </div >
2254 <h1 >{ $Event -> Title |escape } </h1 >
2355 </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 >
6256
57+ <div class =" row" >
6358 <div class =" col-md-9" >
6459 { if $Event -> Description }
65- <div class =" well" >
66- <div class =" content-markdown event-description" >{ $Event -> Description |truncate :600|escape |markdown} </div >
67- </div >
60+ <div class =" content-markdown event-description well" >{ $Event -> Description |escape |markdown} </div >
6861 { /if }
6962
7063 { if $Event -> Segments }
71- <h2 >Segments</h2 >
64+ <section class =" event-segments" >
65+ <h2 >Schedule</h2 >
7266
73- { $lastDate = null}
67+ { $lastDate = null}
68+ { $lastLocationName = null}
69+ { $lastLocationAddress = null}
7470
75- { foreach item= Segment from= $Event -> Segments }
76- { $thisDate = date(" l, F jS" , $Segment -> StartTime )}
71+ { foreach item= Segment from= $Event -> Segments }
72+ { $thisDate = date(" l, F jS" , $Segment -> StartTime )}
7773
78- { if $lastDate != $thisDate }
79- { if $lastDate }
80- </dl >
74+ { if $lastDate != $thisDate }
75+ { if $lastDate }
76+ </dl >
77+ { /if }
78+ <h3 >{ $thisDate } </h3 >
79+ <dl class =" dl-horizontal" >
80+ { $lastDate = $thisDate }
81+ { $lastLocationName = null}
82+ { $lastLocationAddress = null}
8183 { /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 >
84+ { if
85+ (
86+ $Segment -> LocationName != $lastLocationName
87+ || $Segment -> LocationAddress != $lastLocationAddress
88+ )
89+ && ($Segment -> LocationName || $Segment -> LocationAddress )
90+ }
91+ <div class =" event-location" >
92+ <dt >{ icon " map-marker" } </dt >
93+ <dd >{ eventLocation name= $Segment -> LocationName address= $Segment -> LocationAddress } </dd >
94+ </div >
10095 { /if }
101- <div class =" content-markdown event-segment-description" >{ $Segment -> Description |escape |markdown} </div >
102- </dd >
103- { /foreach }
96+ <dt >{ time_range $Segment -> StartTime $Segment -> EndTime } </dt >
97+ <dd >
98+ <h4 ><a href =" { $Segment -> getUrl ()} " >{ $Segment -> Title |escape } </a ></h4 >
99+ <div class =" content-markdown event-segment-description" >{ $Segment -> Description |escape |markdown} </div >
100+ </dd >
101+
102+ { $lastLocationName = $Segment -> LocationName }
103+ { $lastLocationAddress = $Segment -> LocationAddress }
104+ { /foreach }
105+ </foreach >
104106 { /if }
105107 </div >
108+
109+ <dl class =" event-details col-md-3" >
110+ { if $Event -> Status != ' published' }
111+ <dt >Status</dt >
112+ <dd >{ $Event -> Status } </dd >
113+ { /if }
114+
115+ <dt >Starts</dt >
116+ <dd >{ timestamp $Event -> StartTime time= ' auto' } </dd >
117+
118+ { if $Event -> EndTime }
119+ <dt >Ends</dt >
120+ <dd >{ timestamp $Event -> EndTime time= ' auto' } </dd >
121+ { /if }
122+
123+ { if $Event -> LocationName || $Event -> LocationAddress }
124+ <dt >Location</dt >
125+ <dd >{ eventLocation name= $Event -> LocationName address= $Event -> LocationAddress } </dd >
126+ { /if }
127+ </dl >
106128 </div >
107129{ /block }
0 commit comments