diff --git a/messages/uniworx/de.msg b/messages/uniworx/de.msg index 801076f6a..7f51fb19d 100644 --- a/messages/uniworx/de.msg +++ b/messages/uniworx/de.msg @@ -133,7 +133,7 @@ CourseLecturerAlreadyAdded email@UserEmail: Es gibt bereits einen Kursverwalter CourseRegistrationEndMustBeAfterStart: Ende des Anmeldezeitraums muss nach dem Anfang liegen CourseDeregistrationEndMustBeAfterStart: Ende des Abmeldezeitraums muss nach dem Anfang des Anmeldezeitraums liegen CourseUserMustBeLecturer: Aktueller Benutzer muss als Kursverwalter eingetragen sein -CourseLecturerRightsIdentical: Alle Sorten von Kursverwalter haben identische Rechte +CourseLecturerRightsIdentical: Alle Sorten von Kursverwalter haben identische Rechte. NoSuchTerm tid@TermId: Semester #{display tid} gibt es nicht. NoSuchSchool ssh@SchoolId: Institut #{display ssh} gibt es nicht. @@ -828,7 +828,7 @@ OccurenceEnd: Ende ScheduleExists: Dieser Plan existiert bereits ScheduleExceptions: Termin-Ausnahmen -ScheduleExceptionsTip: Ausfälle überschreiben planmäßiges Stattfinden. Außerplanmäßiges Stattfinden überschreibt Ausfall +ScheduleExceptionsTip: Ausfälle überschreiben planmäßiges Stattfinden. Außerplanmäßiges Stattfinden überschreibt Ausfall. ExceptionKind: Termin ... ExceptionKindOccur: Findet statt ExceptionKindNoOccur: Findet nicht statt @@ -872,4 +872,6 @@ TutorialNew: Neues Tutorium TutorialNameTaken tutn@TutorialName: Es existiert bereits anderes Tutorium mit Namen #{tutn} TutorialCreated tutn@TutorialName: Tutorium #{tutn} erfolgreich angelegt -TutorialEditHeading tutn@TutorialName: #{tutn} bearbeiten \ No newline at end of file +TutorialEditHeading tutn@TutorialName: #{tutn} bearbeiten + +MassInputTip: Es können mehrere Werte angegeben werden. Werte müssen mit + zur Liste hinzugefügt werden und können mit - wieder entfernt werden. Die Liste wird zunächst nur lokal in Ihrem Browser gespeichert und muss noch zusammen mit dem Rest des Formulars Gesendet werden. \ No newline at end of file diff --git a/models/tutorials b/models/tutorials index 1f47400bf..78571389c 100644 --- a/models/tutorials +++ b/models/tutorials @@ -9,6 +9,7 @@ Tutorial json registerFrom UTCTime Maybe registerTo UTCTime Maybe deregisterUntil UTCTime Maybe + lastChanged UTCTime default='NOW()' UniqueTutorial course name Tutor tutorial TutorialId diff --git a/src/Handler/Course.hs b/src/Handler/Course.hs index 5d52bf869..eb29d534a 100644 --- a/src/Handler/Course.hs +++ b/src/Handler/Course.hs @@ -739,7 +739,7 @@ makeCourseForm miButtonAction template = identifyForm FIDcourse $ \html -> do lecturerForm :: AForm Handler [Either (UserEmail, Maybe LecturerType) (UserId, LecturerType)] lecturerForm = formToAForm . over (mapped._2) pure . over (mapped._1.mapped) (map liftEither . Map.elems) $ massInput MassInput{..} - (fslI MsgCourseLecturers & setTooltip MsgCourseLecturerRightsIdentical) + (fslI MsgCourseLecturers & setTooltip (UniWorXMessages [SomeMessage MsgCourseLecturerRightsIdentical, SomeMessage MsgMassInputTip])) True (Just . Map.fromList . zip [0..] $ maybe [(Right uid, Just CourseLecturer)] (map unliftEither . cfLecturers) template) mempty diff --git a/src/Handler/Sheet.hs b/src/Handler/Sheet.hs index 5016f8662..8448a5203 100644 --- a/src/Handler/Sheet.hs +++ b/src/Handler/Sheet.hs @@ -753,7 +753,7 @@ correctorForm shid = wFormToAForm $ do postProcess' (Right sheetCorrectorUser, (sheetCorrectorState, sheetCorrectorLoad)) = Right SheetCorrector{..} postProcess' (Left sheetCorrectorInvitationEmail, (sheetCorrectorInvitationState, sheetCorrectorInvitationLoad)) = Left SheetCorrectorInvitation{..} - fmap postProcess <$> massInputW MassInput{..} (fslI MsgCorrectors) True (Just . Map.fromList . zip [0..] $ Map.toList loads) + fmap postProcess <$> massInputW MassInput{..} (fslI MsgCorrectors & setTooltip MsgMassInputTip) True (Just . Map.fromList . zip [0..] $ Map.toList loads) getSCorrR, postSCorrR :: TermId -> SchoolId -> CourseShorthand -> SheetName -> Handler Html postSCorrR = getSCorrR diff --git a/src/Handler/Term.hs b/src/Handler/Term.hs index 98085d947..ddb8abc51 100644 --- a/src/Handler/Term.hs +++ b/src/Handler/Term.hs @@ -255,7 +255,7 @@ newTermForm template html = do = aforced termNewField (fslpI MsgTerm (mr MsgTermPlaceholder)) tid | otherwise = areq termNewField (fslpI MsgTerm (mr MsgTermPlaceholder)) Nothing - holidayForm = formToAForm . over (mapped._2) pure $ massInputList dayField (const $ "" & addPlaceholder (mr MsgTermHolidayPlaceholder)) (const Nothing) (fslI MsgTermHolidays) True (tftHolidays template) mempty + holidayForm = formToAForm . over (mapped._2) pure $ massInputList dayField (const $ "" & addPlaceholder (mr MsgTermHolidayPlaceholder)) (const Nothing) (fslI MsgTermHolidays & setTooltip MsgMassInputTip) True (tftHolidays template) mempty (result, widget) <- flip (renderAForm FormStandard) html $ Term <$> tidForm <*> areq dayField (fslI MsgTermStartDay & setTooltip MsgTermStartDayTooltip) (tftStart template) diff --git a/src/Handler/Tutorial.hs b/src/Handler/Tutorial.hs index 1919e6a38..c8c5bd108 100644 --- a/src/Handler/Tutorial.hs +++ b/src/Handler/Tutorial.hs @@ -212,7 +212,7 @@ tutorialForm cid template html = do uid <- liftHandlerT requireAuthId let - tutorForm = Set.fromList <$> massInputAccumA miAdd' miCell' (\p -> Just . SomeRoute $ cRoute :#: p) miLayout' (fslI MsgTutorialTutors) True (Set.toList . tfTutors <$> template) + tutorForm = Set.fromList <$> massInputAccumA miAdd' miCell' (\p -> Just . SomeRoute $ cRoute :#: p) miLayout' (fslI MsgTutorialTutors & setTooltip MsgMassInputTip) True (Set.toList . tfTutors <$> template) where miAdd' :: (Text -> Text) -> FieldView UniWorX -> Form ([UserId] -> FormResult [UserId]) miAdd' nudge submitView csrf = do @@ -282,6 +282,7 @@ postCTutorialNewR tid ssh csh = do formResult newTutResult $ \TutorialForm{..} -> do insertRes <- runDB $ do + now <- liftIO getCurrentTime insertRes <- insertUnique Tutorial { tutorialName = tfName , tutorialCourse = cid @@ -293,6 +294,7 @@ postCTutorialNewR tid ssh csh = do , tutorialRegisterFrom = tfRegisterFrom , tutorialRegisterTo = tfRegisterTo , tutorialDeregisterUntil = tfDeregisterUntil + , tutorialLastChanged = now } forM_ tfTutors $ \tutor -> case insertRes of Just tutid -> void . insert $ Tutor tutid tutor @@ -346,6 +348,7 @@ postTEditR tid ssh csh tutn = do formResult newTutResult $ \TutorialForm{..} -> do insertRes <- runDB $ do + now <- liftIO getCurrentTime insertRes <- myReplaceUnique tutid Tutorial { tutorialName = tfName , tutorialCourse = cid @@ -357,6 +360,7 @@ postTEditR tid ssh csh tutn = do , tutorialRegisterFrom = tfRegisterFrom , tutorialRegisterTo = tfRegisterTo , tutorialDeregisterUntil = tfDeregisterUntil + , tutorialLastChanged = now } deleteWhere [ TutorTutorial ==. tutid ] forM_ tfTutors $ void . insert . Tutor tutid diff --git a/src/Handler/Utils/Form/Occurences.hs b/src/Handler/Utils/Form/Occurences.hs index 4445413c9..4c5905b6b 100644 --- a/src/Handler/Utils/Form/Occurences.hs +++ b/src/Handler/Utils/Form/Occurences.hs @@ -45,7 +45,7 @@ occurencesAForm mPrev = wFormToAForm $ do miCell' (\p -> Just . SomeRoute $ cRoute :#: p) miLayout' - (fslI MsgScheduleRegular) + (fslI MsgScheduleRegular & setTooltip MsgMassInputTip) False (Set.toList . occurencesScheduled <$> mPrev) where @@ -80,7 +80,7 @@ occurencesAForm mPrev = wFormToAForm $ do miCell' (\p -> Just . SomeRoute $ cRoute :#: p) miLayout' - (fslI MsgScheduleExceptions & setTooltip MsgScheduleExceptionsTip) + (fslI MsgScheduleExceptions & setTooltip (UniWorXMessages [SomeMessage MsgScheduleExceptionsTip, SomeMessage MsgMassInputTip])) False (Set.toList . occurencesExceptions <$> mPrev) where