diff options
author | Sawyer Bergeron <sbergeron@iol.unh.edu> | 2018-01-05 16:07:13 -0500 |
---|---|---|
committer | Sawyer Bergeron <sbergeron@iol.unh.edu> | 2018-01-09 15:03:34 -0500 |
commit | a1df798486c60c911dfb2e6c2c487f7bcb7f6d01 (patch) | |
tree | 60bec95b5de53c332ab1101240095940e5a4554b /src/static | |
parent | c81da17a046f1ad81f05de8a242b14ec02cf7c9a (diff) |
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 <sbergeron@iol.unh.edu>
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 +}; |