feat(course-events): hide note column if there are no notes to display

This commit is contained in:
Sarah Vaupel 2020-03-31 16:35:32 +02:00
parent 1138f9e327
commit 1ac7f4e881
3 changed files with 7 additions and 3 deletions

View File

@ -831,6 +831,9 @@ th, td
font-style: normal
color: var(--color-font)
.course-event-note--hidden
display: none
.bound_explanation
color: var(--color-fontsec)
font-style: italic

View File

@ -198,6 +198,7 @@ getCShowR tid ssh csh = do
, length fs <= 3
, all (notElem pathSeparator . view _2) fs
]
hiddenEventNotes = all (\(_,CourseEvent{..}) -> is _Nothing courseEventNote) events
mayCreateNews <- hasWriteAccessTo $ CourseR tid ssh csh CNewsNewR
mayCreateEvents <- hasWriteAccessTo $ CourseR tid ssh csh CEventsNewR

View File

@ -214,7 +214,7 @@ $# $if NTop (Just 0) < NTop (courseCapacity course)
_{MsgCourseEventTime}
<th .table__th uw-hide-column-header="room">
_{MsgCourseEventRoom}
<th .table__th uw-hide-column-header="note">
<th .table__th uw-hide-column-header="note" :hiddenEventNotes:.course-event-note--hidden>
_{MsgCourseEventNote}
$if mayCreateEvents
<th .table__th uw-hide-column-header="actions">
@ -232,7 +232,7 @@ $# $if NTop (Just 0) < NTop (courseCapacity course)
<td .table__td>
<div .table__td-content>
#{courseEventRoom}
<td .table__td>
<td .table__td :hiddenEventNotes:.course-event-note--hidden>
<div .table__td-content>
#{courseEventNote}
$if mayCreateEvents
@ -248,7 +248,7 @@ $# $if NTop (Just 0) < NTop (courseCapacity course)
<td>
<td>
<td>
<td>
<td :hiddenEventNotes:.course-event-note--hidden>
<td .table__td>
<div .table__td-content>
^{modal (i18n MsgCourseEventsActionCreate) (Left (SomeRoute (CourseR tid ssh csh CEventsNewR)))}