This commit is contained in:
SJost 2019-02-21 22:08:49 +01:00
parent 7d72086fd9
commit f869876e12
3 changed files with 12 additions and 5 deletions

View File

@ -40,11 +40,11 @@ colCourseDescr = sortable (Just "course") (i18nCell MsgCourse) $ do
return $ courseCell course return $ courseCell course
colDescription :: IsDBTable m a => Colonnade Sortable CourseTableData (DBCell m a) colDescription :: IsDBTable m a => Colonnade Sortable CourseTableData (DBCell m a)
colDescription = sortable Nothing (i18nCell MsgCourseDescription) colDescription = sortable Nothing mempty
$ \DBRow{ dbrOutput=(Entity _ Course{..}, _, _, _) } -> $ \DBRow{ dbrOutput=(Entity _ Course{..}, _, _, _) } ->
case courseDescription of case courseDescription of
Nothing -> mempty Nothing -> mempty
(Just descr) -> cell $ modal "Beschreibung" (Right $ toWidget descr) (Just descr) -> cell $ modal (commentWidget True) (Right $ toWidget descr)
colCShort :: IsDBTable m a => Colonnade _ CourseTableData (DBCell m a) colCShort :: IsDBTable m a => Colonnade _ CourseTableData (DBCell m a)
colCShort = sortable (Just "cshort") (i18nCell MsgCourseShort) colCShort = sortable (Just "cshort") (i18nCell MsgCourseShort)
@ -190,7 +190,8 @@ getCourseListR :: Handler Html
getCourseListR = do getCourseListR = do
muid <- maybeAuthId muid <- maybeAuthId
let colonnade = widgetColonnade $ mconcat let colonnade = widgetColonnade $ mconcat
[ colCourseDescr [ colCourse -- colCourseDescr
, colDescription
, colSchoolShort , colSchoolShort
, colTerm , colTerm
, colCShort , colCShort

View File

@ -75,6 +75,12 @@ visibleWidget :: Bool -> Widget
visibleWidget True = mempty visibleWidget True = mempty
visibleWidget False = [whamlet|<i .fas .fa-eye-slash>|] visibleWidget False = [whamlet|<i .fas .fa-eye-slash>|]
isVisibleWidget :: Bool -> Widget
-- ^ @visibleWidget True@ is an icon that denotes that something™ is visible
isVisibleWidget True = [whamlet|<i .fas .fa-eye>|]
isVisibleWidget False = mempty
commentWidget :: Bool -> Widget commentWidget :: Bool -> Widget
-- ^ @commentWidget True@ is an icon that denotes that something™ has a comment -- ^ @commentWidget True@ is an icon that denotes that something™ has a comment
commentWidget True = [whamlet|<i .fas .fa-comment-alt>|] commentWidget True = [whamlet|<i .fas .fa-comment-alt>|]

View File

@ -220,7 +220,7 @@ fillDb = do
-- FFP -- FFP
ffp <- insert' Course ffp <- insert' Course
{ courseName = "Fortgeschrittene Funktionale Programmierung" { courseName = "Fortgeschrittene Funktionale Programmierung"
, courseDescription = Nothing , courseDescription = Just "<h2>It is fun!</h2>Come to where the functional is!"
, courseLinkExternal = Nothing , courseLinkExternal = Nothing
, courseShorthand = "FFP" , courseShorthand = "FFP"
, courseTerm = TermKey summer2018 , courseTerm = TermKey summer2018
@ -354,7 +354,7 @@ fillDb = do
-- datenbanksysteme -- datenbanksysteme
dbs <- insert' Course dbs <- insert' Course
{ courseName = "Datenbanksysteme" { courseName = "Datenbanksysteme"
, courseDescription = Nothing , courseDescription = Just "Datenbanken banken Daten damit die Daten nicht wanken. Die Datenschützer danken!"
, courseLinkExternal = Nothing , courseLinkExternal = Nothing
, courseShorthand = "DBS" , courseShorthand = "DBS"
, courseTerm = TermKey summer2018 , courseTerm = TermKey summer2018