diff --git a/tailbone/views/shifts.py b/tailbone/views/shifts.py index 3845b2ff..9a1fd75f 100644 --- a/tailbone/views/shifts.py +++ b/tailbone/views/shifts.py @@ -51,6 +51,35 @@ class ShiftLengthField(formalchemy.Field): return humanize.naturaldelta(shift.punch_out - shift.punch_in) +class ScheduledShiftsView(MasterView): + """ + Master view for employee scheduled shifts. + """ + model_class = model.ScheduledShift + url_prefix = '/shifts/scheduled' + + def configure_grid(self, g): + g.default_sortkey = 'start_time' + g.default_sortdir = 'desc' + g.configure( + include=[ + g.employee, + g.store, + g.start_time, + g.end_time, + ], + readonly=True) + + def configure_fieldset(self, fs): + fs.configure( + include=[ + fs.employee, + fs.store, + fs.start_time, + fs.end_time, + ]) + + class WorkedShiftsView(MasterView): """ Master view for employee worked shifts. @@ -85,4 +114,5 @@ class WorkedShiftsView(MasterView): def includeme(config): + ScheduledShiftsView.defaults(config) WorkedShiftsView.defaults(config)