feat(hide-columns): add hider labels for material list

This commit is contained in:
Sarah Vaupel 2020-01-07 16:47:15 +01:00 committed by Gregor Kleen
parent 71e90a1817
commit ccafd955b9

View File

@ -104,6 +104,7 @@ getMaterialListR tid ssh csh = do
now <- liftIO getCurrentTime
seeAllModificationTimestamps <- hasWriteAccessTo $ CourseR tid ssh csh MaterialNewR -- ordinary users should not see modification dates older than visibility
MsgRenderer mr <- getMsgRenderer
table <- runDB $ do
cid <- getKeyBy404 $ TermSchoolCourseShort tid ssh csh
let row2material = view $ _dbrOutput . _1 . _entityVal
@ -127,9 +128,9 @@ getMaterialListR tid ssh csh = do
$ foldMap (textCell . CI.original) . materialType . row2material
, sortable (Just "name") (i18nCell MsgMaterialName)
$ liftA2 anchorCell matLink toWgt . materialName . row2material
, sortable (toNothingS "description") mempty
, sortable (toNothingS "description") (mempty & cellAttrs <>~ pure ("uw-hide-columns--hider-label", mr MsgMaterialDescription))
$ foldMap modalCell . materialDescription . row2material
, sortable (toNothingS "zip-archive") mempty
, sortable (toNothingS "zip-archive") (mempty & cellAttrs <>~ pure ("uw-hide-columns--hider-label", mr MsgMaterialFiles))
$ \DBRow{ dbrOutput = (Entity _ Material{..}, E.Value fileNum) } -> if
| fileNum == 0 -> mempty
| otherwise -> fileCell $ filesLink materialName