diff --git a/src/Foundation.hs b/src/Foundation.hs index 50b84b6d8..ba6cc663e 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -399,6 +399,20 @@ defaultMenuLayout menu widget = do asidenav = $(widgetFile "widgets/asidenav") breadcrumbs :: Widget breadcrumbs = $(widgetFile "widgets/breadcrumbs") + modal :: [Char] -> [Char] -> Widget + modal modalTrigger modalContent = do + let + 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..c12cc46af 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 @@ -93,7 +93,7 @@ getCourseShowR tid csh = do let course = entityVal courseEnt (regWidget, regEnctype) <- generateFormPost $ identifyForm "registerBtn" $ registerButton $ mbRegistered let pageActions = - [ NavbarAside $ MenuItem + [ PageActionPrime $ MenuItem { menuItemLabel = "Übungsblätter" , menuItemIcon = Nothing , menuItemRoute = CSheetR tid csh SheetListR 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-wrapper.hamlet b/templates/default-layout-wrapper.hamlet index a785cb89c..ef15995c0 100644 --- a/templates/default-layout-wrapper.hamlet +++ b/templates/default-layout-wrapper.hamlet @@ -38,7 +38,12 @@ $newline never \ }); } - + + + +