show archive link on material show

This commit is contained in:
Steffen Jost 2019-05-09 19:58:03 +02:00
parent 36358af8be
commit 6a68e1de79
3 changed files with 9 additions and 3 deletions

View File

@ -127,7 +127,7 @@ getMaterialListR tid ssh csh = do
$ liftA2 anchorCell matLink toWgt . materialName . row2material
, sortable (toNothingS "description") mempty
$ foldMap modalCell . materialDescription . row2material
, sortable (toNothingS "zip-archive") mempty
, sortable (toNothingS "zip-archive") mempty -- TODO: don't show if there are no files!
$ zipCell . zipLink . materialName . row2material
, sortable (Just "visible-from") (i18nCell MsgAccessibleSince)
$ foldMap (dateTimeCellVisible now) . materialVisibleFrom . row2material
@ -179,6 +179,9 @@ getMShowR tid ssh csh mnm = do
let matLink :: FilePath -> Route UniWorX
matLink = CourseR tid ssh csh . MaterialR mnm . MFileR
zipLink :: Route UniWorX
zipLink = CMaterialR tid ssh csh mnm MArchiveR
seeAllModificationTimestamps <- hasReadAccessTo $ CourseR tid ssh csh CNotesR -- ordinary users should not see modification dates older than visibility
( Entity _mid material@Material{materialType, materialDescription}

View File

@ -69,6 +69,9 @@ tidFromText = fmap TermKey . maybeRight . termFromText
simpleLink :: Widget -> Route UniWorX -> Widget
simpleLink lbl url = [whamlet|<a href=@{url}>^{lbl}|]
simpleLinkI :: SomeMessage UniWorX -> Route UniWorX -> Widget
simpleLinkI lbl url = [whamlet|<a href=@{url}>_{lbl}|]
-- | toWidget-Version of @nameHtml@, for convenience
nameWidget :: Text -- ^ userDisplayName
-> Text -- ^ userSurname

View File

@ -16,7 +16,7 @@ $maybe descr <- materialDescription
<dt .deflist__dt>_{MsgFileModified}
<dd .deflist__dd>#{materialLastEdit}
$if hasFiles || True
$if hasFiles
<section>
<h2>_{MsgMaterialFiles}
<h2>^{simpleLinkI (SomeMessage MsgMaterialFiles) zipLink}
^{fileTable}