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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
|
{{#if eventHasCoverImage}}
<div id="eventImageContainer" style="background-image: url(/events/{{eventData.image}});"></div>
{{else}}
<div id="genericEventImageContainer" style="background-image: url(/images/seigaiha.png);"></div>
{{/if}}
<div class="row">
<div class="col-lg">
<h3 id="eventName">{{eventData.name}}</h3>
</div>
{{#if editingEnabled}}
<div class="col-lg-2 text-right">
<div class="btn-group" role="group" aria-label="Event controls">
<button type="button" id="editEvent" class="btn btn-success" data-toggle="modal" data-target="#editModal" {{#if eventHasConcluded}}disabled{{/if}}><i class="fas fa-edit"></i></button>
<button type="button" id="deleteEvent" class="btn btn-danger" data-toggle="modal" data-target="#deleteModal"><i class="fas fa-trash"></i></button>
</div>
</div>
{{/if}}
</div>
<div class="card mt-4 mb-4">
<div class="card-body">
<ul class="fa-ul eventInformation">
<li>
<span class="fa-li">
<i class="fas fa-map-marker-alt"></i>
</span>
{{eventData.location}}
<a href="http://maps.google.com/?q={{parsedLocation}}" class="eventInformationAction btn btn-outline-secondary btn-sm">
<i class="fas fa-map-marker-alt"></i> Find on Google Maps
</a>
</li>
{{#if eventHasHost}}
<li>
<span class="fa-li">
<i class="fas fa-fw fa-user-circle"></i>
</span>
<span class="text-muted">Hosted by</span> {{eventData.hostName}}
</li>
{{/if}}
<li>
<span class="fa-li">
<i class="far fa-fw fa-calendar-alt"></i>
</span>
{{{displayDate}}}
<a href="http://www.google.com/calendar/event?action=TEMPLATE&dates={{parsedStart}}%2F{{parsedEnd}}&text={{escapedName}}&location={{parsedLocation}}&ctz={{timezone}}" class="eventInformationAction btn btn-outline-secondary btn-sm">
<i class="far fa-calendar-plus"></i> Add to Google Calendar
</a>
<br>
<span class="text-muted">
{{#if eventHasBegun}}{{#unless eventHasConcluded}}Started {{else}}Ended {{/unless}}{{/if}}{{fromNow}}
</span>
</li>
{{#if eventData.url}}
<li>
<span class="fa-li">
<i class="fas fa-link"></i>
</span>
<a href="{{eventData.url}}">
{{eventData.url}}
</a>
</li>
{{/if}}
<li>
<span class="fa-li">
<i class="fas fa-share-square"></i>
</span>
<a href="https://gath.io/{{eventData.id}}">
gath.io/{{eventData.id}}
</a>
<button type="button" id="copyEventLink" class="eventInformationAction btn btn-outline-secondary btn-sm" data-clipboard-text="https://gath.io/{{eventData.id}}">
<i class="fas fa-copy"></i> Copy
</button>
</li>
</ul>
</div>
</div>
{{#if eventHasConcluded}}
<div class="alert alert-warning mb-4" role="alert">
This event has concluded. It can no longer be edited, and will be automatically deleted <span class="daysToDeletion"></span>.
</div>
{{/if}}
{{#if firstLoad}}
<div class="alert alert-success alert-dismissible fade show" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
Welcome to your event! We've just sent you an email with your secret editing link, which you can also see in the address bar above. Haven't got the email? Check your spam or junk folder. To share your event, use the link you can see just above this message - that way your attendees won't be able to edit or delete your event!
</div>
{{/if}}
<div class="card mb-4" id="eventDescription">
<h5 class="card-header">About</h5>
<div class="card-body">
{{{parsedDescription}}}
</div>
</div>
{{#if eventData.usersCanAttend}}
<div class="card mb-4" id="eventAttendees">
<h5 class="card-header" style="width:100%;display:flex;justify-content:space-between;align-items:center">Attendees {{#if eventData.attendees}}({{eventData.attendees.length}}){{/if}}<button type="button" id="attendEvent" class="btn btn-primary" data-toggle="modal" data-target="#attendModal"><i class="fas fa-user-plus"></i> I'm going!</button></h5>
<div class="card-body">
{{#if eventData.attendees}}
<ul class="attendeesList">
{{#each eventData.attendees}}
<li>{{this.name}}</li>
{{/each}}
</ul>
{{else}}
<p class="text-center text-muted mb-0">No attendees yet!</p>
{{/if}}
</div>
</div>
<div class="modal fade" id="attendModal" tabindex="-1" role="dialog" aria-labelledby="attendModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="attendModalLabel">Add yourself to '{{eventData.name}}'</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<form id="attendEventForm" action="/attendevent/{{eventData.id}}" method="post">
<div class="modal-body">
<div class="form-group row">
<label for="attendeeName" class="col-sm-2 col-form-label">Your name</label>
<div class="form-group col-sm-10">
<input type="text" class="form-control" id="attendeeName" name="attendeeName" placeholder="Or an alias, perhaps..." data-validation="required length" data-validation-length="3-16">
</div>
</div>
<div class="form-group row">
<label for="attendeeEmail" class="col-sm-2 col-form-label">Your email</label>
<div class="form-group col-sm-10">
<input type="email" class="form-control" id="attendeeEmail" name="attendeeEmail" placeholder="We won't spam you <3" data-validation="email" data-validation-optional="true">
<small class="form-text">Optional - we'll use it to send you any updates to the event.</small>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Add myself</button>
</div>
</form>
</div>
</div>
</div>
{{/if}}
{{#if eventData.usersCanComment}}
<div class="card mb-4" id="eventComments">
<h5 class="card-header">Discussion</h5>
<div class="card-body">
<form id="commentForm" action="/post/comment/{{eventData.id}}/" method="post">
<div class="form-group">
<input type="text" class="form-control" id="commentAuthor" name="commentAuthor" placeholder="Your name" data-validation="required length" data-validation-length="3-60">
</div>
<div class="form-group">
<div class="input-group">
<textarea class="form-control" id="commentContent" name="commentContent" style="resize: none;" placeholder="What would you like to ask?" data-validation="required length" data-validation-length="3-280"></textarea>
<div class="input-group-append">
<button type="submit" class="btn btn-primary btn-block h-100" id="postComment">Send <i class="fas fa-chevron-right"></i></button>
</div>
</div>
</div>
</form>
{{#if eventData.comments}}
<hr style="border-style:dashed;">
<div class="container commentsList">
{{#each eventData.comments}}
<div class="comment">
<div class="row commentContainer">
<div class="col-lg commentText">
<p class="mb-0"><strong>{{this.author}}</strong> <small class="commentTimestamp text-muted">{{this.timestamp}}</small></p>
<p>{{this.content}}</p>
{{#if this.replies}}
<hr>
<div class="repliesContainer">
{{#each this.replies}}
<p class="mb-0"><strong><i class="fas fa-reply text-muted"></i> {{this.author}}</strong> <small class="commentTimestamp text-muted">{{this.timestamp}}</small></p>
<p>{{this.content}}</p>
{{/each}}
</div>
{{/if}}
</div>
<div class="col-lg-3 commentMetadata text-right">
<button type="button" class="btn btn-outline-primary btn-sm openReplyBox">
<i class="fas fa-comment"></i> Reply
</button>
{{#if ../editingEnabled}}
<form class="d-inline" action="/deletecomment/{{../eventData.id}}/{{this._id}}/{{../eventData.editToken}}" method="post">
<button type="submit" class="btn btn-outline-danger btn-sm deleteComment">
<i class="fas fa-trash"></i> Delete
</button>
</form>
{{/if}}
</div>
</div>
<div class="row replyContainer">
<div class="col-md">
<form id="replyForm" action="/post/reply/{{../eventData.id}}/{{this._id}}" method="post">
<div class="form-group">
<input type="text" class="form-control form-control-sm" id="replyAuthor" name="replyAuthor" placeholder="Your name" data-validation="required length" data-validation-length="3-60">
</div>
<div class="form-group">
<div class="input-group">
<textarea class="form-control form-control-sm" id="replyContent" name="replyContent" style="resize: none;" placeholder="What would you like to reply?" data-validation="required length" data-validation-length="3-280"></textarea>
<div class="input-group-append">
<button type="submit" class="btn btn-primary btn-block h-100 btn-sm" id="postReply">Reply <i class="fas fa-chevron-right"></i></button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
{{/each}}
</div>
{{/if}}
</div>
</div>
{{/if}}
{{#if editingEnabled}}
{{#unless eventHasConcluded}}
<script type="text/javascript" src="/js/generate-timezones.js"></script>
{{> editeventmodal }}
{{/unless}}
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteModalLabel">Delete '{{eventData.name}}'</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<form id="editEventForm" action="/deleteevent/{{eventData.id}}/{{eventData.editToken}}" method="post">
<div class="modal-body">
<p>Are you sure you want to delete this event? This action cannot be undone.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-danger">Delete event</button>
</div>
</form>
</div>
</div>
</div>
{{/if}}
<script>
$.validate({
lang: 'en',
errorElementClass: "is-invalid",
errorMessageClass: "text-danger",
successElementClass: "is-valid"
});
{{#if editingEnabled}}
{{#unless eventHasConcluded}}
$('#eventStart').datepicker({
language: 'en',
timepicker: true,
dateFormat: 'd MM yyyy',
dateTimeSeparator: ', ',
onSelect: function(formattedDate, rawDate){
$('#eventEnd').datepicker().data('datepicker').update('minDate', rawDate).clear();
}
});
$('#eventEnd').datepicker({
language: 'en',
timepicker: true,
dateFormat: 'd MM yyyy',
dateTimeSeparator: ', '
});
$("#timezone").val('{{eventData.timezone}}').trigger('change');
console.log('{{eventData.timezone}}')
{{/unless}}
{{/if}}
$(".commentTimestamp").html(function(){
parsedDate = moment($(this).html()).fromNow();
return parsedDate;
});
$(".openReplyBox").click(function(){
// let replyID = $(this).attr("data-id");
$(this).closest(".comment").find(".replyContainer").slideToggle();
})
$(document).ready(function() {
$.uploadPreview({
input_field: "#image-upload",
preview_box: "#image-preview",
label_field: "#image-label",
label_default: "Choose file",
label_selected: "Change file",
no_label: false
});
$("#image-preview").css("background-image", "url('/events/{{eventData.image}}')");
$("#image-preview").css("background-size", "cover");
$("#image-preview").css("background-position", "center center");
{{#if editingEnabled}}
{{#unless eventHasConcluded}}
$('#eventStart').datepicker().data('datepicker').selectDate(moment('{{parsedStart}}', 'YYYYMMDD[T]HHmmss').toDate());
$('#eventEnd').datepicker().data('datepicker').selectDate(moment('{{parsedEnd}}', 'YYYYMMDD[T]HHmmss').toDate());
{{/unless}}
{{/if}}
new ClipboardJS('#copyEventLink');
autosize($('textarea'));
$("#copyEventLink").click(function(){
$(this).html('<i class="fas fa-copy"></i> Copied!');
setTimeout(function(){ $("#copyEventLink").html('<i class="fas fa-copy"></i> Copy');}, 5000);
})
$(".daysToDeletion").html(moment("{{eventEndISO}}").add(7, 'days').fromNow());
});
</script>
|