aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl/cdav_calendar.tpl
diff options
context:
space:
mode:
Diffstat (limited to 'view/tpl/cdav_calendar.tpl')
-rw-r--r--view/tpl/cdav_calendar.tpl64
1 files changed, 36 insertions, 28 deletions
diff --git a/view/tpl/cdav_calendar.tpl b/view/tpl/cdav_calendar.tpl
index 28cd11b2e..2d6853513 100644
--- a/view/tpl/cdav_calendar.tpl
+++ b/view/tpl/cdav_calendar.tpl
@@ -24,16 +24,16 @@ $(document).ready(function() {
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,
@@ -59,7 +59,7 @@ $(document).ready(function() {
allDayText: aStr['allday'],
snapDuration: '00:05:00',
-
+
dateClick: function(info) {
if(new_event.id) {
var event_poi = calendar.getEventById(new_event.id);
@@ -114,7 +114,7 @@ $(document).ready(function() {
if(event.extendedProps.plink) {
if(! $('#l2s').length)
- $('#id_title_wrapper').prepend('<span id="l2s" class="float-right"></span>');
+ $('#id_title_wrapper').prepend('<span id="l2s" class="float-end"></span>');
$('#l2s').html('<a href="' + event.extendedProps.plink[0] + '" target="_blank"><i class="fa fa-external-link"></i> ' + event.extendedProps.plink[1] + '</a>');
}
@@ -151,7 +151,7 @@ $(document).ready(function() {
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) {
@@ -209,7 +209,7 @@ $(document).ready(function() {
$('#calendar_select').val(calendar_id).attr('disabled', true).trigger('change');
}
},
-
+
eventResize: function(info) {
var event = info.event._def;
@@ -258,13 +258,13 @@ $(document).ready(function() {
});
}
},
-
+
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().slice(0, -4));
$('#id_dtend').val(dtend.toUTCString().slice(0, -4));
@@ -316,24 +316,24 @@ $(document).ready(function() {
$('#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);
@@ -345,7 +345,7 @@ $(document).ready(function() {
else
$('#dbtn-acl, #id_categories_wrapper').addClass('d-none');
});
-
+
$('.color-edit').colorpicker({ input: '.color-edit-input' });
$(document).on('click','#fullscreen-btn', updateSize);
@@ -358,7 +358,7 @@ $(document).ready(function() {
if(resource !== null) {
$('.section-content-tools-wrapper, #event_form_wrapper').show();
- $('#id_title_wrapper').prepend('<span id="l2s" class="float-right"></span>');
+ $('#id_title_wrapper').prepend('<span id="l2s" class="float-end"></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;
@@ -481,9 +481,13 @@ function on_submit() {
})
.done(function() {
var eventSource = calendar.getEventSourceById('channel_calendar');
- eventSource.refetch();
+ if (eventSource) {
+ eventSource.refetch();
+ }
+ else {
+ $.jGrowl('{{$disabled_warning}}', { sticky: false, theme: 'notice', life: 10000 });
+ }
reset_form();
-
});
}
@@ -503,9 +507,13 @@ function on_submit() {
.done(function() {
var parts = $('#calendar_select').val().split(':');
var eventSource = calendar.getEventSourceById(parts[0]);
- eventSource.refetch();
+ if (eventSource) {
+ eventSource.refetch();
+ }
+ else {
+ $.jGrowl('{{$disabled_warning}}', { sticky: false, theme: 'notice', life: 10000 });
+ }
reset_form();
-
});
}
}
@@ -549,7 +557,7 @@ function reset_form() {
event_poi.remove();
new_event = {};
}
-
+
if($('#more_block').hasClass('open'))
on_more();
}
@@ -573,9 +581,9 @@ function exportDate() {
<div class="generic-content-wrapper">
<div class="section-title-wrapper">
- <div class="float-right">
+ <div class="float-end">
<div class="dropdown">
- <button id="view_selector" type="button" class="btn btn-outline-secondary btn-sm dropdown-toggle" data-toggle="dropdown"></button>
+ <button id="view_selector" type="button" class="btn btn-outline-secondary btn-sm dropdown-toggle" data-bs-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>
@@ -611,7 +619,7 @@ function exportDate() {
<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">
+ <select id="calendar_select" name="target" class="form-control mb-3">
<optgroup label="{{$calendar_optiopns_label.0}}">
{{foreach $channel_calendars as $channel_calendar}}
<option value="channel_calendar">{{$channel_calendar.displayname}}</option>
@@ -628,7 +636,7 @@ function exportDate() {
{{/if}}
<div id="more_block" style="display: none;">
{{if $catsenabled}}
- <div id="id_categories_wrapper" class="form-group">
+ <div id="id_categories_wrapper" class="mb-3">
<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>
@@ -638,10 +646,10 @@ function exportDate() {
{{include file="field_textarea.tpl" field=$description}}
{{include file="field_textarea.tpl" field=$location}}
</div>
- <div class="form-group">
- <div class="pull-right">
+ <div class="mb-3">
+ <div class="float-end">
<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="dbtn-acl" class="btn btn-outline-secondary btn-sm d-none" type="button" data-bs-toggle="modal" data-bs-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>