1
1
{ extends " designs/site.tpl" }
2
2
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 }
4
39
5
40
{ block content}
6
41
{ $Event = $data }
42
+ { load_templates " subtemplates.tpl" }
7
43
8
44
<div class =" page-header" >
9
- { *
10
45
<ol class =" breadcrumb" >
11
46
<li ><a href =" /events" >{ _ " Events" } </a ></li >
12
- <li><a href="{ $Event->getUrl()}">{$Event->Title|escape}</a> </li>
47
+ <li >{ tif $Event -> EndTime > $.now ? ' Upcoming ' : ' Past ' } </li >
13
48
</ol >
14
- *}
15
49
<div class =" btn-toolbar pull-right" >
16
50
{ if $.User}
17
- <form action =" { $Event -> getUrl (edit)} " >
18
- <button class =" btn btn-success" type =" submit" >{ glyph " pencil" }   ; { _ " Edit Event…" } </button >
19
- </form >
51
+ <a class =" btn btn-success" href =" { $Event -> getUrl (edit)} " >{ glyph " pencil" }   ; { _ " Edit Event" } </a >
52
+ <a class =" btn btn-success" href =" { $Event -> getUrl (' segments/*create' )} " >{ glyph " plus" }   ; { _ " Add Segment" } </a >
20
53
{ /if }
21
54
</div >
22
55
<h1 >{ $Event -> Title |escape } </h1 >
23
56
</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
57
58
+ <div class =" row" >
63
59
<div class =" col-md-9" >
64
60
{ if $Event -> Description }
65
- <div class =" well" >
66
- <div class =" content-markdown event-description" >{ $Event -> Description |truncate :600|escape |markdown} </div >
67
- </div >
61
+ <div class =" content-markdown event-description well" >{ $Event -> Description |escape |markdown} </div >
68
62
{ /if }
69
63
70
64
{ if $Event -> Segments }
71
- <h2 >Segments</h2 >
65
+ <section class =" event-segments" >
66
+ <h2 >Schedule</h2 >
72
67
73
- { $lastDate = null}
68
+ { $lastDate = null}
69
+ { $lastLocationName = null}
70
+ { $lastLocationAddress = null}
74
71
75
- { foreach item= Segment from= $Event -> Segments }
76
- { $thisDate = date(" l, F jS" , $Segment -> StartTime )}
72
+ { foreach item= Segment from= $Event -> Segments }
73
+ { $thisDate = date(" l, F jS" , $Segment -> StartTime )}
77
74
78
- { if $lastDate != $thisDate }
79
- { if $lastDate }
80
- </dl >
75
+ { if $lastDate != $thisDate }
76
+ { if $lastDate }
77
+ </dl >
78
+ { /if }
79
+ <h3 >{ $thisDate } </h3 >
80
+ <dl class =" dl-horizontal" >
81
+ { $lastDate = $thisDate }
82
+ { $lastLocationName = null}
83
+ { $lastLocationAddress = null}
81
84
{ /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 >
85
+ { if
86
+ (
87
+ $Segment -> LocationName != $lastLocationName
88
+ || $Segment -> LocationAddress != $lastLocationAddress
89
+ )
90
+ && ($Segment -> LocationName || $Segment -> LocationAddress )
91
+ }
92
+ <div class =" event-location" >
93
+ <dt >{ icon " map-marker" } </dt >
94
+ <dd >{ eventLocation name= $Segment -> LocationName address= $Segment -> LocationAddress } </dd >
95
+ </div >
100
96
{ /if }
101
- <div class =" content-markdown event-segment-description" >{ $Segment -> Description |escape |markdown} </div >
102
- </dd >
103
- { /foreach }
97
+ <dt >{ time_range $Segment -> StartTime $Segment -> EndTime } </dt >
98
+ <dd >
99
+ <h4 ><a href =" { $Segment -> getUrl ()} " >{ $Segment -> Title |escape } </a ></h4 >
100
+ <div class =" content-markdown event-segment-description" >{ $Segment -> Description |escape |markdown} </div >
101
+ </dd >
102
+
103
+ { $lastLocationName = $Segment -> LocationName }
104
+ { $lastLocationAddress = $Segment -> LocationAddress }
105
+ { /foreach }
106
+ </foreach >
104
107
{ /if }
105
108
</div >
109
+
110
+ <dl class =" event-details col-md-3" >
111
+ { if $Event -> Status != ' published' }
112
+ <dt >Status</dt >
113
+ <dd >{ $Event -> Status } </dd >
114
+ { /if }
115
+
116
+ <dt >Starts</dt >
117
+ <dd >{ timestamp $Event -> StartTime time= ' auto' } </dd >
118
+
119
+ { if $Event -> EndTime }
120
+ <dt >Ends</dt >
121
+ <dd >{ timestamp $Event -> EndTime time= ' auto' } </dd >
122
+ { /if }
123
+
124
+ { if $Event -> LocationName || $Event -> LocationAddress }
125
+ <dt >Location</dt >
126
+ <dd >{ eventLocation name= $Event -> LocationName address= $Event -> LocationAddress } </dd >
127
+ { /if }
128
+ </dl >
106
129
</div >
107
130
{ /block }
0 commit comments