From c32479489db670904579a580a918f3513581fda9 Mon Sep 17 00:00:00 2001 From: Sawyer Bergeron Date: Fri, 5 Jan 2018 16:07:13 -0500 Subject: Implement Booking Modification Interface Jira: PHAROS-330 Users can change start date if it has not already occurred, and can change end date, purpose, and both installer and scenario. Standard checks apply similar to when initially creating a booking. Change-Id: Ibae7fe91a58bd6e0741db065265c05c3823bdc27 Signed-off-by: Sawyer Bergeron --- dashboard/src/static/js/booking-calendar.js | 15 +++++++++++++++ dashboard/src/static/js/fullcalendar-options.js | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'dashboard/src/static/js') diff --git a/dashboard/src/static/js/booking-calendar.js b/dashboard/src/static/js/booking-calendar.js index f634293..303a6b2 100644 --- a/dashboard/src/static/js/booking-calendar.js +++ b/dashboard/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/dashboard/src/static/js/fullcalendar-options.js b/dashboard/src/static/js/fullcalendar-options.js index 22a1b95..a29103a 100644 --- a/dashboard/src/static/js/fullcalendar-options.js +++ b/dashboard/src/static/js/fullcalendar-options.js @@ -98,4 +98,4 @@ var calendarOptions = { eventResize: function (event) { sendEventToForm(event); } -}; \ No newline at end of file +}; -- cgit 1.2.3-korg