diff --git a/messages/uniworx/de-de-formal.msg b/messages/uniworx/de-de-formal.msg index b3448e45d..7504c4f34 100644 --- a/messages/uniworx/de-de-formal.msg +++ b/messages/uniworx/de-de-formal.msg @@ -1516,6 +1516,7 @@ ExamParticipantsRegisterHeading: Prüfungsteilnehmer hinzufügen ExamParticipantsInvited n@Int: #{n} #{pluralDE n "Einladung" "Einladungen"} per E-Mail verschickt ExamName: Name +ExamRoom: Raum ExamTime: Termin ExamsHeading: Prüfungen ExamNameTip: Muss innerhalb der Veranstaltung eindeutig sein @@ -1587,11 +1588,11 @@ ExamRoomFifo': Auswahl durch Teilnehmer bei Anmeldung ExamOccurrence: Termin/Raum ExamNoOccurrence: Kein Termin/Raum ExamNoSuchOccurrence: Termin/Raum existiert nicht (mehr) -ExamOccurrences: Prüfungen +ExamOccurrences: Termine ExamRooms: Räume +ExamTimes: Termine ExamRoomAlreadyExists: Prüfung ist bereits eingetragen ExamRoomName: Interne Bezeichnung -ExamRoom: Raum ExamRoomCapacity: Kapazität ExamRoomCapacityNegative: Kapazität darf nicht negativ sein ExamRoomTime: Termin diff --git a/messages/uniworx/en-eu.msg b/messages/uniworx/en-eu.msg index 4641ebd9f..db8199833 100644 --- a/messages/uniworx/en-eu.msg +++ b/messages/uniworx/en-eu.msg @@ -1514,6 +1514,7 @@ ExamParticipantsRegisterHeading: Add exam participants ExamParticipantsInvited n: #{n} #{pluralEN n "invitation" "invitations"} sent via email ExamName: Name +ExamRoom: Room ExamTime: Time ExamsHeading: Exams ExamNameTip: Needs to be unique within the course @@ -1587,9 +1588,9 @@ ExamNoOccurrence: No occurrence/room ExamNoSuchOccurrence: Occurrence/Room does not exist (anymore) ExamOccurrences: Exams ExamRooms: Rooms +ExamTimes: Times ExamRoomAlreadyExists: Occurrence already configured ExamRoomName: Internal name -ExamRoom: Room ExamRoomCapacity: Capacity ExamRoomCapacityNegative: Capacity may not be negative ExamRoomTime: Time diff --git a/src/Handler/Exam/Show.hs b/src/Handler/Exam/Show.hs index febf7c4f3..50c2c1fb2 100644 --- a/src/Handler/Exam/Show.hs +++ b/src/Handler/Exam/Show.hs @@ -103,6 +103,10 @@ getEShowR tid ssh csh examn = do fmap (Just occId, ) . hasWriteAccessTo . CExamR tid ssh csh examName $ ERegisterOccR examOccurrenceName 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 | isRegistered <- is _Just $ join registered , examOccurrenceRule /= ExamRoomFifo || (isRegistered && not (any snd occurrences)) diff --git a/templates/exam-show.hamlet b/templates/exam-show.hamlet index ac8653319..48754437c 100644 --- a/templates/exam-show.hamlet +++ b/templates/exam-show.hamlet @@ -47,6 +47,9 @@ $maybe desc <- examDescription $maybe publishAssignments <- examPublishOccurrenceAssignments
_{MsgExamPublishOccurrenceAssignmentsParticipant}
^{formatTimeW SelFormatDateTime publishAssignments} + $maybe room <- examRoom +
_{MsgExamRoom} +
#{room} $if examTimes
_{MsgExamTime}
@@ -106,9 +109,11 @@ $if not (null occurrences)

$if examTimes - _{MsgExamOccurrences} - $else _{MsgExamRooms} + $elseif is _Just examRoom + _{MsgExamTimes} + $else + _{MsgExamOccurrences} @@ -116,7 +121,8 @@ $if not (null occurrences) $if occurrenceNamesShown
_{MsgExamRoomName} \ ^{isVisible False} - _{MsgExamRoom} + $if is _Nothing examRoom + _{MsgExamRoom} $if not examTimes _{MsgExamRoomTime} $if showOccurrenceRegisterColumn @@ -151,7 +157,8 @@ $if not (null occurrences)
#{examOccurrenceName} - #{examOccurrenceRoom} + $if is _Nothing examRoom + #{examOccurrenceRoom} $if not examTimes ^{formatTimeRangeW SelFormatDateTime examOccurrenceStart examOccurrenceEnd}