Fix bug in base 'shifts' template if weekdays not in context

This commit is contained in:
Lance Edgar 2017-02-10 14:40:19 -06:00
parent afe822dd6c
commit e6bd9e18d0

View file

@ -11,11 +11,13 @@
var data_modified = false; var data_modified = false;
var okay_to_leave = true; var okay_to_leave = true;
var previous_selections = {}; var previous_selections = {};
% if weekdays is not Undefined:
var weekdays = [ var weekdays = [
% for i, day in enumerate(weekdays, 1): % for i, day in enumerate(weekdays, 1):
'${day.strftime('%a %d %b %Y')}'${',' if i < len(weekdays) else ''} '${day.strftime('%a %d %b %Y')}'${',' if i < len(weekdays) else ''}
% endfor % endfor
]; ];
% endif
window.onbeforeunload = function() { window.onbeforeunload = function() {
if (! okay_to_leave) { if (! okay_to_leave) {