aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl/cdav_calendar.tpl
blob: 252d45cff0bd6a7b707ecb79412ecb96363470b8 (plain) (blame)
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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
<script>
var calendar;
var new_event = {};
var new_event_id = Math.random().toString(36).substring(7);
var views = {'dayGridMonth' : '{{$month}}', 'timeGridWeek' : '{{$week}}', 'timeGridDay' : '{{$day}}', 'listMonth' : '{{$list_month}}', 'listWeek' : '{{$list_week}}', 'listDay' : '{{$list_day}}'};

var event_id;
var event_uri;
var event_xchan;

var contact_allow = [];
var group_allow = [];
var contact_deny = [];
var group_deny = [];

var resource = {{$resource}};
var default_view = resource !== null ? 'timeGridDay' : 'dayGridMonth';
var default_date = resource !== null ? new Date(resource.dtstart) : new Date();

var allday;

$(document).ready(function() {
	var calendarEl = document.getElementById('calendar');
	calendar = new FullCalendar.Calendar(calendarEl, {
		plugins: [ 'interaction', 'dayGrid', 'timeGrid', 'list' ],
		eventSources: [ {{$sources}} ],
		
		timeZone: '{{$timezone}}',

		locale: '{{$lang}}',

		eventTextColor: 'white',
		header: false,
		
		height: 'auto',
		
		firstDay: {{$first_day}},

		defaultView: default_view,
		defaultDate: default_date,

		weekNumbers: true,
		navLinks: true,

		navLinkDayClick: function(date, jsEvent) {
			calendar.gotoDate( date );
			changeView('timeGridDay');
		},

		navLinkWeekClick: function(date, jsEvent) {
			calendar.gotoDate( date );
			changeView('timeGridWeek');
		},

		monthNames: aStr['monthNames'],
		monthNamesShort: aStr['monthNamesShort'],
		dayNames: aStr['dayNames'],
		dayNamesShort: aStr['dayNamesShort'],
		allDayText: aStr['allday'],

		snapDuration: '00:15:00',
		
		dateClick: function(info) {
			if(new_event.id) {
				var event_poi = calendar.getEventById(new_event.id);
				event_poi.remove();
				new_event = {};
			}

			allday = info.allDay;

			var dtend = new Date(info.date.toUTCString());
			if(allday) {
				dtend.setDate(dtend.getDate() + 1);
			}
			else{
				dtend.setHours(dtend.getHours() + 1);
			}

			event_uri = '';
			$('#id_title').val('New event');
			$('#id_title').attr('disabled', false);
			$('#id_dtstart').attr('disabled', false);
			$('#id_dtend').attr('disabled', false);
			$('#id_description').attr('disabled', false);
			$('#id_location').attr('disabled', false);
			$('#calendar_select').val($("#calendar_select option:first").val()).attr('disabled', false);
			$('#id_dtstart').val(info.date.toUTCString());
			$('#id_dtend').val(dtend ? dtend.toUTCString() : '');
			$('#id_description').val('');
			$('#id_location').val('');
			$('#event_submit').val('create_event').html('{{$create}}');
			$('#event_delete').hide();

			new_event = { id: new_event_id, title: 'New event', start: $('#id_dtstart').val(), end: $('#id_dtend').val(), allDay: info.allDay, editable: true, color: '#bbb' };
			calendar.addEvent(new_event);
		},

		eventClick: function(info) {
			//reset categories
			$('#id_categories').tagsinput('removeAll');

			var event = info.event._def;
			var dtstart = new Date(info.event._instance.range.start);
			var dtend = new Date(info.event._instance.range.end);

			if(event.extendedProps.plink) {
				if(! $('#l2s').length)
					$('#id_title_wrapper').prepend('<span id="l2s" class="float-right"></span>');

				$('#l2s').html('<a href="' + event.extendedProps.plink[0] + '" target="_blank"><i class="fa fa-external-link"></i> ' + event.extendedProps.plink[1] + '</a>');
			}
			else {
				$('#l2s').remove();
			}

			if(event.publicId == new_event_id) {
				$('#calendar_select').trigger('change');
				$('#event_submit').show();
				event_id = 0;
				$(window).scrollTop(0);
				$('.section-content-tools-wrapper, #event_form_wrapper').show();
				$('#recurrence_warning').hide();
				$('#id_title').focus().val('');
				$('#id_title').attr('disabled', false);
				$('#id_dtstart').attr('disabled', false);
				$('#id_dtend').attr('disabled', false);
				$('#id_description').attr('disabled', false);
				$('#id_location').attr('disabled', false);

				return false;
			}

			if(new_event.id && event.extendedProps.rw) {
				var event_poi = calendar.getEventById(new_event.id);
				event_poi.remove();
				new_event = {};
			}
			
			var calendar_id = ((event.extendedProps.calendar_id.constructor === Array) ? event.extendedProps.calendar_id[0] + ':' + event.extendedProps.calendar_id[1] : event.extendedProps.calendar_id);

			if(!event.extendedProps.recurrent) {
				$(window).scrollTop(0);
				$('.section-content-tools-wrapper, #event_form_wrapper').show();
				$('#recurrence_warning').hide();
				event_uri = event.extendedProps.uri;
				$('#id_title').val(event.title);
				$('#calendar_select').val(calendar_id).attr('disabled', true).trigger('change');
				$('#id_timezone_select').val(event.extendedProps.timezone);
				$('#id_location').val(event.extendedProps.location);
				$('#id_categories').tagsinput('add', event.extendedProps.categories);
				$('#id_dtstart').val(dtstart.toUTCString());
				$('#id_dtend').val(dtend.toUTCString());
				$('#id_description').val(event.extendedProps.description);
				$('#id_location').val(event.extendedProps.location);
				$('#event_submit').val('update_event').html('{{$update}}');
				$('#dbtn-acl').addClass('d-none');
				event_id = event.extendedProps.item ? event.extendedProps.item.id : 0;
				event_xchan = event.extendedProps.item ? event.extendedProps.item.event_xchan : '';

				contact_allow = event.extendedProps.contact_allow || [];
				group_allow = event.extendedProps.group_allow || [];
				contact_deny = event.extendedProps.contact_deny || [];
				group_deny = event.extendedProps.group_deny || [];

				if(event.extendedProps.rw) {
					$('#event_delete').show();
					$('#event_submit').show();
					$('#id_title').focus();
					$('#id_title').attr('disabled', false);
					$('#id_dtstart').attr('disabled', false);
					$('#id_dtend').attr('disabled', false);
					$('#id_description').attr('disabled', false);
					$('#id_location').attr('disabled', false);

					if(calendar_id === 'channel_calendar' && !event.ui.startEditable) {
						$('#event_submit').hide();
					}
				}
				else {
					$('#event_submit').hide();
					$('#event_delete').hide();
					$('#id_title').attr('disabled', true);
					$('#id_dtstart').attr('disabled', true);
					$('#id_dtend').attr('disabled', true);
					$('#id_description').attr('disabled', true);
					$('#id_location').attr('disabled', true);
				}
			}
			else if(event.extendedProps.recurrent && event.extendedProps.rw) {
				$('.section-content-tools-wrapper, #recurrence_warning').show();
				$('#event_form_wrapper').hide();
				event_uri = event.extendedProps.uri;
				$('#calendar_select').val(calendar_id).attr('disabled', true).trigger('change');
			}
		},
		
		eventResize: function(info) {

			var event = info.event._def;
			var dtstart = new Date(info.event._instance.range.start);
			var dtend = new Date(info.event._instance.range.end);

			$('#id_title').val(event.title);
			$('#id_dtstart').val(dtstart.toUTCString());
			$('#id_dtend').val(dtend.toUTCString());

			event_id = event.extendedProps.item ? event.extendedProps.item.id : 0;
			event_xchan = event.extendedProps.item ? event.extendedProps.item.event_xchan : '';

			if(event.extendedProps.calendar_id === 'channel_calendar') {
				$.post( 'channel_calendar', {
					'event_id': event_id,
					'event_hash': event_uri,
					'xchan': event_xchan,
					'type': 'event',
					'preview': 0,
					'summary': event.title,
					'timezone_select': event.extendedProps.timezone,
					'dtstart': dtstart.toUTCString(),
					'dtend': dtend.toUTCString(),
					'adjust': event.allDay ? 0 : 1,
					'categories': event.extendedProps.categories,
					'desc': event.extendedProps.description,
					'location': event.extendedProps.location,
				})
				.fail(function() {
					info.revert();
				});
			}
			else {
				$.post( 'cdav/calendar', {
					'update': 'resize',
					'id[]': event.extendedProps.calendar_id,
					'uri': event.extendedProps.uri,
					'timezone_select': event.extendedProps.timezone,
					'dtstart': dtstart ? dtstart.toUTCString() : '',
					'dtend': dtend ? dtend.toUTCString() : '',
					'allday': event.allDay ? 1 : 0
				})
				.fail(function() {
					info.revert();
				});
			}
		},
		
		eventDrop: function(info) {

			var event = info.event._def;
			var dtstart = new Date(info.event._instance.range.start);
			var dtend = new Date(info.event._instance.range.end);
			
			$('#id_title').val(event.title);
			$('#id_dtstart').val(dtstart.toUTCString());
			$('#id_dtend').val(dtend.toUTCString());

			event_id = event.extendedProps.item ? event.extendedProps.item.id : 0;
			event_xchan = event.extendedProps.item ? event.extendedProps.item.event_xchan : '';

			if(event.extendedProps.calendar_id === 'channel_calendar') {
				$.post( 'channel_calendar', {
					'event_id': event_id,
					'event_hash': event_uri,
					'xchan': event_xchan,
					'type': 'event',
					'preview': 0,
					'summary': event.title,
					'timezone_select': event.extendedProps.timezone,
					'dtstart': dtstart.toUTCString(),
					'dtend': dtend.toUTCString(),
					'adjust': event.allDay ? 0 : 1,
					'categories': event.extendedProps.categories,
					'desc': event.extendedProps.description,
					'location': event.extendedProps.location,
				})
				.fail(function() {
					info.revert();
				});
			}
			else {
				$.post( 'cdav/calendar', {
					'update': 'drop',
					'id[]': event.extendedProps.calendar_id,
					'uri': event.extendedProps.uri,
					'timezone_select': event.extendedProps.timezone,
					'dtstart': dtstart ? dtstart.toUTCString() : '',
					'dtend': dtend ? dtend.toUTCString() : '',
					'allday': event.allDay ? 1 : 0
				})
				.fail(function() {
					info.revert();
				});
			}
		},

		loading: function(isLoading, view) {
			$('#events-spinner').show();
			$('#today-btn > i').hide();
			if(!isLoading) {
				$('#events-spinner').hide();
				$('#today-btn > i').show();
			}
		}
		
	});
	
	calendar.render();

	$('#title').text(calendar.view.title);
	$('#view_selector').html(views[calendar.view.type]);
	
	$('#today-btn').on('click', function() {
		calendar.today();
		$('#title').text(calendar.view.title);
	});
	
	$('#prev-btn').on('click', function() {
 		 calendar.prev();
 		 $('#title').text(calendar.view.title);
	});
	
	$('#next-btn').on('click', function() {
 		 calendar.next();
 		 $('#title').text(calendar.view.title);
	});

	$('#calendar_select').on('change', function() {
		if(this.value === 'channel_calendar')
			$('#dbtn-acl, #id_categories_wrapper').removeClass('d-none');
		else
			$('#dbtn-acl, #id_categories_wrapper').addClass('d-none');
	});
	
	$('.color-edit').colorpicker({ input: '.color-edit-input' });

	$(document).on('click','#fullscreen-btn', updateSize);
	$(document).on('click','#inline-btn', updateSize);
	$(document).on('click','#event_submit', on_submit);
	$(document).on('click','#event_more', on_more);
	$(document).on('click','#event_cancel, #event_cancel_recurrent', reset_form);
	$(document).on('click','#event_delete, #event_delete_recurrent', on_delete);

	if(resource !== null) {
		$('.section-content-tools-wrapper, #event_form_wrapper').show();

		$('#id_title_wrapper').prepend('<span id="l2s" class="float-right"></span>');
		$('#l2s').html('<a href="' + resource.plink[0] + '" target="_blank"><i class="fa fa-external-link"></i> ' + resource.plink[1] + '</a>');

		event_id = resource.id;
		event_uri = resource.event_hash;
		event_xchan = resource.event_xchan;

		$('#calendar_select').val('channel_calendar').attr('disabled', true);
		$('#id_title').val(resource.summary);
		$('#id_dtstart').val(new Date(resource.dtstart).toUTCString());
		$('#id_dtend').val(new Date(resource.dtend).toUTCString());
		$('#id_categories').tagsinput('add', '{{$categories}}'),
		$('#id_description').val(resource.description);
		$('#id_location').val(resource.location);
		$('#id_timezone_select').val(resource.timezone);

		if(event_xchan !== '{{$channel_hash}}')
			$('#event_submit').hide();
		else
			$('#event_submit').html('{{$update}}');
	}

	if(default_view === 'dayGridMonth');
		$('#id_dtstart_wrapper, #id_dtend_wrapper').hide();
});


