feat(hide-columns): add hider labels for material list
This commit is contained in:
parent
71e90a1817
commit
ccafd955b9
@ -104,6 +104,7 @@ getMaterialListR tid ssh csh = do
|
|||||||
|
|
||||||
now <- liftIO getCurrentTime
|
now <- liftIO getCurrentTime
|
||||||
seeAllModificationTimestamps <- hasWriteAccessTo $ CourseR tid ssh csh MaterialNewR -- ordinary users should not see modification dates older than visibility
|
seeAllModificationTimestamps <- hasWriteAccessTo $ CourseR tid ssh csh MaterialNewR -- ordinary users should not see modification dates older than visibility
|
||||||
|
MsgRenderer mr <- getMsgRenderer
|
||||||
table <- runDB $ do
|
table <- runDB $ do
|
||||||
cid <- getKeyBy404 $ TermSchoolCourseShort tid ssh csh
|
cid <- getKeyBy404 $ TermSchoolCourseShort tid ssh csh
|
||||||
let row2material = view $ _dbrOutput . _1 . _entityVal
|
let row2material = view $ _dbrOutput . _1 . _entityVal
|
||||||
@ -127,9 +128,9 @@ getMaterialListR tid ssh csh = do
|
|||||||
$ foldMap (textCell . CI.original) . materialType . row2material
|
$ foldMap (textCell . CI.original) . materialType . row2material
|
||||||
, sortable (Just "name") (i18nCell MsgMaterialName)
|
, sortable (Just "name") (i18nCell MsgMaterialName)
|
||||||
$ liftA2 anchorCell matLink toWgt . materialName . row2material
|
$ 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
|
$ 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
|
$ \DBRow{ dbrOutput = (Entity _ Material{..}, E.Value fileNum) } -> if
|
||||||
| fileNum == 0 -> mempty
|
| fileNum == 0 -> mempty
|
||||||
| otherwise -> fileCell $ filesLink materialName
|
| otherwise -> fileCell $ filesLink materialName
|
||||||
|
|||||||
Reference in New Issue
Block a user