show archive link on material show
This commit is contained in:
parent
36358af8be
commit
6a68e1de79
@ -127,7 +127,7 @@ getMaterialListR tid ssh csh = do
|
|||||||
$ liftA2 anchorCell matLink toWgt . materialName . row2material
|
$ liftA2 anchorCell matLink toWgt . materialName . row2material
|
||||||
, sortable (toNothingS "description") mempty
|
, sortable (toNothingS "description") mempty
|
||||||
$ foldMap modalCell . materialDescription . row2material
|
$ 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
|
$ zipCell . zipLink . materialName . row2material
|
||||||
, sortable (Just "visible-from") (i18nCell MsgAccessibleSince)
|
, sortable (Just "visible-from") (i18nCell MsgAccessibleSince)
|
||||||
$ foldMap (dateTimeCellVisible now) . materialVisibleFrom . row2material
|
$ foldMap (dateTimeCellVisible now) . materialVisibleFrom . row2material
|
||||||
@ -179,6 +179,9 @@ getMShowR tid ssh csh mnm = do
|
|||||||
let matLink :: FilePath -> Route UniWorX
|
let matLink :: FilePath -> Route UniWorX
|
||||||
matLink = CourseR tid ssh csh . MaterialR mnm . MFileR
|
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
|
seeAllModificationTimestamps <- hasReadAccessTo $ CourseR tid ssh csh CNotesR -- ordinary users should not see modification dates older than visibility
|
||||||
|
|
||||||
( Entity _mid material@Material{materialType, materialDescription}
|
( Entity _mid material@Material{materialType, materialDescription}
|
||||||
|
|||||||
@ -69,6 +69,9 @@ tidFromText = fmap TermKey . maybeRight . termFromText
|
|||||||
simpleLink :: Widget -> Route UniWorX -> Widget
|
simpleLink :: Widget -> Route UniWorX -> Widget
|
||||||
simpleLink lbl url = [whamlet|<a href=@{url}>^{lbl}|]
|
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
|
-- | toWidget-Version of @nameHtml@, for convenience
|
||||||
nameWidget :: Text -- ^ userDisplayName
|
nameWidget :: Text -- ^ userDisplayName
|
||||||
-> Text -- ^ userSurname
|
-> Text -- ^ userSurname
|
||||||
|
|||||||
@ -16,7 +16,7 @@ $maybe descr <- materialDescription
|
|||||||
<dt .deflist__dt>_{MsgFileModified}
|
<dt .deflist__dt>_{MsgFileModified}
|
||||||
<dd .deflist__dd>#{materialLastEdit}
|
<dd .deflist__dd>#{materialLastEdit}
|
||||||
|
|
||||||
$if hasFiles || True
|
$if hasFiles
|
||||||
<section>
|
<section>
|
||||||
<h2>_{MsgMaterialFiles}
|
<h2>^{simpleLinkI (SomeMessage MsgMaterialFiles) zipLink}
|
||||||
^{fileTable}
|
^{fileTable}
|
||||||
|
|||||||
Reference in New Issue
Block a user