feat(exams): improve occurrence display
This commit is contained in:
parent
45506bd773
commit
2b56f26c45
@ -1516,6 +1516,7 @@ ExamParticipantsRegisterHeading: Prüfungsteilnehmer hinzufügen
|
|||||||
ExamParticipantsInvited n@Int: #{n} #{pluralDE n "Einladung" "Einladungen"} per E-Mail verschickt
|
ExamParticipantsInvited n@Int: #{n} #{pluralDE n "Einladung" "Einladungen"} per E-Mail verschickt
|
||||||
|
|
||||||
ExamName: Name
|
ExamName: Name
|
||||||
|
ExamRoom: Raum
|
||||||
ExamTime: Termin
|
ExamTime: Termin
|
||||||
ExamsHeading: Prüfungen
|
ExamsHeading: Prüfungen
|
||||||
ExamNameTip: Muss innerhalb der Veranstaltung eindeutig sein
|
ExamNameTip: Muss innerhalb der Veranstaltung eindeutig sein
|
||||||
@ -1587,11 +1588,11 @@ ExamRoomFifo': Auswahl durch Teilnehmer bei Anmeldung
|
|||||||
ExamOccurrence: Termin/Raum
|
ExamOccurrence: Termin/Raum
|
||||||
ExamNoOccurrence: Kein Termin/Raum
|
ExamNoOccurrence: Kein Termin/Raum
|
||||||
ExamNoSuchOccurrence: Termin/Raum existiert nicht (mehr)
|
ExamNoSuchOccurrence: Termin/Raum existiert nicht (mehr)
|
||||||
ExamOccurrences: Prüfungen
|
ExamOccurrences: Termine
|
||||||
ExamRooms: Räume
|
ExamRooms: Räume
|
||||||
|
ExamTimes: Termine
|
||||||
ExamRoomAlreadyExists: Prüfung ist bereits eingetragen
|
ExamRoomAlreadyExists: Prüfung ist bereits eingetragen
|
||||||
ExamRoomName: Interne Bezeichnung
|
ExamRoomName: Interne Bezeichnung
|
||||||
ExamRoom: Raum
|
|
||||||
ExamRoomCapacity: Kapazität
|
ExamRoomCapacity: Kapazität
|
||||||
ExamRoomCapacityNegative: Kapazität darf nicht negativ sein
|
ExamRoomCapacityNegative: Kapazität darf nicht negativ sein
|
||||||
ExamRoomTime: Termin
|
ExamRoomTime: Termin
|
||||||
|
|||||||
@ -1514,6 +1514,7 @@ ExamParticipantsRegisterHeading: Add exam participants
|
|||||||
ExamParticipantsInvited n: #{n} #{pluralEN n "invitation" "invitations"} sent via email
|
ExamParticipantsInvited n: #{n} #{pluralEN n "invitation" "invitations"} sent via email
|
||||||
|
|
||||||
ExamName: Name
|
ExamName: Name
|
||||||
|
ExamRoom: Room
|
||||||
ExamTime: Time
|
ExamTime: Time
|
||||||
ExamsHeading: Exams
|
ExamsHeading: Exams
|
||||||
ExamNameTip: Needs to be unique within the course
|
ExamNameTip: Needs to be unique within the course
|
||||||
@ -1587,9 +1588,9 @@ ExamNoOccurrence: No occurrence/room
|
|||||||
ExamNoSuchOccurrence: Occurrence/Room does not exist (anymore)
|
ExamNoSuchOccurrence: Occurrence/Room does not exist (anymore)
|
||||||
ExamOccurrences: Exams
|
ExamOccurrences: Exams
|
||||||
ExamRooms: Rooms
|
ExamRooms: Rooms
|
||||||
|
ExamTimes: Times
|
||||||
ExamRoomAlreadyExists: Occurrence already configured
|
ExamRoomAlreadyExists: Occurrence already configured
|
||||||
ExamRoomName: Internal name
|
ExamRoomName: Internal name
|
||||||
ExamRoom: Room
|
|
||||||
ExamRoomCapacity: Capacity
|
ExamRoomCapacity: Capacity
|
||||||
ExamRoomCapacityNegative: Capacity may not be negative
|
ExamRoomCapacityNegative: Capacity may not be negative
|
||||||
ExamRoomTime: Time
|
ExamRoomTime: Time
|
||||||
|
|||||||
@ -103,6 +103,10 @@ getEShowR tid ssh csh examn = do
|
|||||||
fmap (Just occId, ) . hasWriteAccessTo . CExamR tid ssh csh examName $ ERegisterOccR examOccurrenceName
|
fmap (Just occId, ) . hasWriteAccessTo . CExamR tid ssh csh examName $ ERegisterOccR examOccurrenceName
|
||||||
|
|
||||||
let examTimes = all (\(Entity _ ExamOccurrence{..}, _) -> Just examOccurrenceStart == examStart && examOccurrenceEnd == examEnd) occurrences
|
let examTimes = all (\(Entity _ ExamOccurrence{..}, _) -> Just examOccurrenceStart == examStart && examOccurrenceEnd == examEnd) occurrences
|
||||||
|
examRoom = do
|
||||||
|
Entity _ primeOcc <- occurrences ^? _head . _1
|
||||||
|
guard $ all (\(Entity _ occ, _) -> examOccurrenceRoom occ == examOccurrenceRoom primeOcc) occurrences
|
||||||
|
return $ examOccurrenceRoom primeOcc
|
||||||
registerWidget mOcc
|
registerWidget mOcc
|
||||||
| isRegistered <- is _Just $ join registered
|
| isRegistered <- is _Just $ join registered
|
||||||
, examOccurrenceRule /= ExamRoomFifo || (isRegistered && not (any snd occurrences))
|
, examOccurrenceRule /= ExamRoomFifo || (isRegistered && not (any snd occurrences))
|
||||||
|
|||||||
@ -47,6 +47,9 @@ $maybe desc <- examDescription
|
|||||||
$maybe publishAssignments <- examPublishOccurrenceAssignments
|
$maybe publishAssignments <- examPublishOccurrenceAssignments
|
||||||
<dt .deflist__dt>_{MsgExamPublishOccurrenceAssignmentsParticipant}
|
<dt .deflist__dt>_{MsgExamPublishOccurrenceAssignmentsParticipant}
|
||||||
<dd .deflist__dd>^{formatTimeW SelFormatDateTime publishAssignments}
|
<dd .deflist__dd>^{formatTimeW SelFormatDateTime publishAssignments}
|
||||||
|
$maybe room <- examRoom
|
||||||
|
<dt .deflist__dt>_{MsgExamRoom}
|
||||||
|
<dd .deflist__dd>#{room}
|
||||||
$if examTimes
|
$if examTimes
|
||||||
<dt .deflist__dt>_{MsgExamTime}
|
<dt .deflist__dt>_{MsgExamTime}
|
||||||
<dd .deflist__dd>
|
<dd .deflist__dd>
|
||||||
@ -106,9 +109,11 @@ $if not (null occurrences)
|
|||||||
<section>
|
<section>
|
||||||
<h2>
|
<h2>
|
||||||
$if examTimes
|
$if examTimes
|
||||||
_{MsgExamOccurrences}
|
|
||||||
$else
|
|
||||||
_{MsgExamRooms}
|
_{MsgExamRooms}
|
||||||
|
$elseif is _Just examRoom
|
||||||
|
_{MsgExamTimes}
|
||||||
|
$else
|
||||||
|
_{MsgExamOccurrences}
|
||||||
<table .table .table--striped .table--hover>
|
<table .table .table--striped .table--hover>
|
||||||
<thead>
|
<thead>
|
||||||
<tr .table__row .table__row--head>
|
<tr .table__row .table__row--head>
|
||||||
@ -116,7 +121,8 @@ $if not (null occurrences)
|
|||||||
<th .table__th>
|
<th .table__th>
|
||||||
_{MsgExamRoomName}
|
_{MsgExamRoomName}
|
||||||
\ ^{isVisible False}
|
\ ^{isVisible False}
|
||||||
<th .table__th>_{MsgExamRoom}
|
$if is _Nothing examRoom
|
||||||
|
<th .table__th>_{MsgExamRoom}
|
||||||
$if not examTimes
|
$if not examTimes
|
||||||
<th .table__th>_{MsgExamRoomTime}
|
<th .table__th>_{MsgExamRoomTime}
|
||||||
$if showOccurrenceRegisterColumn
|
$if showOccurrenceRegisterColumn
|
||||||
@ -151,7 +157,8 @@ $if not (null occurrences)
|
|||||||
<tr .table__row :markUnregisteredOccurrences (Just occurrence) && not registered:.occurrence--not-registered>
|
<tr .table__row :markUnregisteredOccurrences (Just occurrence) && not registered:.occurrence--not-registered>
|
||||||
$if occurrenceNamesShown
|
$if occurrenceNamesShown
|
||||||
<td .table__td #exam-occurrence__#{examOccurrenceName}>#{examOccurrenceName}
|
<td .table__td #exam-occurrence__#{examOccurrenceName}>#{examOccurrenceName}
|
||||||
<td .table__td>#{examOccurrenceRoom}
|
$if is _Nothing examRoom
|
||||||
|
<td .table__td>#{examOccurrenceRoom}
|
||||||
$if not examTimes
|
$if not examTimes
|
||||||
<td .table__td>
|
<td .table__td>
|
||||||
^{formatTimeRangeW SelFormatDateTime examOccurrenceStart examOccurrenceEnd}
|
^{formatTimeRangeW SelFormatDateTime examOccurrenceStart examOccurrenceEnd}
|
||||||
|
|||||||
Reference in New Issue
Block a user