Merge branch 'master' of gitlab.cip.ifi.lmu.de:jost/UniWorX
This commit is contained in:
commit
0a6ff1a966
@ -70,7 +70,7 @@ CourseSemester: Semester
|
|||||||
CourseSchool: Institut
|
CourseSchool: Institut
|
||||||
CourseSchoolShort: Fach
|
CourseSchoolShort: Fach
|
||||||
CourseSecretTip: Anmeldung zum Kurs erfordert Eingabe des Passworts, sofern gesetzt
|
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
|
CourseRegisterToTip: Anmeldung darf auch ohne Begrenzung möglich sein
|
||||||
CourseDeregisterUntilTip: Abmeldung darf auch ohne Begrenzung möglich sein
|
CourseDeregisterUntilTip: Abmeldung darf auch ohne Begrenzung möglich sein
|
||||||
CourseFilterSearch: Volltext-Suche
|
CourseFilterSearch: Volltext-Suche
|
||||||
|
|||||||
@ -479,20 +479,21 @@ tagAccessPredicate AuthTime = APDB $ \route _ -> case route of
|
|||||||
return Authorized
|
return Authorized
|
||||||
|
|
||||||
CourseR tid ssh csh CRegisterR -> do
|
CourseR tid ssh csh CRegisterR -> do
|
||||||
|
now <- liftIO getCurrentTime
|
||||||
mbc <- getBy $ TermSchoolCourseShort tid ssh csh
|
mbc <- getBy $ TermSchoolCourseShort tid ssh csh
|
||||||
mAid <- lift maybeAuthId
|
mAid <- lift maybeAuthId
|
||||||
registered <- case (mbc,mAid) of
|
registered <- case (mbc,mAid) of
|
||||||
(Just (Entity cid _), Just uid) -> isJust <$> (getBy $ UniqueParticipant uid cid)
|
(Just (Entity cid _), Just uid) -> isJust <$> (getBy $ UniqueParticipant uid cid)
|
||||||
_ -> return False
|
_ -> return False
|
||||||
cTime <- (NTop . Just) <$> liftIO getCurrentTime
|
|
||||||
case mbc of
|
case mbc of
|
||||||
(Just (Entity _ Course{courseRegisterFrom, courseRegisterTo}))
|
(Just (Entity _ Course{courseRegisterFrom, courseRegisterTo}))
|
||||||
| not registered
|
| not registered
|
||||||
, courseRegisterFrom <= nBot cTime
|
, Just regFrom <- courseRegisterFrom -- Nothing = no registration
|
||||||
, NTop courseRegisterTo >= cTime -> return Authorized
|
, regFrom <= now
|
||||||
|
, maybe True (now <=) courseRegisterTo -> return Authorized
|
||||||
(Just (Entity _ Course{courseDeregisterUntil}))
|
(Just (Entity _ Course{courseDeregisterUntil}))
|
||||||
| registered
|
| registered
|
||||||
, NTop courseDeregisterUntil >= cTime -> return Authorized
|
, maybe True (now <=) courseDeregisterUntil -> return Authorized
|
||||||
_other -> unauthorizedI MsgUnauthorizedCourseTime
|
_other -> unauthorizedI MsgUnauthorizedCourseTime
|
||||||
|
|
||||||
MessageR cID -> maybeT (unauthorizedI MsgUnauthorizedSystemMessageTime) $ do
|
MessageR cID -> maybeT (unauthorizedI MsgUnauthorizedSystemMessageTime) $ do
|
||||||
@ -1474,7 +1475,7 @@ pageActions (CSubmissionR tid ssh csh shn cid SubShowR) =
|
|||||||
, MenuItem
|
, MenuItem
|
||||||
{ menuItemType = PageActionSecondary
|
{ menuItemType = PageActionSecondary
|
||||||
, menuItemLabel = MsgMenuSubmissionDelete
|
, menuItemLabel = MsgMenuSubmissionDelete
|
||||||
, menuItemIcon = Nothing
|
, menuItemIcon = Just "trash"
|
||||||
, menuItemRoute = SomeRoute $ CSubmissionR tid ssh csh shn cid SubDelR
|
, menuItemRoute = SomeRoute $ CSubmissionR tid ssh csh shn cid SubDelR
|
||||||
, menuItemModal = False
|
, menuItemModal = False
|
||||||
, menuItemAccessCallback' = return True
|
, menuItemAccessCallback' = return True
|
||||||
|
|||||||
Reference in New Issue
Block a user