refactor(course-visibility): enhance visibility info on CShowR

This commit is contained in:
Sarah Vaupel 2020-07-24 20:19:34 +02:00
parent 222d566bda
commit 39683928ec
2 changed files with 10 additions and 8 deletions

View File

@ -217,6 +217,8 @@ getCShowR tid ssh csh = do
, all (notElem pathSeparator . view _2) fs , all (notElem pathSeparator . view _2) fs
] ]
hiddenEventNotes = all (\(_,CourseEvent{..}) -> is _Nothing courseEventNote) events hiddenEventNotes = all (\(_,CourseEvent{..}) -> is _Nothing courseEventNote) events
courseVisFrom = courseVisibleFrom course
courseVisTo = courseVisibleTo course
mayCreateNews <- hasWriteAccessTo $ CourseR tid ssh csh CNewsNewR mayCreateNews <- hasWriteAccessTo $ CourseR tid ssh csh CNewsNewR
mayCreateEvents <- hasWriteAccessTo $ CourseR tid ssh csh CEventsNewR mayCreateEvents <- hasWriteAccessTo $ CourseR tid ssh csh CEventsNewR
mayEditCourse <- hasWriteAccessTo $ CourseR tid ssh csh CEditR mayEditCourse <- hasWriteAccessTo $ CourseR tid ssh csh CEditR

View File

@ -127,16 +127,16 @@ $# $if NTop (Just 0) < NTop (courseCapacity course)
$if mayEditCourse $if mayEditCourse
<dt .deflist__dt> <dt .deflist__dt>
$if isJust (courseVisibleTo course) $if isJust courseVisFrom && isNothing courseVisTo
_{MsgCourseVisibility}
$else
_{MsgCourseVisibleFrom} _{MsgCourseVisibleFrom}
$else
_{MsgCourseVisibility}
<dd .deflist__dd> <dd .deflist__dd>
$maybe visFrom <- courseVisibleFrom course <p>
<p> $maybe visFrom <- courseVisFrom
^{formatTimeRangeW SelFormatDateTime visFrom (courseVisibleTo course)} ^{formatTimeRangeW SelFormatDateTime visFrom courseVisTo}
$nothing $nothing
_{MsgCourseInvisible} _{MsgCourseInvisible}
$maybe (Allocation{allocationName, allocationRegisterByCourse}, url) <- mAllocation' $maybe (Allocation{allocationName, allocationRegisterByCourse}, url) <- mAllocation'
<dt .deflist__dt>_{MsgCourseAllocation} <dt .deflist__dt>_{MsgCourseAllocation}