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
This commit is contained in:
Steffen Jost 2019-08-06 18:20:15 +02:00
parent 2208368596
commit 83445c4e77

View File

@ -39,10 +39,12 @@ homeOpenCourses = do
colonnade :: Colonnade Sortable (DBRow (Entity Course)) (DBCell (HandlerT UniWorX IO) ()) colonnade :: Colonnade Sortable (DBRow (Entity Course)) (DBCell (HandlerT UniWorX IO) ())
colonnade = mconcat colonnade = mconcat
[ -- dbRow [ -- dbRow
sortable (Just "term") (i18nCell MsgTerm) $ \DBRow{ dbrOutput=Entity{entityVal = course} } -> sortable (Just "term") (i18nCell MsgTerm)
msgCell $ courseTerm course $ \DBRow{ dbrOutput=Entity{entityVal = Course{..}} } ->
, sortable (Just "school") (i18nCell MsgCourseSchool) $ \DBRow{ dbrOutput=Entity{entityVal = course} } -> anchorCell (TermCourseListR courseTerm) [whamlet|#{courseTerm}|]
msgCell $ courseSchool course , 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 , sortable (Just "course") (i18nCell MsgCourse) $ \DBRow{ dbrOutput=Entity{entityVal = course} } -> do
let tid = courseTerm course let tid = courseTerm course
ssh = courseSchool course ssh = courseSchool course
@ -60,7 +62,7 @@ homeOpenCourses = do
[ ( "term" [ ( "term"
, SortColumn $ \course -> course E.^. CourseTerm , SortColumn $ \course -> course E.^. CourseTerm
) )
, ( "school" , ( "schoolshort"
, SortColumn $ \course -> course E.^. CourseSchool , SortColumn $ \course -> course E.^. CourseSchool
) )
, ( "course" , ( "course"