diff --git a/src/Foundation.hs b/src/Foundation.hs index 50b84b6d8..f3ed446e6 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -399,6 +399,14 @@ defaultMenuLayout menu widget = do asidenav = $(widgetFile "widgets/asidenav") breadcrumbs :: Widget breadcrumbs = $(widgetFile "widgets/breadcrumbs") + pageactionprime :: Widget + pageactionprime = $(widgetFile "widgets/pageactionprime") + -- functions to determine if there are page-actions + isPageActionPrime :: MenuTypes -> Bool + isPageActionPrime (PageActionPrime _) = True + isPageActionPrime _ = False + hasPageActions :: Bool + hasPageActions = any isPageActionPrime menuTypes pc <- widgetToPageContent $ do addStylesheetRemote "https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,800,900" diff --git a/src/Handler/Course.hs b/src/Handler/Course.hs index 4a7a36623..88e2c6218 100644 --- a/src/Handler/Course.hs +++ b/src/Handler/Course.hs @@ -64,7 +64,7 @@ getCourseListTermR tidini = do ) ] let pageLinks = - [ NavbarAside $ MenuItem + [ PageActionPrime $ MenuItem { menuItemLabel = "Neuer Kurs" , menuItemIcon = Just "book" , menuItemRoute = CourseNewR diff --git a/src/Handler/Term.hs b/src/Handler/Term.hs index 7093e5ce8..f8155da8c 100644 --- a/src/Handler/Term.hs +++ b/src/Handler/Term.hs @@ -76,7 +76,7 @@ getTermShowR = do , dbtIdent = "terms" :: Text } let pageActions = - [ NavbarAside $ MenuItem + [ PageActionPrime $ MenuItem { menuItemLabel = "Neues Semester" , menuItemIcon = Nothing , menuItemRoute = TermEditR diff --git a/templates/default-layout.hamlet b/templates/default-layout.hamlet index 64ec8c8f1..b628912f0 100644 --- a/templates/default-layout.hamlet +++ b/templates/default-layout.hamlet @@ -13,5 +13,8 @@ $with status2 <- bool status "info" (status == "")