aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl/cdav_calendar.tpl
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2019-04-30 00:09:57 +0200
committerMario Vavti <mario@mariovavti.com>2019-04-30 00:09:57 +0200
commit327e5d06e12b3ddad0a83a223c1673a4d0dafb15 (patch)
treed5ae844d7f1498e1552df4cd4ffd4df00b30815b /view/tpl/cdav_calendar.tpl
parent674215e9e6632ac22a1b87f9996f0323f5949d94 (diff)
downloadvolse-hubzilla-327e5d06e12b3ddad0a83a223c1673a4d0dafb15.tar.gz
volse-hubzilla-327e5d06e12b3ddad0a83a223c1673a4d0dafb15.tar.bz2
volse-hubzilla-327e5d06e12b3ddad0a83a223c1673a4d0dafb15.zip
calendar merge: implement single event editing UI
Diffstat (limited to 'view/tpl/cdav_calendar.tpl')
-rw-r--r--view/tpl/cdav_calendar.tpl30
1 files changed, 26 insertions, 4 deletions
diff --git a/view/tpl/cdav_calendar.tpl b/view/tpl/cdav_calendar.tpl
index dd0f3ff7b..a86b61d3b 100644
--- a/view/tpl/cdav_calendar.tpl
+++ b/view/tpl/cdav_calendar.tpl
@@ -12,6 +12,10 @@ 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();
+
$(document).ready(function() {
var calendarEl = document.getElementById('calendar');
calendar = new FullCalendar.Calendar(calendarEl, {
@@ -29,6 +33,9 @@ $(document).ready(function() {
firstDay: {{$first_day}},
+ defaultView: default_view,
+ defaultDate: default_date,
+
monthNames: aStr['monthNames'],
monthNamesShort: aStr['monthNamesShort'],
dayNames: aStr['dayNames'],
@@ -69,8 +76,6 @@ $(document).ready(function() {
eventClick: function(info) {
-
-
//reset categories
$('#id_categories').tagsinput('removeAll');
@@ -254,7 +259,7 @@ $(document).ready(function() {
});
}
},
-
+
loading: function(isLoading, view) {
$('#events-spinner').show();
$('#today-btn > i').hide();
@@ -267,7 +272,7 @@ $(document).ready(function() {
});
calendar.render();
-
+
$('#title').text(calendar.view.title);
$('#view_selector').html(views[calendar.view.type]);
@@ -301,6 +306,23 @@ $(document).ready(function() {
$(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) {
+
+console.log('{{$categories}}');
+console.log(resource);
+ $('.section-content-tools-wrapper, #event_form_wrapper').show();
+ event_id = resource.id;
+ event_uri = resource.event_hash;
+ $('#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);
+ $('#event_submit').html('{{$update}}');
+ }
});