From 7bc954b779a9bc4e1c5e60f2648101c62ed22e72 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 14 Mar 2017 18:33:42 +0100 Subject: Reference & list --- Foundation.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Foundation.hs') diff --git a/Foundation.hs b/Foundation.hs index d192c08..d7425d5 100644 --- a/Foundation.hs +++ b/Foundation.hs @@ -78,6 +78,13 @@ instance Yesod App where -- Define the menu items of the header. let menuItems = [ MenuItem "Inventory" InventoryListingR + , MenuItem "Reference" ReferenceListingR + , MenuItem "List" ListR + ] + currentMenu = listToMaybe + [ menuItemLabel + | MenuItem{..} <- menuItems + , Just menuItemRoute == mCurrentRoute ] -- We break up the default layout into two components: @@ -87,6 +94,10 @@ instance Yesod App where -- you to use normal widget features in default-layout. pc <- widgetToPageContent $ do + setTitle . toHtml . maybe "Bar Inventory" ("Bar Inventory – " <>) $ do + cM <- currentMenu + guard $ cM /= "Inventory" + return cM addScript $ StaticR jquery_js addScript $ StaticR webshim_polyfiller_js $(widgetFile "default-layout") -- cgit v1.2.3