-
Notifications
You must be signed in to change notification settings - Fork 0
/
event.twig
265 lines (180 loc) · 12.1 KB
/
event.twig
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
{% import "partials/quotes.twig" as quotes %}
{{ set(this, 'title', event.title) }}
{{this.registerLinkTag({rel:'amphtml', href:_AppHelper.getServerUrl(false)~'?amp=1'})}}
{# {{this.registerJsFile("https://maps.googleapis.com/maps/api/js?key=AIzaSyCRILYoQMiSjf_1Q_DhL199ha5w410AOLU")}} #}
{% set networkData = _Network.getNetworkData() %}
{% set site = networkData.title | lower | split(" ")[0]%}
{% set config = _Network.getThemeConfig() %}
{% set eventImage = false %}
{% if event.media | length > 0 %}
{% set eventImage = _Media.getMediaUrl(event.media[0], 750, 420, {'crop': 'fill', 'gravity': 'auto'} ) %}
{% endif %}
{% set startDate = _AppHelper.getDefaultTimezoneDateTime(event.startDate, 'j M') %}
{% set fullStartDate = _AppHelper.getDefaultTimezoneDateTime(event.startDate, 'j F') %}
{% set fullStartDate = _AppHelper.getDefaultTimezoneDateTime(event.startDate, 'l, dS F Y') %}
{% set endDate = _AppHelper.getDefaultTimezoneDateTime(event.endDate, 'j M') %}
{% set startDay = _AppHelper.getDefaultTimezoneDateTime(event.startDate, 'd') %}
{% set endDay = _AppHelper.getDefaultTimezoneDateTime(event.endDate, 'd') %}
{% set startTime = _AppHelper.getDefaultTimezoneDateTime(event.startDate, 'g:ia') %}
{% set endTime = _AppHelper.getDefaultTimezoneDateTime(event.endDate, 'g:ia') %}
{% set fullStartTime = _AppHelper.getDefaultTimezoneDateTime(event.startDate, 'g:ia M j') %}
{% set fullEndTime = _AppHelper.getDefaultTimezoneDateTime(event.endDate, 'g:ia M j') %}
{% set eventMonth = _AppHelper.getDefaultTimezoneDateTime(event.startDate, 'F') %}
{% set startMonth = _AppHelper.getDefaultTimezoneDateTime(event.startDate, 'F') %}
{% set endMonth = _AppHelper.getDefaultTimezoneDateTime(event.endDate, 'F') %}
{% if startTime == '12:00am' %}
{% set startTime = '' %}
{% set endTime = '' %}
{% endif %}
{% set date = date() %}
{% set events = _Event.getEvents({"limit": 4, "showOnGoingOnly": 1}) %}
<div class="o-body-container o-body-container-md u-margin-top-60 u-mobile-no-margin-top">
<div class="container">
<div class="row">
<div class="col-12 col-xl-7">
<div class="c-eventdetail">
<div class="c-eventdetail__head">
{# {% if _User.isAdminUser() %}
<a href="{{event.editUrl}}" target="_blank" class="c-button c-button--blue">Edit article</a>
{% endif %} #}
<a href="{{ networkData.defaultBlogUrl }}/events">
<div class="c-eventdetail__category">
Events
</div>
</a>
<div class="c-eventdetail__title">
{{ quotes.smarten(event.title) }}
</div>
<div class="c-eventdetail__social u-mobile-margin-bottom-20 u-margin-bottom-30">
<div class="c-eventdetail__social-text">Share event</div>
<a href="" target="_blank">
<div class="c-eventdetail__social-icon c-eventdetail__social-icon--facebook">
{{ this.render('/partials/icons.twig', {icon: 'facebook'} ) | raw }}
</div>
</a>
<a href="" target="_blank">
<div class="c-eventdetail__social-icon c-eventdetail__social-icon--twitter">
{{ this.render('/partials/icons.twig', {icon: 'twitter'} ) | raw }}
</div>
</a>
<a href="" target="_blank" >
<div class="c-eventdetail__social-icon c-eventdetail__social-icon--email">
{{ this.render('/partials/icons.twig', {icon: 'email'} ) | raw }}
</div>
</a>
<a href="" target="_blank" >
<div class="c-eventdetail__social-icon c-eventdetail__social-icon--linkedin">
{{ this.render('/partials/icons.twig', {icon: 'linkedin'} ) | raw }}
</div>
</a>
</div>
</div>
{% if eventImage %}
<div class="c-eventdetail__media">
<figure class="c-eventdetail__figure">
<img src="{{eventImage}}" class="img-fluid" alt="Article Info">
</figure>
</div>
{% endif %}
<div class="c-eventdetail__container">
<div class="row">
<div class="col-md-4">
<div class="c-eventdetail__info">
<div class="c-eventdetail__info-item">
{{ this.render('partials/icons.twig', {icon: 'calendar'} ) | raw }}
{# <span class="c-eventdetail__info-text">{{ startDate }}</span> #}
<span class="c-eventdetail__info-text"><strong style="font-weight:700">{{startDay}} {{startMonth}}</strong> {{startTime}}{% if fullEndTime != fullStartTime and (endDate != startDate or endTime != "") %} - {% if endDate != startDate %} <br /><strong style="font-weight:700">{{endDay}} {{endMonth}}</strong>{% endif %}{% if endTime != "" %} {{endTime}}{% endif %}{% endif %}</span>
</div>
{# <div class="c-eventdetail__info-item">
{{ this.render('partials/icons.twig', {icon: 'clock'} ) | raw }}
<span class="c-eventdetail__info-text">{{ startTime }}{% if event.endDate != "" %} - {{endTime}}{% endif %}</span>
</div> #}
<div class="c-eventdetail__info-item">
{{ this.render('partials/icons.twig', {icon: 'location'} ) | raw }}
<span class="c-eventdetail__info-text">{{ event.address.address1 }},<br/>
{{ event.address.suburb }}</span>
</div>
{# <div class="c-eventdetail--source">
<span class="fa fa-laptop"></span>
youtube.com/johnbobbelitandhisband
</div> #}
{% set contactDetails = "" %}
{% if event.contactNumber != "" %}
{% set contactDetails = event.contactNumber %}
{% endif %}
{% if event.contactEmail != "" %}
{% if contactDetails != "" %}
{% set contactDetails = contactDetails ~ ", " ~ event.contactEmail %}
{% else %}
{% set contactDetails = event.contactEmail %}
{% endif %}
{% endif %}
{% if contactDetails != "" %}
<div class="c-eventdetail__info-item">
{{ this.render('partials/icons.twig', {icon: 'email'} ) | raw }}
<span class="c-eventdetail__info-text" >{{event.contactName}} {{contactDetails}}</span>
</div>
{% endif %}
</div>
</div>
<div class="col-md-8">
<div class="c-eventdetail__content u-mobile-margin-top-20">
{{ event.content | raw }}
</div>
</div>
{% if event.latitude and event.longitude %}
<div class="col-md-12">
<div class="event-map u-margin-top-60">
<div id="addressMap" data-latitude="{{event.latitude}}" data-longitude="{{event.longitude}}" style="width:100%;min-height:500px;background:rgba(0,0,0,.3)"></div>
</div>
</div>
{% endif %}
</div>
</div>
</div>
</div>
<div class="col-12 offset-xl-1 col-xl c-events u-border-left u-mobile-margin-top-30 d-md-none d-xl-block">
{% set events = _Event.getEvents({"limit": limit, "start_date": date.date | split(" ")[0]}) %}
<div class="c-events-panel c-events-panel-xs">
<h4 class="c-events-panel__head c-events-panel__head-xs">Upcoming Events</h4>
<div class="c-events-panel__details">
{% for i in 0..3 if events[i] %}
{{this.render('partials/_single-event-list.twig', {
event: events[i],
imageSuppress: 'true',
containerClass: "event-card-2-mobile event-card-2-tablet event-card-2-desktop"
}) | raw}}
{% endfor %}
</div>
</div>
<div class="u-margin-top-30">
{% if config['inventory']['adSpace']['hpage'][0] is defined %}
<div class="j-adslot" id="{{config['inventory']['adSpace']['hpage'][0]}}" data-adshape="hpage"></div>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% if event.latitude and event.longitude %}
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCRILYoQMiSjf_1Q_DhL199ha5w410AOLU" type="text/javascript"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
Acme.eventMap = new Acme.GoogleMap();
});
</script>
{% endif %}
{# <div class="col-md-12">
<a href="https://www.facebook.com/sharer/sharer.php?u={{event.url}}&title={{ event.title|url_encode }}" class="share-icon facebook-icon"></a
><a href="https://twitter.com/share?text={{ event.title|url_encode }}&url={{event.url}}" class="share-icon twitter-icon"></a
><a href="mailto:?subject=Check%20out%20this%20article&body={{event.url}}" class="share-icon email-icon"></a>
</div> #}
{# show start date OR start and end data if different #}
{# {% set difference = date(event.endDate).diff(date(event.startDate)) %}
{% set leftDays = difference.days %}
{% if leftDays > 0 %}
<p class="date">{{ startDate }} - {{ endDate }}</p>
{% else %}
<p class="date">{{ startDate }}</p>
<p class="time">{{ startTime }} - {{ endTime }} </p>
{% endif %} #}