function changeView(viewName) {
	calendar.changeView(viewName);
	$('#title').text(calendar.view.title);
	$('#view_selector').html(views[calendar.view.type]);

	if(viewName === 'dayGridMonth') {
		$('#id_dtstart_wrapper, #id_dtend_wrapper').hide();
	}
	else {
		$('#id_dtstart_wrapper, #id_dtend_wrapper').show();
	}

	return;
}

function add_remove_json_source(source, color, editable, status) {
	var id, parts = [];

	if(source == '/channel_calendar/json')
		id = 'channel_calendar'

	if(! id) {
		parts = source.split('/');
		id = parts[4];
	}

	var eventSource = calendar.getEventSourceById(id);
	var selector = '#calendar-btn-' + id;

	if(status === undefined)
		status = 'fa-calendar-check-o';

	if(status === 'drop') {
		eventSource.remove();
		reset_form();
		return;
	}

	if($(selector).hasClass('fa-calendar-o')) {
		calendar.addEventSource({ id: id, url: source, color: color, editable: editable });
		$(selector).removeClass('fa-calendar-o');
		$(selector).addClass(status);
		$.get('/cdav/calendar/switch/' + id + '/1');
	}
	else {
		eventSource.remove();
		$(selector).removeClass(status);
		$(selector).addClass('fa-calendar-o');
		$.get('/cdav/calendar/switch/' + id + '/0');
	}
}

