From 0e8ed257f873f6c5776c26f8a9f9b7d388861b32 Mon Sep 17 00:00:00 2001 From: SJost Date: Thu, 26 Apr 2018 09:59:47 +0200 Subject: [PATCH] PageAction: newSubmission working --- src/CryptoID.hs | 3 +++ src/Handler/Sheet.hs | 2 +- src/Handler/Submission.hs | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/CryptoID.hs b/src/CryptoID.hs index c66005307..3720c461b 100644 --- a/src/CryptoID.hs +++ b/src/CryptoID.hs @@ -48,6 +48,9 @@ decCryptoIDs [ ''SubmissionId newtype SubmissionMode = SubmissionMode (Maybe CryptoUUIDSubmission) deriving (Show, Read, Eq) +newSubmission :: SubmissionMode +newSubmission = SubmissionMode Nothing + instance PathPiece SubmissionMode where fromPathPiece "new" = Just $ SubmissionMode Nothing fromPathPiece s = SubmissionMode . Just <$> fromPathPiece s diff --git a/src/Handler/Sheet.hs b/src/Handler/Sheet.hs index d39e44dca..455662401 100644 --- a/src/Handler/Sheet.hs +++ b/src/Handler/Sheet.hs @@ -200,7 +200,7 @@ getSheetShowR tid csh shn = do [ PageActionPrime $ MenuItem { menuItemLabel = "Abgabe" , menuItemIcon = Nothing - , menuItemRoute = CSheetR tid csh SheetNewR + , menuItemRoute = CSheetR tid csh (SubmissionR shn newSubmission) , menuItemAccessCallback' = return True } ] diff --git a/src/Handler/Submission.hs b/src/Handler/Submission.hs index 68c908895..ac25a999f 100644 --- a/src/Handler/Submission.hs +++ b/src/Handler/Submission.hs @@ -213,13 +213,13 @@ postSubmissionR tid csh shn (SubmissionMode mcid) = do

Archiv + $forall (name,time) <- lastEdits +
last edited by #{name} at #{formatTimeGerWDT time} $maybe cid <- mcid

Enthaltene Dateien: $forall (Entity _ File{..}) <- oldfiles #{fileTitle} - $forall (name,time) <- lastEdits -
last edited by #{name} at #{formatTimeGerWDT time} |]