From 7cb64b765aebc5aa906a031608e39d4af54ad2f9 Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Mon, 19 Feb 2018 17:28:28 +0100 Subject: [PATCH] introduced menu-widget --- src/Foundation.hs | 5 ++++- src/Handler/Utils/Templates.hs | 4 ++-- templates/default-layout.hamlet | 13 +------------ templates/main-menu.hamlet | 8 +++++++- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/Foundation.hs b/src/Foundation.hs index 66377a386..5de195390 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -312,8 +312,11 @@ defaultMenuLayout menu widget = do addStylesheet $ StaticR css_bootstrap_css $(widgetFile "default-layout") withUrlRenderer $(hamletFile "templates/default-layout-wrapper.hamlet") + where + mainMenu :: [MenuTypes] -> Maybe (Route UniWorX) -> Widget + mainMenu menuTypes mcurrentRoute = $(widgetFile "main-menu") + - -- How to run database actions. instance YesodPersist UniWorX where type YesodPersistBackend UniWorX = SqlBackend diff --git a/src/Handler/Utils/Templates.hs b/src/Handler/Utils/Templates.hs index 38c7feb18..fb2ad41f4 100644 --- a/src/Handler/Utils/Templates.hs +++ b/src/Handler/Utils/Templates.hs @@ -4,5 +4,5 @@ module Handler.Utils.Templates where import Import.NoFoundation -mainMenu :: WidgetT site IO () -mainMenu = $(widgetFile "main-menu") +-- list :: WidgetT site IO () +-- list = $(widgetFile "list") -- assumes /templates/list.hamlet diff --git a/templates/default-layout.hamlet b/templates/default-layout.hamlet index 507e8409f..270849086 100644 --- a/templates/default-layout.hamlet +++ b/templates/default-layout.hamlet @@ -10,18 +10,7 @@
- ^{mainMenu} - -