PageAction 'last breadcrumb' not needed as shown in PageActions for SCorrR linking to SEditR
This commit is contained in:
parent
f22a95d3be
commit
262a5dca2b
@ -161,7 +161,7 @@ data MenuTypes -- Semantische Rolle:
|
|||||||
| NavbarRight { menuItem :: MenuItem } -- Generell, nahezu immer sichtbar
|
| NavbarRight { menuItem :: MenuItem } -- Generell, nahezu immer sichtbar
|
||||||
| NavbarSecondary { menuItem :: MenuItem } -- Generell, nahezu immer sichtbar
|
| NavbarSecondary { menuItem :: MenuItem } -- Generell, nahezu immer sichtbar
|
||||||
| PageActionPrime { menuItem :: MenuItem } -- Seitenspezifische Aktion, häufig
|
| PageActionPrime { menuItem :: MenuItem } -- Seitenspezifische Aktion, häufig
|
||||||
| PageActionSecondary { menuItem :: MenuItem } -- Seitenspezifische Aktion, selten
|
| PageActionSecondary { menuItem :: MenuItem } -- Seitenspezifische Aktion, selten (nicht im MouseOver enthalten, immer hinten gelistet)
|
||||||
|
|
||||||
-- Messages
|
-- Messages
|
||||||
mkMessage "UniWorX" "messages/uniworx" "de"
|
mkMessage "UniWorX" "messages/uniworx" "de"
|
||||||
@ -529,9 +529,7 @@ instance Yesod UniWorX where
|
|||||||
-- let isParent :: Route UniWorX -> Bool
|
-- let isParent :: Route UniWorX -> Bool
|
||||||
-- isParent r = r == (fst parents)
|
-- isParent r = r == (fst parents)
|
||||||
|
|
||||||
|
let menu = defaultLinks ++ maybe [] pageActions mcurrentRoute
|
||||||
let
|
|
||||||
menu = defaultLinks ++ maybe [] pageActions mcurrentRoute
|
|
||||||
|
|
||||||
menuTypes <- filterM (menuItemAccessCallback . menuItem) menu
|
menuTypes <- filterM (menuItemAccessCallback . menuItem) menu
|
||||||
|
|
||||||
@ -581,10 +579,11 @@ instance Yesod UniWorX where
|
|||||||
breadcrumbs :: Widget
|
breadcrumbs :: Widget
|
||||||
breadcrumbs = $(widgetFile "widgets/breadcrumbs")
|
breadcrumbs = $(widgetFile "widgets/breadcrumbs")
|
||||||
pageactionprime :: Widget
|
pageactionprime :: Widget
|
||||||
pageactionprime = $(widgetFile "widgets/pageactionprime")
|
pageactionprime = $(widgetFile "widgets/pageactionprime") -- TODO: rename, since it also shows secondary pageActions now
|
||||||
-- functions to determine if there are page-actions
|
-- functions to determine if there are page-actions (primary or secondary)
|
||||||
isPageActionPrime :: MenuTypes -> Bool
|
isPageActionPrime :: MenuTypes -> Bool
|
||||||
isPageActionPrime (PageActionPrime _) = True
|
isPageActionPrime (PageActionPrime _) = True
|
||||||
|
isPageActionPrime (PageActionSecondary _) = True
|
||||||
isPageActionPrime _ = False
|
isPageActionPrime _ = False
|
||||||
hasPageActions :: Bool
|
hasPageActions :: Bool
|
||||||
hasPageActions = any isPageActionPrime menuTypes
|
hasPageActions = any isPageActionPrime menuTypes
|
||||||
@ -772,6 +771,7 @@ defaultLinks = -- Define the menu items of the header.
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
pageActions :: Route UniWorX -> [MenuTypes]
|
pageActions :: Route UniWorX -> [MenuTypes]
|
||||||
{-
|
{-
|
||||||
Icons: https://fontawesome.com/icons?d=gallery
|
Icons: https://fontawesome.com/icons?d=gallery
|
||||||
@ -940,6 +940,12 @@ pageActions (CSheetR tid ssh csh shn SCorrR) =
|
|||||||
, menuItemRoute = CSheetR tid ssh csh shn SSubsR
|
, menuItemRoute = CSheetR tid ssh csh shn SSubsR
|
||||||
, menuItemAccessCallback' = return True
|
, menuItemAccessCallback' = return True
|
||||||
}
|
}
|
||||||
|
, PageActionSecondary $ MenuItem
|
||||||
|
{ menuItemLabel = "Edit " <> (CI.original shn)
|
||||||
|
, menuItemIcon = Nothing
|
||||||
|
, menuItemRoute = CSheetR tid ssh csh shn SEditR
|
||||||
|
, menuItemAccessCallback' = return True
|
||||||
|
}
|
||||||
]
|
]
|
||||||
pageActions (CorrectionsR) =
|
pageActions (CorrectionsR) =
|
||||||
[ PageActionPrime $ MenuItem
|
[ PageActionPrime $ MenuItem
|
||||||
|
|||||||
@ -4,7 +4,13 @@ $if hasPageActions
|
|||||||
<ul .pagenav__list>
|
<ul .pagenav__list>
|
||||||
$forall menuType <- menuTypes
|
$forall menuType <- menuTypes
|
||||||
$case menuType
|
$case menuType
|
||||||
$of PageActionPrime (MenuItem label mIcon route _)
|
$of PageActionPrime (MenuItem label _mIcon route _callback)
|
||||||
|
<li .pagenav__list-item>
|
||||||
|
<a .pagenav__link-wrapper href=@{route}>#{label}
|
||||||
|
$of _
|
||||||
|
$forall menuType <- menuTypes
|
||||||
|
$case menuType
|
||||||
|
$of PageActionSecondary (MenuItem label _mIcon route _callback)
|
||||||
<li .pagenav__list-item>
|
<li .pagenav__list-item>
|
||||||
<a .pagenav__link-wrapper href=@{route}>#{label}
|
<a .pagenav__link-wrapper href=@{route}>#{label}
|
||||||
$of _
|
$of _
|
||||||
|
|||||||
Reference in New Issue
Block a user