diff --git a/messages/uniworx/de.msg b/messages/uniworx/de.msg index c7c7f8574..be30c01cf 100644 --- a/messages/uniworx/de.msg +++ b/messages/uniworx/de.msg @@ -70,7 +70,7 @@ CourseSemester: Semester CourseSchool: Institut CourseSchoolShort: Fach CourseSecretTip: Anmeldung zum Kurs erfordert Eingabe des Passworts, sofern gesetzt -CourseRegisterFromTip: Ohne Datum ist keine eigenständige Anmeldung von Studierenden möglich +CourseRegisterFromTip: Ohne Datum ist KEINE eigenständige Anmeldung von Studierenden möglich CourseRegisterToTip: Anmeldung darf auch ohne Begrenzung möglich sein CourseDeregisterUntilTip: Abmeldung darf auch ohne Begrenzung möglich sein CourseFilterSearch: Volltext-Suche diff --git a/src/Foundation.hs b/src/Foundation.hs index 6f69c53b6..d92ec352a 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -479,20 +479,21 @@ tagAccessPredicate AuthTime = APDB $ \route _ -> case route of return Authorized CourseR tid ssh csh CRegisterR -> do + now <- liftIO getCurrentTime mbc <- getBy $ TermSchoolCourseShort tid ssh csh mAid <- lift maybeAuthId registered <- case (mbc,mAid) of (Just (Entity cid _), Just uid) -> isJust <$> (getBy $ UniqueParticipant uid cid) _ -> return False - cTime <- (NTop . Just) <$> liftIO getCurrentTime case mbc of (Just (Entity _ Course{courseRegisterFrom, courseRegisterTo})) | not registered - , courseRegisterFrom <= nBot cTime - , NTop courseRegisterTo >= cTime -> return Authorized + , Just regFrom <- courseRegisterFrom -- Nothing = no registration + , regFrom <= now + , maybe True (now <=) courseRegisterTo -> return Authorized (Just (Entity _ Course{courseDeregisterUntil})) | registered - , NTop courseDeregisterUntil >= cTime -> return Authorized + , maybe True (now <=) courseDeregisterUntil -> return Authorized _other -> unauthorizedI MsgUnauthorizedCourseTime MessageR cID -> maybeT (unauthorizedI MsgUnauthorizedSystemMessageTime) $ do @@ -1474,7 +1475,7 @@ pageActions (CSubmissionR tid ssh csh shn cid SubShowR) = , MenuItem { menuItemType = PageActionSecondary , menuItemLabel = MsgMenuSubmissionDelete - , menuItemIcon = Nothing + , menuItemIcon = Just "trash" , menuItemRoute = SomeRoute $ CSubmissionR tid ssh csh shn cid SubDelR , menuItemModal = False , menuItemAccessCallback' = return True