feat(schedule): enhance display of days
This commit is contained in:
parent
38fc5fa986
commit
6ac1dc57d0
@ -137,6 +137,7 @@ weekSchedule uid _weekOffset = do
|
||||
|
||||
-- TODO: Internationalize week start (and/or make configurable)
|
||||
-- TODO: auto-hide saturday and sunday (if there are no events scheduled)?
|
||||
-- TODO: weekday messages deprecated / not used => remove
|
||||
weekDays :: [(Day, UniWorXMessage, Text)]
|
||||
weekDays = zipWith (\x (y,z) -> (x,y,z)) currentWeek
|
||||
[ (MsgScheduleWeekDayMonday , "mon")
|
||||
@ -151,8 +152,8 @@ weekSchedule uid _weekOffset = do
|
||||
formatOccurrenceW :: ScheduleEntryOccurrence -> Widget
|
||||
formatOccurrenceW = \case
|
||||
Right ScheduleWeekly{..} -> [whamlet| _{MsgScheduleTime}: |] <> formatTimeRangeW SelFormatTime scheduleStart (Just scheduleEnd)
|
||||
Left ExceptOccur{..} -> [whamlet| _{MsgScheduleOccur}: |] <> formatTimeRangeW SelFormatDateTime (LocalTime exceptDay exceptStart) (Just (LocalTime exceptDay exceptEnd))
|
||||
Left ExceptNoOccur{exceptTime} -> [whamlet| _{MsgScheduleNoOccur}: |] <> formatTimeW SelFormatDateTime exceptTime
|
||||
Left ExceptOccur{..} -> [whamlet| _{MsgScheduleOccur}: |] <> formatTimeRangeW SelFormatTime (LocalTime exceptDay exceptStart) (Just (LocalTime exceptDay exceptEnd))
|
||||
Left ExceptNoOccur{} -> [whamlet| _{MsgScheduleNoOccur} |] -- <> formatTimeW SelFormatDateTime exceptTime
|
||||
|
||||
$(widgetFile "widgets/schedule/week")
|
||||
|
||||
|
||||
@ -5,9 +5,9 @@ $newline never
|
||||
<tr .table__row .table__row--head>
|
||||
<th .table__th uw-hide-column-header="time">
|
||||
_{MsgScheduleTableHeadTime}
|
||||
$forall (_, weekDayTitle, weekDayIdent) <- weekDays
|
||||
$forall (day, _, weekDayIdent) <- weekDays
|
||||
<th .table__th uw-hide-column-header=#{weekDayIdent}>
|
||||
_{weekDayTitle}
|
||||
^{formatTimeW SelFormatDate day}
|
||||
<tbody>
|
||||
$forall slot <- slotsToDisplay
|
||||
<tr .table__row>
|
||||
|
||||
Reference in New Issue
Block a user