function updateSize() {
	calendar.updateSize();
}

function on_submit() {
	if($('#calendar_select').val() === 'channel_calendar') {
		if(new_event_id) {
			$("input[name='contact_allow[]']").each(function() {
			    contact_allow.push($(this).val());
			});
			$("input[name='group_allow[]']").each(function() {
			    group_allow.push($(this).val());
			});
			$("input[name='contact_deny[]']").each(function() {
			    contact_deny.push($(this).val());
			});
			$("input[name='group_deny[]']").each(function() {
			    group_deny.push($(this).val());
			});
		}

		$.post( 'channel_calendar', {
			'event_id': event_id,
			'event_hash': event_uri,
			'xchan': event_xchan,
			'type': 'event',
			'preview': 0,
			'timezone_select': $('#id_timezone_select').val(),
			'summary': $('#id_title').val(),
			'dtstart': $('#id_dtstart').val(),
			'dtend': $('#id_dtend').val(),
			'adjust': allday ? 0 : 1,
			'categories': $('#id_categories').val(),
			'desc': $('#id_description').val(),
			'location': $('#id_location').val(),
			'contact_allow[]': contact_allow,
			'group_allow[]': group_allow,
			'contact_deny[]': contact_deny,
			'group_deny[]': group_deny

		})
		.done(function() {
			var eventSource = calendar.getEventSourceById('channel_calendar');
			eventSource.refetch();
			reset_form();

		});

	}
	else {
		$.post( 'cdav/calendar', {
			'submit': $('#event_submit').val(),
			'target': $('#calendar_select').val(),
			'timezone_select': $('#id_timezone_select').val(),
			'uri': event_uri,
			'title': $('#id_title').val(),
			'dtstart': $('#id_dtstart').val(),
			'dtend': $('#id_dtend').val(),
			'description': $('#id_description').val(),
			'location': $('#id_location').val(),
			'allday': allday ? 1 : 0
		})
		.done(function() {
			var parts = $('#calendar_select').val().split(':');
			var eventSource = calendar.getEventSourceById(parts[0]);
			eventSource.refetch();
			reset_form();

		});
	}
}

