From 83445c4e7707febc569f4bff271f995ece64dcd0 Mon Sep 17 00:00:00 2001 From: Steffen Jost Date: Tue, 6 Aug 2019 18:20:15 +0200 Subject: [PATCH] feat(homepage): add convenience links to term and school table showing courses with open registration contains links to term and school filters for course list --- src/Handler/Home.hs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Handler/Home.hs b/src/Handler/Home.hs index 1c07cfc6b..b4d16ff10 100644 --- a/src/Handler/Home.hs +++ b/src/Handler/Home.hs @@ -39,10 +39,12 @@ homeOpenCourses = do colonnade :: Colonnade Sortable (DBRow (Entity Course)) (DBCell (HandlerT UniWorX IO) ()) colonnade = mconcat [ -- dbRow - sortable (Just "term") (i18nCell MsgTerm) $ \DBRow{ dbrOutput=Entity{entityVal = course} } -> - msgCell $ courseTerm course - , sortable (Just "school") (i18nCell MsgCourseSchool) $ \DBRow{ dbrOutput=Entity{entityVal = course} } -> - msgCell $ courseSchool course + sortable (Just "term") (i18nCell MsgTerm) + $ \DBRow{ dbrOutput=Entity{entityVal = Course{..}} } -> + anchorCell (TermCourseListR courseTerm) [whamlet|#{courseTerm}|] + , sortable (Just "schoolshort") (i18nCell MsgCourseSchoolShort) + $ \DBRow{ dbrOutput=(Entity _ Course{..}) } -> + anchorCell (TermSchoolCourseListR courseTerm courseSchool) [whamlet|_{unSchoolKey courseSchool}|] , sortable (Just "course") (i18nCell MsgCourse) $ \DBRow{ dbrOutput=Entity{entityVal = course} } -> do let tid = courseTerm course ssh = courseSchool course @@ -60,7 +62,7 @@ homeOpenCourses = do [ ( "term" , SortColumn $ \course -> course E.^. CourseTerm ) - , ( "school" + , ( "schoolshort" , SortColumn $ \course -> course E.^. CourseSchool ) , ( "course"