diff options
Diffstat (limited to 'src/static')
-rw-r--r-- | src/static/js/booking-calendar.js | 15 | ||||
-rw-r--r-- | src/static/js/fullcalendar-options.js | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/static/js/booking-calendar.js b/src/static/js/booking-calendar.js index f634293..303a6b2 100644 --- a/src/static/js/booking-calendar.js +++ b/src/static/js/booking-calendar.js @@ -51,8 +51,23 @@ function loadEvents(url) { } $(document).ready(function () { + createEditViewSwitch(); $('#calendar').fullCalendar(calendarOptions); loadEvents(bookings_url); $('#starttimepicker').datetimepicker(timepickerOptions); $('#endtimepicker').datetimepicker(timepickerOptions); + $('#starttimeeditpicker').datetimepicker(timepickerOptions); + $('#endtimeeditpicker').datetimepicker(timepickerOptions); }); + +function createEditViewSwitch() { + var url = window.location.href; + var isEdit = url.substr(url.lastIndexOf('/')); + + if ( url.indexOf('edit') !== -1 ) { + document.getElementById('booking_form_div').style.display = 'none'; + calendarOptions.selectable = false; + } else { + document.getElementById('booking_edit_form_div').style.display = 'none'; + } +} diff --git a/src/static/js/fullcalendar-options.js b/src/static/js/fullcalendar-options.js index 22a1b95..a29103a 100644 --- a/src/static/js/fullcalendar-options.js +++ b/src/static/js/fullcalendar-options.js @@ -98,4 +98,4 @@ var calendarOptions = { eventResize: function (event) { sendEventToForm(event); } -};
\ No newline at end of file +}; |