From 551c4cb23cb9243acca793b3430e8732754336bb Mon Sep 17 00:00:00 2001 From: Steffen Jost Date: Wed, 3 Jul 2019 14:32:58 +0200 Subject: [PATCH] fix(home): fix build --- src/Handler/Home.hs | 10 +++++----- src/Handler/Utils/Table/Cells.hs | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Handler/Home.hs b/src/Handler/Home.hs index 73c9dd8ee..53cde3d91 100644 --- a/src/Handler/Home.hs +++ b/src/Handler/Home.hs @@ -40,9 +40,9 @@ homeOpenCourses = do colonnade = mconcat [ -- dbRow sortable (Just "term") (i18nCell MsgTerm) $ \DBRow{ dbrOutput=Entity{entityVal = course} } -> - textCell $ toMessage $ courseTerm course + msgCell $ courseTerm course , sortable (Just "school") (i18nCell MsgCourseSchool) $ \DBRow{ dbrOutput=Entity{entityVal = course} } -> - textCell $ toMessage $ courseSchool course + msgCell $ courseSchool course , sortable (Just "course") (i18nCell MsgCourse) $ \DBRow{ dbrOutput=Entity{entityVal = course} } -> do let tid = courseTerm course ssh = courseSchool course @@ -215,11 +215,11 @@ homeUpcomingExams uid = do return r dbtColonnade = dbColonnade $ mconcat [ sortable (Just "term") (i18nCell MsgTerm) $ \DBRow{ dbrOutput = view lensCourse -> Entity _ Course{..} } -> - textCell $ display courseTerm + msgCell courseTerm , sortable (Just "school") (i18nCell MsgCourseSchool) $ \DBRow{ dbrOutput = view lensCourse -> Entity _ Course{..} } -> - textCell $ display courseSchool + msgCell courseSchool , sortable (Just "course") (i18nCell MsgCourse) $ \DBRow{ dbrOutput = view lensCourse -> Entity _ Course{..} } -> - anchorCell (CourseR courseTerm courseSchool courseShorthand CShowR) (toWidget $ display courseShorthand) + anchorCell (CourseR courseTerm courseSchool courseShorthand CShowR) (toWgt courseShorthand) -- continue here , sortable (Just "name") (i18nCell MsgExamName) $ \DBRow{ dbrOutput } -> do let Entity _ Exam{..} = view lensExam dbrOutput diff --git a/src/Handler/Utils/Table/Cells.hs b/src/Handler/Utils/Table/Cells.hs index 2e8e53db8..3bae746a8 100644 --- a/src/Handler/Utils/Table/Cells.hs +++ b/src/Handler/Utils/Table/Cells.hs @@ -71,6 +71,8 @@ ifCell decision cTrue cFalse x linkEmptyCell :: IsDBTable m a => Route UniWorX -> Widget -> DBCell m a linkEmptyCell link wgt = linkEitherCell link (wgt,mempty) +msgCell :: (ToMessage t, IsDBTable m a) => t -> DBCell m a +msgCell = textCell . toMessage -- Recall: for line numbers, use dbRow