function on_delete() {
	if($('#calendar_select').val() === 'channel_calendar') {
		$.get('channel_calendar/drop/' + event_uri, function() {
			var eventSource = calendar.getEventSourceById('channel_calendar');
			eventSource.refetch();
			reset_form();
		});
	}
	else {
		$.post( 'cdav/calendar', {
			'delete': 'delete',
			'target': $('#calendar_select').val(),
			'uri': event_uri
		})
		.done(function() {
			var parts = $('#calendar_select').val().split(':');
			var eventSource = calendar.getEventSourceById(parts[0]);
			eventSource.refetch();
			reset_form();
		});
	}
}

function reset_form() {
	$('.section-content-tools-wrapper, #event_form_wrapper, #recurrence_warning').hide();

	$('#event_submit').val('');
	$('#calendar_select').val('');
	event_uri = '';
	$('#id_title').val('');
	$('#id_categories').tagsinput('removeAll');
	$('#id_dtstart').val('');
	$('#id_dtend').val('');

	if(new_event.id) {
		var event_poi = calendar.getEventById(new_event.id);
		event_poi.remove();
		new_event = {};
	}
	
	if($('#more_block').hasClass('open'))
		on_more();
}

function on_more() {
	if($('#more_block').hasClass('open')) {
		$('#event_more').html('<i class="fa fa-caret-down"></i> {{$more}}');
		$('#more_block').removeClass('open').hide();
	}
	else {
		$('#event_more').html('<i class="fa fa-caret-up"></i> {{$less}}');
		$('#more_block').addClass('open').show();
	}
}

