style(colonnade): no box-shadow for course lists, no courses on home

removed box-shadow from scrolltable and introduced scrolltable--bordered class; removed course list from home when logged in
This commit is contained in:
Sarah Vaupel 2019-07-24 17:25:49 +02:00
parent 973a6f4d04
commit 48113ebee0
7 changed files with 21 additions and 23 deletions

View File

@ -226,7 +226,7 @@ makeCourseTable whereClause colChoices psValidator = do
] ]
, dbtStyle = def , dbtStyle = def
{ dbsFilterLayout = defaultDBSFilterLayout { 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 -- ^ course ^ lecturer list ^ isRegistered ^ school
} }
, dbtParams = def , dbtParams = def

View File

@ -20,7 +20,7 @@ getHomeR = do
setTitleI MsgHomeHeading setTitleI MsgHomeHeading
fromMaybe mempty upcomingExamsWidget fromMaybe mempty upcomingExamsWidget
maybe mempty homeUpcomingSheets muid maybe mempty homeUpcomingSheets muid
homeOpenCourses maybe homeOpenCourses (const mempty) muid
homeOpenCourses :: Widget homeOpenCourses :: Widget

View File

@ -439,7 +439,7 @@ data DBStyle r = DBStyle
-> Widget -> Widget
-> Widget -> Widget
-- ^ Filter UI, Filter Encoding, Filter action, table -- ^ Filter UI, Filter Encoding, Filter action, table
, dbsCellTemplate :: DBSTemplateMode r , dbsTemplate :: DBSTemplateMode r
} }
data DBSTemplateMode r = DBSTDefault data DBSTemplateMode r = DBSTDefault
@ -456,7 +456,7 @@ instance Default (DBStyle r) where
<!-- No Filter UI --> <!-- No Filter UI -->
^{scrolltable} ^{scrolltable}
|] |]
, dbsCellTemplate = DBSTDefault , dbsTemplate = DBSTDefault
} }
defaultDBSFilterLayout :: Widget -- ^ Filter UI defaultDBSFilterLayout :: Widget -- ^ Filter UI
@ -1030,12 +1030,11 @@ dbTable PSValidator{..} dbtable@DBTable{ dbtIdent = dbtIdent'@(toPathPiece -> db
. setParam (wIdent "pagination") Nothing . setParam (wIdent "pagination") Nothing
table' :: HandlerSite m ~ UniWorX => WriterT x m Widget 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 DBSTCourse c l r s -> do
let
columnCount :: Int64
columnCount = olength64 $ getColonnade dbtColonnade
wRows <- forM (zip [0..length rows] rows) $ \(cid, row') -> let wRows <- forM (zip [0..length rows] rows) $ \(cid, row') -> let
Course{..} = row' ^. c . _entityVal Course{..} = row' ^. c . _entityVal
lecturerUsers = row' ^. l lecturerUsers = row' ^. l
@ -1059,9 +1058,6 @@ dbTable PSValidator{..} dbtable@DBTable{ dbtIdent = dbtIdent'@(toPathPiece -> db
piSorting' = [ sSet | sSet <- fromMaybe [] piSorting, Just (sortKey sSet) /= sortableKey ] piSorting' = [ sSet | sSet <- fromMaybe [] piSorting, Just (sortKey sSet) /= sortableKey ]
return $(widgetFile "table/cell/header") return $(widgetFile "table/cell/header")
columnCount :: Int64
columnCount = olength64 $ getColonnade dbtColonnade
wHeaders <- maybe (return Nothing) (fmap Just . genHeaders) pSortable wHeaders <- maybe (return Nothing) (fmap Just . genHeaders) pSortable
wRows <- forM rows $ \row' -> forM (oneColonnadeEncode <$> getColonnade dbtColonnade) $ \(($ row') -> cell') -> do wRows <- forM rows $ \row' -> forM (oneColonnadeEncode <$> getColonnade dbtColonnade) $ \(($ row') -> cell') -> do

View File

@ -328,6 +328,9 @@ input[type="button"].btn-info:hover,
/* SCROLLTABLE */ /* SCROLLTABLE */
.scrolltable { .scrolltable {
overflow: auto; overflow: auto;
}
.scrolltable--bordered {
box-shadow: 0 0 1px 1px var(--color-grey-light); box-shadow: 0 0 1px 1px var(--color-grey-light);
} }

View File

@ -1,5 +1,5 @@
$newline never $newline never
<div .scrolltable> <div .scrolltable .scrolltable--bordered>
<table *{dbsAttrs'}> <table *{dbsAttrs'}>
$maybe wHeaders' <- wHeaders $maybe wHeaders' <- wHeaders
<thead> <thead>

View File

@ -1,12 +1,7 @@
$newline never $newline never
<div .scrolltable> <div .scrolltable>
<table *{dbsAttrs'}> $if null wRows && (dbsEmptyStyle == DBESHeading)
<tbody> <p>_{dbsEmptyMessage}
$if null wRows && (dbsEmptyStyle == DBESHeading) $else
<tr .table__row> $forall row <- wRows
<td .table__td colspan=#{show columnCount}> ^{row}
_{dbsEmptyMessage}
$else
$forall row <- wRows
<tr .table__row>
^{row}

View File

@ -6,6 +6,10 @@
--course-expanded-bg-color: var(--color-grey-light); --course-expanded-bg-color: var(--color-grey-light);
} }
.scrolltable {
box-shadow: none!important;
}
.course-teaser { .course-teaser {
display: grid; display: grid;
grid-gap: 5px 7px; grid-gap: 5px 7px;