feat(course-events): hide note column if there are no notes to display
This commit is contained in:
parent
1138f9e327
commit
1ac7f4e881
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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)))}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user