function exportDate() {
	window.location.href= 'channel_calendar/export';
}

</script>

<div class="generic-content-wrapper">
	<div class="section-title-wrapper">
		<div class="float-right">
			<div class="dropdown">
				<button id="view_selector" type="button" class="btn btn-outline-secondary btn-sm dropdown-toggle" data-toggle="dropdown"></button>
				<div class="dropdown-menu">
					<a class="dropdown-item" href="#" onclick="changeView('dayGridMonth'); return false;">{{$month}}</a></li>
					<a class="dropdown-item" href="#" onclick="changeView('timeGridWeek'); return false;">{{$week}}</a></li>
					<a class="dropdown-item" href="#" onclick="changeView('timeGridDay'); return false;">{{$day}}</a></li>
					<div class="dropdown-divider"></div>
					<a class="dropdown-item" href="#" onclick="changeView('listMonth'); return false;">{{$list_month}}</a></li>
					<a class="dropdown-item" href="#" onclick="changeView('listWeek'); return false;">{{$list_week}}</a></li>
					<a class="dropdown-item" href="#" onclick="changeView('listDay'); return false;">{{$list_day}}</a></li>
				</div>
				<div class="btn-group">
					<button id="prev-btn" class="btn btn-outline-secondary btn-sm" title="{{$prev}}"><i class="fa fa-backward"></i></button>
					<button id="today-btn" class="btn btn-outline-secondary btn-sm" title="{{$today}}"><div id="events-spinner" class="spinner s"></div><i class="fa fa-bullseye" style="display: none; width: 1rem;"></i></button>
					<button id="next-btn" class="btn btn-outline-secondary btn-sm" title="{{$next}}"><i class="fa fa-forward"></i></button>
				</div>
				<button id="fullscreen-btn" type="button" class="btn btn-outline-secondary btn-sm" onclick="makeFullScreen();"><i class="fa fa-expand"></i></button>
				<button id="inline-btn" type="button" class="btn btn-outline-secondary btn-sm" onclick="makeFullScreen(false);"><i class="fa fa-compress"></i></button>
			</div>
		</div>
		<h2 id="title"></h2>
		<div class="clear"></div>
	</div>
	<div class="section-content-tools-wrapper" style="display: none">
		<div id="recurrence_warning" style="display: none">
			<div class="section-content-warning-wrapper">
				{{$recurrence_warning}}
			</div>
			<div>
				<button id="event_delete_recurrent" type="button" class="btn btn-danger btn-sm">{{$delete_all}}</button>
				<button id="event_cancel_recurrent" type="button" class="btn btn-outline-secondary btn-sm">{{$cancel}}</button>
			</div>
		</div>
		<div id="event_form_wrapper" style="display: none">
			<form id="event_form" method="post" action="" class="acl-form" data-form_id="event_form" data-allow_cid='{{$allow_cid}}' data-allow_gid='{{$allow_gid}}' data-deny_cid='{{$deny_cid}}' data-deny_gid='{{$deny_gid}}'>
				{{include file="field_input.tpl" field=$title}}
				<label for="calendar_select">{{$calendar_select_label}}</label>
				<select id="calendar_select" name="target" class="form-control form-group">
					<optgroup label="{{$calendar_optiopns_label.0}}">
					{{foreach $channel_calendars as $channel_calendar}}
					<option value="channel_calendar">{{$channel_calendar.displayname}}</option>
					{{/foreach}}
					</optgroup>
					<optgroup label="{{$calendar_optiopns_label.1}}">
					{{foreach $writable_calendars as $writable_calendar}}
					<option value="{{$writable_calendar.id.0}}:{{$writable_calendar.id.1}}">{{$writable_calendar.displayname}}{{if $writable_calendar.sharer}} ({{$writable_calendar.sharer}}){{/if}}</option>
					{{/foreach}}
					</optgroup>
				</select>
				{{if $timezone_select}}
				{{include file="field_select_grouped.tpl" field=$timezone_select}}
				{{/if}}
				<div id="more_block" style="display: none;">
					{{if $catsenabled}}
					<div id="id_categories_wrapper" class="form-group">
						<label id="label_categories" for="id_categories">{{$categories_label}}</label>
						<input name="categories" id="id_categories" class="form-control" type="text" value="{{$categories}}" data-role="cat-tagsinput" />
					</div>
					{{/if}}
					{{include file="field_input.tpl" field=$dtstart}}
					{{include file="field_input.tpl" field=$dtend}}
					{{include file="field_textarea.tpl" field=$description}}
					{{include file="field_textarea.tpl" field=$location}}
				</div>
				<div class="form-group">
					<div class="pull-right">
						<button id="event_more" type="button" class="btn btn-outline-secondary btn-sm"><i class="fa fa-caret-down"></i> {{$more}}</button>
						<button id="dbtn-acl" class="btn btn-outline-secondary btn-sm d-none" type="button" data-toggle="modal" data-target="#aclModal"><i id="jot-perms-icon" class="fa fa-{{$lockstate}}"></i></button>
						<button id="event_submit" type="button" value="" class="btn btn-primary btn-sm"></button>

					</div>
					<div>
						<button id="event_delete" type="button" class="btn btn-danger btn-sm">{{$delete}}</button>
						<button id="event_cancel" type="button" class="btn btn-outline-secondary btn-sm">{{$cancel}}</button>
					</div>
					<div class="clear"></div>
				</div>
			</form>
			{{$acl}}
		</div>
	</div>
	<div class="section-content-wrapper-np">
		<div id="calendar"></div>
	</div>
</div>