Handler.Utils.Table.Cells cleaned

This commit is contained in:
SJost 2018-09-12 11:54:25 +02:00
parent b98a5c2aa7
commit 9fff50983d
2 changed files with 5 additions and 48 deletions

View File

@ -47,19 +47,10 @@ colCourse = sortable (Just "course") (i18nCell MsgCourse)
anchorCell (CourseR courseTerm courseSchool courseShorthand CShowR)
[whamlet|#{display courseName}|]
-- colCourseDescr1 :: IsDBTable m a => Colonnade Sortable CourseTableData (DBCell m a)
-- colCourseDescr1 = sortable (Just "course") (i18nCell MsgCourse)
-- $ \DBRow{ dbrOutput=(Entity _cid course, _, _, _) } ->
-- courseCell course
-- colCourseDescr1 :: IsDBTable m a => Colonnade Sortable CourseTableData (DBCell m a)
-- colCourseDescr1 = sortable (Just "course") (i18nCell MsgCourse) $ do
-- course <- view $ _dbrOutput . _1 . _entityVal
-- return $ courseCell course
-- colCourseDescr1 :: IsDBTable m a => Colonnade Sortable CourseTableData (DBCell m a)
-- colCourseDescr1 = colCourseDescr _1
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 (i18nCell MsgCourseDescription)
@ -192,7 +183,7 @@ getCourseListR :: Handler Html
getCourseListR = do -- TODO: Suchfunktion für Kurse und Kürzel!!!
muid <- maybeAuthId
let colonnade = widgetColonnade $ mconcat
[ colCourseDescr $ _dbrOutput . _1 . _entityVal
[ colCourseDescr
, colCShort
, colTerm
, maybe mempty (const colRegistered) muid

View File

@ -81,37 +81,3 @@ submissionCell crse shn sid =
mkText cid = display2widget cid
in anchorCellM' mkCid mkRoute mkText
{-# DEPRECATED colCourseDescr, colsCourseDescr, colsCourseLink "Bad idea, write columns yourself you lazy bat!" #-}
-- Generic Columns -- We want to avoid these due to the literals occuring
colCourseDescr :: IsDBTable m a => Getting Course s Course -> Colonnade Sortable s (DBCell m a)
colCourseDescr getter =
sortable (Just "course") (i18nCell MsgCourse) $ do
course <- view getter
return $ courseCell course
colsCourseDescr :: IsDBTable m a => Getting Course s Course -> Colonnade Sortable s (DBCell m a)
colsCourseDescr getter = mconcat
[ sortable (Just "term") (i18nCell MsgTerm) $ do
course <- view getter
return $ termCell $ courseTerm course
, sortable (Just "school") (i18nCell MsgCourseSchool) $ do
course <- view getter
return $ schoolCell (Just $ courseTerm course) (courseSchool course)
, sortable (Just "course") (i18nCell MsgCourse) $ do
course <- view getter
return $ courseCell course
]
colsCourseLink :: (IsDBTable m a) => Getting CourseLink s CourseLink -> Colonnade Sortable s (DBCell m a)
colsCourseLink getter = mconcat
[ sortable (Just "term") (i18nCell MsgTerm) $ do
crs <- view getter
return $ termCell $ crs ^. _1
, sortable (Just "school") (i18nCell MsgCourseSchool) $ do
crs <- view getter
return $ schoolCell (Just $ crs ^. _1) (crs ^. _2)
, sortable (Just "course") (i18nCell MsgCourse) $ do
crs <- view getter
return $ courseLinkCell crs
]