refactor(course-visibility): enhance visibility info on CShowR
This commit is contained in:
parent
222d566bda
commit
39683928ec
@ -217,6 +217,8 @@ getCShowR tid ssh csh = do
|
||||
, all (notElem pathSeparator . view _2) fs
|
||||
]
|
||||
hiddenEventNotes = all (\(_,CourseEvent{..}) -> is _Nothing courseEventNote) events
|
||||
courseVisFrom = courseVisibleFrom course
|
||||
courseVisTo = courseVisibleTo course
|
||||
mayCreateNews <- hasWriteAccessTo $ CourseR tid ssh csh CNewsNewR
|
||||
mayCreateEvents <- hasWriteAccessTo $ CourseR tid ssh csh CEventsNewR
|
||||
mayEditCourse <- hasWriteAccessTo $ CourseR tid ssh csh CEditR
|
||||
|
||||
@ -127,16 +127,16 @@ $# $if NTop (Just 0) < NTop (courseCapacity course)
|
||||
|
||||
$if mayEditCourse
|
||||
<dt .deflist__dt>
|
||||
$if isJust (courseVisibleTo course)
|
||||
_{MsgCourseVisibility}
|
||||
$else
|
||||
$if isJust courseVisFrom && isNothing courseVisTo
|
||||
_{MsgCourseVisibleFrom}
|
||||
$else
|
||||
_{MsgCourseVisibility}
|
||||
<dd .deflist__dd>
|
||||
$maybe visFrom <- courseVisibleFrom course
|
||||
<p>
|
||||
^{formatTimeRangeW SelFormatDateTime visFrom (courseVisibleTo course)}
|
||||
$nothing
|
||||
_{MsgCourseInvisible}
|
||||
<p>
|
||||
$maybe visFrom <- courseVisFrom
|
||||
^{formatTimeRangeW SelFormatDateTime visFrom courseVisTo}
|
||||
$nothing
|
||||
_{MsgCourseInvisible}
|
||||
|
||||
$maybe (Allocation{allocationName, allocationRegisterByCourse}, url) <- mAllocation'
|
||||
<dt .deflist__dt>_{MsgCourseAllocation}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user