From af415693b64e0220e3c5f111398a7bad7212576b Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 4 Feb 2017 12:38:08 -0600 Subject: [PATCH] Add config flag for disabling option to "Clear Schedule" I.e. when editing the schedule --- tailbone/templates/shifts/schedule_edit.mako | 6 ++++++ tailbone/views/shifts/schedule.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/tailbone/templates/shifts/schedule_edit.mako b/tailbone/templates/shifts/schedule_edit.mako index 6bff3d11..04cf7af4 100644 --- a/tailbone/templates/shifts/schedule_edit.mako +++ b/tailbone/templates/shifts/schedule_edit.mako @@ -8,6 +8,7 @@ $(function() { + % if allow_clear: $('.clear-schedule').click(function() { if (confirm("This will remove all shifts from the schedule you're " + "currently viewing.\n\nAre you sure you wish to do this?")) { @@ -16,6 +17,7 @@ $('#clear-schedule-form').submit(); } }); + % endif $('#copy-week').datepicker({ dateFormat: 'mm/dd/yy' @@ -88,7 +90,9 @@
+ % if allow_clear: + % endif
@@ -98,10 +102,12 @@ ${self.timesheet_wrapper(with_edit_form=True)} ${edit_tools()} +% if allow_clear: ${h.form(url('schedule.edit'), id="clear-schedule-form")} ${h.csrf_token(request)} ${h.hidden('clear-schedule', value='clear')} ${h.end_form()} +% endif