feat(homepage): add prime action new course to homepage
This commit is contained in:
parent
b75aed5dda
commit
2208368596
@ -834,7 +834,7 @@ tagAccessPredicate AuthAllocationTime = APDB $ \mAuthId route _ -> case route of
|
|||||||
|| NTop allocationRegisterByStaffFrom >= NTop (Just now)
|
|| NTop allocationRegisterByStaffFrom >= NTop (Just now)
|
||||||
-> unauthorizedI MsgUnauthorizedAllocatedCourseDelete
|
-> unauthorizedI MsgUnauthorizedAllocatedCourseDelete
|
||||||
_other -> return Authorized
|
_other -> return Authorized
|
||||||
|
|
||||||
r -> $unsupportedAuthPredicate AuthAllocationTime r
|
r -> $unsupportedAuthPredicate AuthAllocationTime r
|
||||||
where
|
where
|
||||||
mbAllocation tid ssh csh = $cachedHereBinary (tid, ssh, csh) . runMaybeT $ do
|
mbAllocation tid ssh csh = $cachedHereBinary (tid, ssh, csh) . runMaybeT $ do
|
||||||
@ -1805,6 +1805,14 @@ pageActions (HomeR) =
|
|||||||
, menuItemModal = False
|
, menuItemModal = False
|
||||||
, menuItemAccessCallback' = return True
|
, menuItemAccessCallback' = return True
|
||||||
}
|
}
|
||||||
|
, MenuItem
|
||||||
|
{ menuItemType = PageActionPrime
|
||||||
|
, menuItemLabel = MsgMenuCourseNew
|
||||||
|
, menuItemIcon = Just "book"
|
||||||
|
, menuItemRoute = SomeRoute CourseNewR
|
||||||
|
, menuItemModal = False
|
||||||
|
, menuItemAccessCallback' = return True
|
||||||
|
}
|
||||||
, MenuItem
|
, MenuItem
|
||||||
{ menuItemType = PageActionPrime
|
{ menuItemType = PageActionPrime
|
||||||
, menuItemLabel = MsgAdminHeading
|
, menuItemLabel = MsgAdminHeading
|
||||||
@ -2968,7 +2976,7 @@ instance YesodAuth UniWorX where
|
|||||||
acceptExisting
|
acceptExisting
|
||||||
| otherwise
|
| otherwise
|
||||||
= return res
|
= return res
|
||||||
|
|
||||||
excHandlers =
|
excHandlers =
|
||||||
[ C.Handler $ \case
|
[ C.Handler $ \case
|
||||||
CampusUserNoResult -> do
|
CampusUserNoResult -> do
|
||||||
|
|||||||
Reference in New Issue
Block a user