Korrektur Button is hidden if there is no such correction

This commit is contained in:
SJost 2018-07-03 14:05:21 +02:00
parent 1b88f41112
commit dddd262b6b
3 changed files with 12 additions and 9 deletions

View File

@ -26,11 +26,6 @@ stanzas:
- LDAPBN
- DETAILED_LOGGING
- LOG_ALL
- PGUSER
- PGPASS
- PGHOST
- PGPORT
- PGDATABASE
# Use the following to automatically copy your bundle upon creation via `yesod
# keter`. Uses `scp` internally, so you can set it to a remote destination
@ -42,4 +37,7 @@ copy-to-args: []
# If you would like to have Keter automatically create a PostgreSQL database
# and set appropriate environment variables for it to be discovered, uncomment
# the following line.
plugins: {}
plugins:
postgres:
- server: uniworxdb
port: 5432

View File

@ -294,7 +294,7 @@ knownTags = Map.fromList -- should not throw exceptions, i.e. no getBy404 or req
,("time", APDB $ \route _ -> case route of
CSheetR tid csh shn subRoute -> maybeT (unauthorizedI MsgUnauthorizedSheetTime) $ do
Entity cid _ <- MaybeT . getBy $ CourseTermShort tid csh
Entity sid Sheet{..} <- MaybeT . getBy $ CourseSheet cid shn
Entity _sid Sheet{..} <- MaybeT . getBy $ CourseSheet cid shn
cTime <- liftIO getCurrentTime
let started = sheetActiveFrom <= cTime || NTop sheetVisibleFrom <= (NTop $ Just cTime)
case subRoute of
@ -771,7 +771,12 @@ pageActions (CSubmissionR tid csh shn cid SubShowR) =
{ menuItemLabel = "Korrektur"
, menuItemIcon = Nothing
, menuItemRoute = CSubmissionR tid csh shn cid CorrectionR
, menuItemAccessCallback' = return True
, menuItemAccessCallback' = do
smid <- decrypt cid
sm <- runDB $ get smid
case sm of
(Just (Submission { submissionRatingTime=Just _})) -> return True
_ -> return False
}
]
pageActions TermShowR =

View File

@ -28,7 +28,7 @@
<p>
<h2>
Ismpressum
Impressum
<ul>
<li>