diff --git a/src/Utils/Schedule/Week.hs b/src/Utils/Schedule/Week.hs index e2717c485..54ec77852 100644 --- a/src/Utils/Schedule/Week.hs +++ b/src/Utils/Schedule/Week.hs @@ -266,3 +266,6 @@ dayOfWeekToDayWith weekDay = go where | weekDay' > weekDay = go $ pred d | otherwise = go $ succ d where weekDay' = dayOfWeek d + +indexedList :: [a] -> [(Int, a)] +indexedList = zip [0..] diff --git a/templates/schedule/week.hamlet b/templates/schedule/week.hamlet index 2c54a8177..f5fd56ee6 100644 --- a/templates/schedule/week.hamlet +++ b/templates/schedule/week.hamlet @@ -50,7 +50,7 @@ $newline never
^{formatEitherOccurrenceW stOccurrence} $of ScheduleExamOccurrence{seoCourse=Entity _ Course{courseName},seoExamName,seoRooms,seoStart,seoEnd} - #{CI.original courseName}: #{seoExamName} + #{CI.original courseName}: #{seoExamName} # $if slotAssocIsCont slotAssociation (_{MsgScheduleWeekSlotIsCont})
@@ -63,10 +63,12 @@ $newline never
$of more _{MsgScheduleRooms}: # - $forall (mRoom,showRoom) <- more + $forall (idx,(mRoom,showRoom)) <- indexedList more $if showRoom $maybe room <- mRoom ^{roomReferenceWidget room} + $if idx < pred (length more) + ; #
_{MsgScheduleOccur}: # $if Just (utctDay seoStart) == fmap utctDay seoEnd