From 6245079465d18e7820742ef430a4bc345ab5591b Mon Sep 17 00:00:00 2001 From: Sarah Vaupel <> Date: Thu, 20 Aug 2020 18:15:54 +0200 Subject: [PATCH] feat(schedule): display tutorial name --- src/Utils/Schedule.hs | 4 ++-- src/Utils/Schedule/Types.hs | 6 ++++-- templates/widgets/schedule/week.hamlet | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Utils/Schedule.hs b/src/Utils/Schedule.hs index 86a6c2f32..d4e836378 100644 --- a/src/Utils/Schedule.hs +++ b/src/Utils/Schedule.hs @@ -84,8 +84,8 @@ weekSchedule uid _weekOffset = do in scheduleds <> exceptions tutorialToScheduleEntries :: (Entity Course, Entity Tutorial) -> [ScheduleEntry] - tutorialToScheduleEntries (seCourse@(Entity _ Course{..}), Entity _ Tutorial{tutorialType,tutorialRoom,tutorialTime=Occurrences{..}}) = - let seType = SETTutorial { settType = tutorialType } + tutorialToScheduleEntries (seCourse@(Entity _ Course{..}), Entity _ Tutorial{tutorialType,tutorialName,tutorialRoom,tutorialTime=Occurrences{..}}) = + let seType = SETTutorial { settType = tutorialType, settName = tutorialName } seRoom = tutorialRoom scheduleds -- omit regular occurrences if the course's term is not currently active diff --git a/src/Utils/Schedule/Types.hs b/src/Utils/Schedule/Types.hs index 4fb6d44a5..49b4d069f 100644 --- a/src/Utils/Schedule/Types.hs +++ b/src/Utils/Schedule/Types.hs @@ -16,8 +16,10 @@ data ScheduleEntry = ScheduleEntry } data ScheduleEntryType = SETCourseEvent { setceType :: CI Text } -- TODO: CourseEventType not possible here (comes from data family instance) - | SETTutorial { settType :: CI Text } -- TODO: TutorialType not possible here (comes from data family instance) - | SETExamOccurrence { seteoExamName :: ExamName } + | SETTutorial { settType :: CI Text + , settName :: TutorialName + } -- TODO: TutorialType not possible here (comes from data family instance) + | SETExamOccurrence { seteoName :: ExamName } -- TODO: more? deriving (Eq, Ord, Show, Read, Generic, Typeable) diff --git a/templates/widgets/schedule/week.hamlet b/templates/widgets/schedule/week.hamlet index 3ffb1cd3c..6a65b3127 100644 --- a/templates/widgets/schedule/week.hamlet +++ b/templates/widgets/schedule/week.hamlet @@ -26,9 +26,10 @@ $newline never $of SETCourseEvent{..} #{CI.original setceType} $of SETTutorial{..} - #{CI.original settType} + #{settName} # + (#{CI.original settType}) $of SETExamOccurrence{..} - #{seteoExamName} + #{seteoName}
$maybe room <- seRoom