Add config flag for disabling option to "Clear Schedule"
I.e. when editing the schedule
This commit is contained in:
parent
273f56ec83
commit
af415693b6
|
@ -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 @@
|
|||
<div class="buttons">
|
||||
<button type="button" class="save-changes" disabled="disabled">Save Changes</button>
|
||||
<button type="button" class="undo-changes" disabled="disabled">Undo Changes</button>
|
||||
% if allow_clear:
|
||||
<button type="button" class="clear-schedule">Clear Schedule</button>
|
||||
% endif
|
||||
<button type="button" class="copy-schedule">Copy Schedule From...</button>
|
||||
</div>
|
||||
</%def>
|
||||
|
@ -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
|
||||
|
||||
<div id="day-editor" style="display: none;">
|
||||
<div class="shifts"></div>
|
||||
|
|
|
@ -121,6 +121,8 @@ class ScheduleView(TimeSheetView):
|
|||
|
||||
context['form'] = form
|
||||
context['page_title'] = "Edit Schedule"
|
||||
context['allow_clear'] = self.rattail_config.getbool('tailbone', 'schedule.allow_clear',
|
||||
default=True)
|
||||
return self.render_full(**context)
|
||||
|
||||
def clear_schedule(self):
|
||||
|
|
Loading…
Reference in a new issue