From fcc2f68ceac3cb4df3990e141dd6c7173f873370 Mon Sep 17 00:00:00 2001 From: SJost Date: Fri, 4 May 2018 10:01:05 +0200 Subject: [PATCH] Merged new pageActions from master --- src/Foundation.hs | 13 +++++++++++-- src/Handler/Sheet.hs | 11 +---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Foundation.hs b/src/Foundation.hs index 8eaa95287..6173ab602 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -209,7 +209,7 @@ instance Yesod UniWorX where favourites <- forM favourites' $ \(Entity _ c@Course{..}) -> let - courseRoute = CourseR courseTermId courseShorthand CourseShowR + courseRoute = CourseR courseTerm courseShorthand CourseShowR in (c, courseRoute, ) <$> filterM (menuItemAccessCallback . menuItem) (pageActions courseRoute) -- We break up the default layout into two components: @@ -427,7 +427,7 @@ pageActions (CourseR tid csh CourseShowR) = , menuItemAccessCallback' = return True } ] -pageActions (CourseR tid csh (SheetR SheetListR)) = +pageActions (CSheetR tid csh SheetListR) = [ PageActionPrime $ MenuItem { menuItemLabel = "Neues Übungsblatt" , menuItemIcon = Nothing @@ -435,6 +435,14 @@ pageActions (CourseR tid csh (SheetR SheetListR)) = , menuItemAccessCallback' = return True } ] +pageActions (CSheetR tid csh (SheetShowR shn)) = + [ PageActionPrime $ MenuItem + { menuItemLabel = "Abgabe" + , menuItemIcon = Nothing + , menuItemRoute = CSheetR tid csh (SubmissionR shn newSubmission) + , menuItemAccessCallback' = return True + } + ] pageActions TermShowR = [ PageActionPrime $ MenuItem { menuItemLabel = "Neues Semester" @@ -451,6 +459,7 @@ pageActions (CourseListTermR _) = , menuItemAccessCallback' = return True } ] + pageActions _ = [] defaultLinks :: [MenuTypes] diff --git a/src/Handler/Sheet.hs b/src/Handler/Sheet.hs index ab32a7678..c7cc48ad4 100644 --- a/src/Handler/Sheet.hs +++ b/src/Handler/Sheet.hs @@ -187,16 +187,7 @@ getSheetShowR tid csh shn = do -- return desired columns return $ (file E.^. FileTitle, sheetFile E.^. SheetFileType) let fileLinks = map (\(E.Value fName, E.Value fType) -> CSheetR tid csh (SheetFileR shn fType fName)) fileNameTypes - - let pageActions = - [ PageActionPrime $ MenuItem - { menuItemLabel = "Abgabe" - , menuItemIcon = Nothing - , menuItemRoute = CSheetR tid csh (SubmissionR shn newSubmission) - , menuItemAccessCallback' = return True - } - ] - defaultLinkLayout pageActions $ do + defaultLayout $ do setTitle $ toHtml $ T.append "Übung " $ sheetName sheet $(widgetFile "sheetShow") [whamlet| Under Construction !!! |] -- TODO