diff --git a/src/Handler/Course.hs b/src/Handler/Course.hs index 7128a8860..afdd35037 100644 --- a/src/Handler/Course.hs +++ b/src/Handler/Course.hs @@ -226,7 +226,7 @@ makeCourseTable whereClause colChoices psValidator = do ] , dbtStyle = def { dbsFilterLayout = defaultDBSFilterLayout - , dbsCellTemplate = DBSTCourse (_dbrOutput . _1) (_dbrOutput . _5) (_dbrOutput . _3) (_dbrOutput . _4) + , dbsTemplate = DBSTCourse (_dbrOutput . _1) (_dbrOutput . _5) (_dbrOutput . _3) (_dbrOutput . _4) -- ^ course ^ lecturer list ^ isRegistered ^ school } , dbtParams = def diff --git a/src/Handler/Home.hs b/src/Handler/Home.hs index 881ad8eac..05bb6b1f2 100644 --- a/src/Handler/Home.hs +++ b/src/Handler/Home.hs @@ -20,7 +20,7 @@ getHomeR = do setTitleI MsgHomeHeading fromMaybe mempty upcomingExamsWidget maybe mempty homeUpcomingSheets muid - homeOpenCourses + maybe homeOpenCourses (const mempty) muid homeOpenCourses :: Widget diff --git a/src/Handler/Utils/Table/Pagination.hs b/src/Handler/Utils/Table/Pagination.hs index f2c8a5c3c..c816d557b 100644 --- a/src/Handler/Utils/Table/Pagination.hs +++ b/src/Handler/Utils/Table/Pagination.hs @@ -439,7 +439,7 @@ data DBStyle r = DBStyle -> Widget -> Widget -- ^ Filter UI, Filter Encoding, Filter action, table - , dbsCellTemplate :: DBSTemplateMode r + , dbsTemplate :: DBSTemplateMode r } data DBSTemplateMode r = DBSTDefault @@ -456,7 +456,7 @@ instance Default (DBStyle r) where ^{scrolltable} |] - , dbsCellTemplate = DBSTDefault + , dbsTemplate = DBSTDefault } defaultDBSFilterLayout :: Widget -- ^ Filter UI @@ -1030,12 +1030,11 @@ dbTable PSValidator{..} dbtable@DBTable{ dbtIdent = dbtIdent'@(toPathPiece -> db . setParam (wIdent "pagination") Nothing table' :: HandlerSite m ~ UniWorX => WriterT x m Widget - table' = case dbsCellTemplate of + table' = let + columnCount :: Int64 + columnCount = olength64 $ getColonnade dbtColonnade + in case dbsTemplate of DBSTCourse c l r s -> do - let - columnCount :: Int64 - columnCount = olength64 $ getColonnade dbtColonnade - wRows <- forM (zip [0..length rows] rows) $ \(cid, row') -> let Course{..} = row' ^. c . _entityVal lecturerUsers = row' ^. l @@ -1059,9 +1058,6 @@ dbTable PSValidator{..} dbtable@DBTable{ dbtIdent = dbtIdent'@(toPathPiece -> db piSorting' = [ sSet | sSet <- fromMaybe [] piSorting, Just (sortKey sSet) /= sortableKey ] return $(widgetFile "table/cell/header") - columnCount :: Int64 - columnCount = olength64 $ getColonnade dbtColonnade - wHeaders <- maybe (return Nothing) (fmap Just . genHeaders) pSortable wRows <- forM rows $ \row' -> forM (oneColonnadeEncode <$> getColonnade dbtColonnade) $ \(($ row') -> cell') -> do diff --git a/templates/default-layout.lucius b/templates/default-layout.lucius index a6c943279..b1db5eea7 100644 --- a/templates/default-layout.lucius +++ b/templates/default-layout.lucius @@ -328,6 +328,9 @@ input[type="button"].btn-info:hover, /* SCROLLTABLE */ .scrolltable { overflow: auto; +} + +.scrolltable--bordered { box-shadow: 0 0 1px 1px var(--color-grey-light); } diff --git a/templates/table/colonnade.hamlet b/templates/table/colonnade.hamlet index fb4be4ba5..c756229c5 100644 --- a/templates/table/colonnade.hamlet +++ b/templates/table/colonnade.hamlet @@ -1,5 +1,5 @@ $newline never -
+
$maybe wHeaders' <- wHeaders diff --git a/templates/table/course/colonnade.hamlet b/templates/table/course/colonnade.hamlet index f67891d7d..50b97eb15 100644 --- a/templates/table/course/colonnade.hamlet +++ b/templates/table/course/colonnade.hamlet @@ -1,12 +1,7 @@ $newline never
-
- - $if null wRows && (dbsEmptyStyle == DBESHeading) - - - ^{row} \ No newline at end of file + $if null wRows && (dbsEmptyStyle == DBESHeading) +

_{dbsEmptyMessage} + $else + $forall row <- wRows + ^{row} \ No newline at end of file diff --git a/templates/table/course/colonnade.lucius b/templates/table/course/colonnade.lucius index a25eed638..49e4996b4 100644 --- a/templates/table/course/colonnade.lucius +++ b/templates/table/course/colonnade.lucius @@ -6,6 +6,10 @@ --course-expanded-bg-color: var(--color-grey-light); } +.scrolltable { + box-shadow: none!important; +} + .course-teaser { display: grid; grid-gap: 5px 7px;

- _{dbsEmptyMessage} - $else - $forall row <- wRows -