diff --git a/src/Foundation.hs b/src/Foundation.hs index 96c620455..ba6cc663e 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -405,6 +405,14 @@ defaultMenuLayout menu widget = do modalId :: Int32 modalId = 13 $(widgetFile "widgets/modal") + 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 9476d7889..df90eecbe 100644 --- a/templates/default-layout.hamlet +++ b/templates/default-layout.hamlet @@ -15,5 +15,8 @@ $with status2 <- bool status "info" (status == "")