From ccafd955b9b9659d05e34aadd0bd8fdc15ac44d9 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Tue, 7 Jan 2020 16:47:15 +0100 Subject: [PATCH] feat(hide-columns): add hider labels for material list --- src/Handler/Material.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Handler/Material.hs b/src/Handler/Material.hs index 55ed2afa0..e080ba0b9 100644 --- a/src/Handler/Material.hs +++ b/src/Handler/Material.hs @@ -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