Merged new pageActions from master

This commit is contained in:
SJost 2018-05-04 10:01:05 +02:00
parent afc022eee7
commit fcc2f68cea
2 changed files with 12 additions and 12 deletions

View File

@ -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]

View File

@ -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