From 22083685961ca0503cce168c97bba73beaec2ea7 Mon Sep 17 00:00:00 2001 From: Steffen Jost Date: Tue, 6 Aug 2019 18:00:27 +0200 Subject: [PATCH] feat(homepage): add prime action new course to homepage --- src/Foundation.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Foundation.hs b/src/Foundation.hs index c6f4da349..8070aa3d0 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -834,7 +834,7 @@ tagAccessPredicate AuthAllocationTime = APDB $ \mAuthId route _ -> case route of || NTop allocationRegisterByStaffFrom >= NTop (Just now) -> unauthorizedI MsgUnauthorizedAllocatedCourseDelete _other -> return Authorized - + r -> $unsupportedAuthPredicate AuthAllocationTime r where mbAllocation tid ssh csh = $cachedHereBinary (tid, ssh, csh) . runMaybeT $ do @@ -1805,6 +1805,14 @@ pageActions (HomeR) = , menuItemModal = False , menuItemAccessCallback' = return True } + , MenuItem + { menuItemType = PageActionPrime + , menuItemLabel = MsgMenuCourseNew + , menuItemIcon = Just "book" + , menuItemRoute = SomeRoute CourseNewR + , menuItemModal = False + , menuItemAccessCallback' = return True + } , MenuItem { menuItemType = PageActionPrime , menuItemLabel = MsgAdminHeading @@ -2968,7 +2976,7 @@ instance YesodAuth UniWorX where acceptExisting | otherwise = return res - + excHandlers = [ C.Handler $ \case CampusUserNoResult -> do