From 68d36b2fe0687faf7a3bbf1c76cecf65fda5455b Mon Sep 17 00:00:00 2001 From: SJost Date: Fri, 22 Feb 2019 07:47:20 +0100 Subject: [PATCH] Course description as icon complete --- src/Handler/Course.hs | 40 +++++++++++++++++++++------------------- test/Database.hs | 15 ++++++++++++++- 2 files changed, 35 insertions(+), 20 deletions(-) diff --git a/src/Handler/Course.hs b/src/Handler/Course.hs index 99c242802..eb0936540 100644 --- a/src/Handler/Course.hs +++ b/src/Handler/Course.hs @@ -34,10 +34,10 @@ colCourse = sortable (Just "course") (i18nCell MsgCourse) anchorCell (CourseR courseTerm courseSchool courseShorthand CShowR) [whamlet|#{display courseName}|] -colCourseDescr :: IsDBTable m a => Colonnade Sortable CourseTableData (DBCell m a) -colCourseDescr = sortable (Just "course") (i18nCell MsgCourse) $ do - course <- view $ _dbrOutput . _1 . _entityVal - return $ courseCell course +-- colCourseDescr :: IsDBTable m a => Colonnade Sortable CourseTableData (DBCell m a) +-- colCourseDescr = sortable (Just "course") (i18nCell MsgCourse) $ do +-- course <- view $ _dbrOutput . _1 . _entityVal +-- return $ courseCell course colDescription :: IsDBTable m a => Colonnade Sortable CourseTableData (DBCell m a) colDescription = sortable Nothing mempty @@ -51,19 +51,19 @@ colCShort = sortable (Just "cshort") (i18nCell MsgCourseShort) $ \DBRow{ dbrOutput=(Entity _ Course{..}, _, _, _) } -> anchorCell (CourseR courseTerm courseSchool courseShorthand CShowR) [whamlet|#{display courseShorthand}|] -colCShortDescr :: IsDBTable m a => Colonnade _ CourseTableData (DBCell m a) -colCShortDescr = sortable (Just "cshort") (i18nCell MsgCourseShort) - $ \DBRow{ dbrOutput=(Entity _ Course{..}, _, _, _) } -> mappend - ( anchorCell (CourseR courseTerm courseSchool courseShorthand CShowR) [whamlet|#{display courseShorthand}|] ) - ( case courseDescription of - Nothing -> mempty - (Just descr) -> cell - [whamlet| - $newline never -
- ^{modal "Beschreibung" (Right $ toWidget descr)} - |] - ) +-- colCShortDescr :: IsDBTable m a => Colonnade _ CourseTableData (DBCell m a) +-- colCShortDescr = sortable (Just "cshort") (i18nCell MsgCourseShort) +-- $ \DBRow{ dbrOutput=(Entity _ Course{..}, _, _, _) } -> mappend +-- ( anchorCell (CourseR courseTerm courseSchool courseShorthand CShowR) [whamlet|#{display courseShorthand}|] ) +-- ( case courseDescription of +-- Nothing -> mempty +-- (Just descr) -> cell +-- [whamlet| +-- $newline never +--
+-- ^{modal "Beschreibung" (Right $ toWidget descr)} +-- |] +-- ) colTerm :: IsDBTable m a => Colonnade _ CourseTableData (DBCell m a) colTerm = sortable (Just "term") (i18nCell MsgTerm) @@ -221,7 +221,8 @@ getTermSchoolCourseListR tid ssh = do muid <- maybeAuthId let colonnade = widgetColonnade $ mconcat [ dbRow - , colCShortDescr + , colCShort + , colDescription , colRegFrom , colRegTo , colMembers @@ -244,7 +245,8 @@ getTermCourseListR tid = do muid <- maybeAuthId let colonnade = widgetColonnade $ mconcat [ dbRow - , colCShortDescr + , colCShort + , colDescription , colSchoolShort , colRegFrom , colRegTo diff --git a/test/Database.hs b/test/Database.hs index 8cecdb70e..69ef0a541 100755 --- a/test/Database.hs +++ b/test/Database.hs @@ -218,9 +218,22 @@ fillDb = do repsert sdInf $ StudyTerms 79 (Just "IfI") (Just "Institut für Informatik") repsert sdMath $ StudyTerms 105 (Just "MI" ) (Just "Mathematisches Institut") -- FFP + let nbrs :: [Int] + nbrs = [1,2,3,27,7,1] ffp <- insert' Course { courseName = "Fortgeschrittene Funktionale Programmierung" - , courseDescription = Just "

It is fun!

Come to where the functional is!" + , courseDescription = Just [shamlet| +

It is fun! +

Come to where the functional is! +

+

Functional programming can be done in Haskell! +

This is not a joke, this is serious! +

+

Consider some numbers +
    + $forall n <- nbrs +
  • Number #{n} + |] , courseLinkExternal = Nothing , courseShorthand = "FFP" , courseTerm = TermKey summer2018