diff --git a/messages/uniworx/de.msg b/messages/uniworx/de.msg
index 0b65e07f1..1f99dec5a 100644
--- a/messages/uniworx/de.msg
+++ b/messages/uniworx/de.msg
@@ -1268,6 +1268,8 @@ ExceptionExists: Diese Ausnahme existiert bereits
ExceptionNoOccurAt: Termin
TutorialType: Typ
+TutorialTypePlaceholder: Tutorium, Zentralübung, ...
+TutorialTypeTip: Dient nur der Information der Studierenden
TutorialName: Bezeichnung
TutorialParticipants: Teilnehmer
TutorialCapacity: Kapazität
@@ -1295,7 +1297,7 @@ TutorialDeleted: Tutorium gelöscht
TutorialRegisteredSuccess tutn@TutorialName: Erfolgreich zum Tutorium #{tutn} angemeldet
TutorialDeregisteredSuccess tutn@TutorialName: Erfolgreich vom Tutorium #{tutn} abgemeldet
-TutorialNameTip: Muss eindeutig sein
+TutorialNameTip: Muss innerhalb des Kurses eindeutig sein
TutorialCapacityNonPositive: Kapazität muss größer oder gleich null sein
TutorialCapacityTip: Beschränkt wieviele Studenten sich zu diesem Tutorium anmelden können
TutorialRegGroupTip: Studenten können sich in jeweils maximal einem Tutorium pro Registrierungs-Gruppe anmelden. Ist bei zwei oder mehr Tutorien keine Registrierungs-Gruppe gesetzt zählen diese als in verschiedenen Registrierungs-Gruppen
@@ -1303,6 +1305,9 @@ TutorialRoomPlaceholder: Raum
TutorialTutors: Tutoren
TutorialTutorAlreadyAdded: Ein Tutor mit dieser E-Mail ist bereits für dieses Tutorium eingetragen
+OccurrenceNoneScheduled: (Noch) keine planmäßigen Termine
+OccurrenceNoneExceptions: (Noch) keine Termin-Ausnahmen
+
TutorialNew: Neues Tutorium
TutorialNameTaken tutn@TutorialName: Es existiert bereits anderes Tutorium mit Namen #{tutn}
diff --git a/models/tutorials.model b/models/tutorials.model
index 4c5874344..6650f24ef 100644
--- a/models/tutorials.model
+++ b/models/tutorials.model
@@ -3,7 +3,7 @@ Tutorial json
course CourseId
type (CI Text) -- "Tutorium", "Zentralübung", ...
capacity Int Maybe -- limit for enrolment in this tutorial
- room Text
+ room Text Maybe
time Occurrences
regGroup (CI Text) Maybe -- each participant may register for one tutorial per regGroup
registerFrom UTCTime Maybe
diff --git a/src/Handler/Course/Show.hs b/src/Handler/Course/Show.hs
index a95223129..246ee7037 100644
--- a/src/Handler/Course/Show.hs
+++ b/src/Handler/Course/Show.hs
@@ -137,7 +137,7 @@ getCShowR tid ssh csh = do
^{nameEmailWidget' tutor}
|]
- , sortable (Just "room") (i18nCell MsgTutorialRoom) $ \DBRow{ dbrOutput = Entity _ Tutorial{..} } -> textCell tutorialRoom
+ , sortable (Just "room") (i18nCell MsgTutorialRoom) $ \DBRow{ dbrOutput = Entity _ Tutorial{..} } -> maybe mempty textCell tutorialRoom
, sortable Nothing (i18nCell MsgTutorialTime) $ \DBRow{ dbrOutput = Entity _ Tutorial{..} } -> occurrencesCell tutorialTime
, sortable (Just "register-from") (i18nCell MsgTutorialRegisterFrom) $ \DBRow{ dbrOutput = Entity _ Tutorial{..} } -> maybeDateTimeCell tutorialRegisterFrom
, sortable (Just "register-to") (i18nCell MsgTutorialRegisterTo) $ \DBRow{ dbrOutput = Entity _ Tutorial{..} } -> maybeDateTimeCell tutorialRegisterTo
diff --git a/src/Handler/Tutorial/Form.hs b/src/Handler/Tutorial/Form.hs
index 928df67d3..64e22e345 100644
--- a/src/Handler/Tutorial/Form.hs
+++ b/src/Handler/Tutorial/Form.hs
@@ -21,7 +21,7 @@ data TutorialForm = TutorialForm
, tfRegGroup :: Maybe (CI Text)
, tfTutorControlled :: Bool
, tfCapacity :: Maybe Int
- , tfRoom :: Text
+ , tfRoom :: Maybe Text
, tfTime :: Occurrences
, tfRegisterFrom :: Maybe UTCTime
, tfRegisterTo :: Maybe UTCTime
@@ -36,7 +36,7 @@ tutorialForm cid template html = do
uid <- liftHandler requireAuthId
let
- tutorForm = Set.fromList <$> massInputAccumA miAdd' miCell' (\p -> Just . SomeRoute $ cRoute :#: p) miLayout' ("tutors" :: Text) (fslI MsgTutorialTutors & setTooltip MsgMassInputTip) True (Set.toList . tfTutors <$> template)
+ tutorForm = Set.fromList <$> massInputAccumA miAdd' miCell' (\p -> Just . SomeRoute $ cRoute :#: p) miLayout' ("tutors" :: Text) (fslI MsgTutorialTutors & setTooltip MsgMassInputTip) False (Set.toList . tfTutors <$> template)
where
miAdd' :: (Text -> Text) -> FieldView UniWorX -> Form ([Either UserEmail UserId] -> FormResult [Either UserEmail UserId])
miAdd' nudge submitView csrf = do
@@ -66,11 +66,11 @@ tutorialForm cid template html = do
flip (renderAForm FormStandard) html $ TutorialForm
<$> areq (textField & cfStrip & cfCI) (fslpI MsgTutorialName (mr MsgTutorialName) & setTooltip MsgTutorialNameTip) (tfName <$> template)
- <*> areq (textField & cfStrip & cfCI & addDatalist tutTypeDatalist) (fslpI MsgTutorialType $ mr MsgTutorialType) (tfType <$> template)
+ <*> areq (textField & cfStrip & cfCI & addDatalist tutTypeDatalist) (fslpI MsgTutorialType (mr MsgTutorialTypePlaceholder) & setTooltip MsgTutorialTypeTip) (tfType <$> template)
<*> aopt (textField & cfStrip & cfCI) (fslI MsgTutorialRegGroup & setTooltip MsgTutorialRegGroupTip) ((tfRegGroup <$> template) <|> Just (Just "tutorial"))
<*> apopt checkBoxField (fslI MsgTutorialTutorControlled & setTooltip MsgTutorialTutorControlledTip) (tfTutorControlled <$> template)
<*> aopt (natFieldI MsgTutorialCapacityNonPositive) (fslpI MsgTutorialCapacity (mr MsgTutorialCapacity) & setTooltip MsgTutorialCapacityTip) (tfCapacity <$> template)
- <*> areq textField (fslpI MsgTutorialRoom $ mr MsgTutorialRoomPlaceholder) (tfRoom <$> template)
+ <*> (assertM (not . null) <$> aopt (textField & cfStrip) (fslpI MsgTutorialRoom $ mr MsgTutorialRoomPlaceholder) (tfRoom <$> template))
<*> occurrencesAForm ("occurrences" :: Text) (tfTime <$> template)
<*> aopt utcTimeField (fslpI MsgRegisterFrom (mr MsgDate)
& setTooltip MsgCourseRegisterFromTip
diff --git a/src/Handler/Tutorial/List.hs b/src/Handler/Tutorial/List.hs
index ee6756113..11d05bc00 100644
--- a/src/Handler/Tutorial/List.hs
+++ b/src/Handler/Tutorial/List.hs
@@ -45,7 +45,7 @@ getCTutorialListR tid ssh csh = do
|]
, sortable (Just "participants") (i18nCell MsgTutorialParticipants) $ \DBRow{ dbrOutput = (Entity _ Tutorial{..}, n) } -> anchorCell (CTutorialR tid ssh csh tutorialName TUsersR) $ tshow n
, sortable (Just "capacity") (i18nCell MsgTutorialCapacity) $ \DBRow{ dbrOutput = (Entity _ Tutorial{..}, _) } -> maybe mempty (textCell . tshow) tutorialCapacity
- , sortable (Just "room") (i18nCell MsgTutorialRoom) $ \DBRow{ dbrOutput = (Entity _ Tutorial{..}, _) } -> textCell tutorialRoom
+ , sortable (Just "room") (i18nCell MsgTutorialRoom) $ \DBRow{ dbrOutput = (Entity _ Tutorial{..}, _) } -> maybe mempty textCell tutorialRoom
, sortable Nothing (i18nCell MsgTutorialTime) $ \DBRow{ dbrOutput = (Entity _ Tutorial{..}, _) } -> occurrencesCell tutorialTime
, sortable (Just "register-group") (i18nCell MsgTutorialRegGroup) $ \DBRow{ dbrOutput = (Entity _ Tutorial{..}, _) } -> maybe mempty (textCell . CI.original) tutorialRegGroup
, sortable (Just "register-from") (i18nCell MsgTutorialRegisterFrom) $ \DBRow{ dbrOutput = (Entity _ Tutorial{..}, _) } -> maybeDateTimeCell tutorialRegisterFrom
diff --git a/templates/widgets/occurrence/cell.hamlet b/templates/widgets/occurrence/cell.hamlet
index 5e7957f20..07cace676 100644
--- a/templates/widgets/occurrence/cell.hamlet
+++ b/templates/widgets/occurrence/cell.hamlet
@@ -12,5 +12,5 @@ $if not (null occurrencesExceptions)
$forall exc <- occurrencesExceptions'
^{exc}
-$if null occurrencesScheduled && null occurrencesExceptions
- _{MsgOccurrenceNever}
+$# $if null occurrencesScheduled && null occurrencesExceptions
+$# _{MsgOccurrenceNever}
diff --git a/templates/widgets/occurrence/form/except-add.hamlet b/templates/widgets/occurrence/form/except-add.hamlet
index bcb16ecfa..9ceedea5e 100644
--- a/templates/widgets/occurrence/form/except-add.hamlet
+++ b/templates/widgets/occurrence/form/except-add.hamlet
@@ -1,5 +1,5 @@
$newline never
^{addWidget}
- |
+ |
^{fvInput submitView}
diff --git a/templates/widgets/occurrence/form/except-layout.hamlet b/templates/widgets/occurrence/form/except-layout.hamlet
index 65352dd95..357374a9f 100644
--- a/templates/widgets/occurrence/form/except-layout.hamlet
+++ b/templates/widgets/occurrence/form/except-layout.hamlet
@@ -6,6 +6,12 @@ $newline never
^{cellWdgts ! coord}
|
^{fvInput (delButtons ! coord)}
+ $if null (review liveCoords lLength)
+ |
+ |
+ _{MsgOccurrenceNoneExceptions}
+ |
+
^{addWdgts ! (0, 0)}
diff --git a/templates/widgets/occurrence/form/scheduled-add.hamlet b/templates/widgets/occurrence/form/scheduled-add.hamlet
index bcb16ecfa..9ceedea5e 100644
--- a/templates/widgets/occurrence/form/scheduled-add.hamlet
+++ b/templates/widgets/occurrence/form/scheduled-add.hamlet
@@ -1,5 +1,5 @@
$newline never
|
^{addWidget}
- |
+ |
^{fvInput submitView}
diff --git a/templates/widgets/occurrence/form/scheduled-layout.hamlet b/templates/widgets/occurrence/form/scheduled-layout.hamlet
index 65352dd95..53d6c7f3b 100644
--- a/templates/widgets/occurrence/form/scheduled-layout.hamlet
+++ b/templates/widgets/occurrence/form/scheduled-layout.hamlet
@@ -6,6 +6,12 @@ $newline never
^{cellWdgts ! coord}
|
^{fvInput (delButtons ! coord)}
+ $if null (review liveCoords lLength)
+ |
+ |
+ _{MsgOccurrenceNoneScheduled}
+ |
+
|
^{addWdgts ! (0, 0)}
|