fix(sheet list): do not show icons for inaccessible items

Closes #421
This commit is contained in:
Steffen Jost 2019-08-20 17:50:12 +02:00
parent 9d9ead95d8
commit 0bb9a0fa60
2 changed files with 10 additions and 5 deletions

View File

@ -186,7 +186,7 @@ getSheetListR tid ssh csh = do
let
hasSFT :: (E.Value Bool, E.Value Bool, E.Value Bool, E.Value Bool) -> [SheetFileType]
hasSFT (E.Value hasExercise, E.Value hasHint, E.Value hasSolution, E.Value hasMarking)
= [ sft | sft <- [minBound..maxBound]
= [ sft | sft <- universeF
, sft /= SheetExercise || hasExercise
, sft /= SheetHint || hasHint
, sft /= SheetSolution || hasSolution
@ -204,7 +204,7 @@ getSheetListR tid ssh csh = do
E.where_ $ sheet E.^. SheetCourse E.==. E.val cid
sheetFilter :: SheetName -> DB Bool
sheetFilter sheetName = (== Authorized) <$> evalAccessDB (CSheetR tid ssh csh sheetName SShowR) False
sheetFilter sheetName = hasReadAccessTo $ CSheetR tid ssh csh sheetName SShowR
sheetCol = widgetColonnade . mconcat $
[ -- dbRow ,
@ -220,9 +220,9 @@ getSheetListR tid ssh csh = do
| let existingSFTs = hasSFT existFiles
, sft <- [minBound..maxBound]
, let link = CSheetR tid ssh csh sheetName $ SZipR sft
, let icn = toWidget $ sheetFile2markup sft
, let icn = toWgt $ sheetFile2markup sft
, let icnCell = if sft `elem` existingSFTs
then linkEmptyCell link icn
then linkEitherCell link (icn, [whamlet|&emsp;|])
else spacerCell
] id & cellAttrs <>~ [("class","list--inline list--space-separated")]
, sortable (Just "submission-since") (i18nCell MsgSheetActiveFrom)

View File

@ -482,6 +482,11 @@ ul.list--inline {
}
}
.list--icon-width li {
width: 1rem;
height: 1rem;
}
/* DEFINITION LIST */
.deflist {
display: grid;
@ -626,7 +631,7 @@ section {
grid-column: 1;
max-width: none;
padding-left: 40px;
&::before {