summaryrefslogtreecommitdiff
path: root/Foundation.hs
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2017-03-14 18:33:42 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2017-03-14 18:33:42 +0100
commit7bc954b779a9bc4e1c5e60f2648101c62ed22e72 (patch)
treeb30851324772c14550c0444b7e79e36256f67900 /Foundation.hs
parent53fcf55c02f9335518c28d26429913258fc28f87 (diff)
downloadbar-7bc954b779a9bc4e1c5e60f2648101c62ed22e72.tar
bar-7bc954b779a9bc4e1c5e60f2648101c62ed22e72.tar.gz
bar-7bc954b779a9bc4e1c5e60f2648101c62ed22e72.tar.bz2
bar-7bc954b779a9bc4e1c5e60f2648101c62ed22e72.tar.xz
bar-7bc954b779a9bc4e1c5e60f2648101c62ed22e72.zip
Reference & list
Diffstat (limited to 'Foundation.hs')
-rw-r--r--Foundation.hs11
1 files changed, 11 insertions, 0 deletions
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
78 -- Define the menu items of the header. 78 -- Define the menu items of the header.
79 let menuItems = 79 let menuItems =
80 [ MenuItem "Inventory" InventoryListingR 80 [ MenuItem "Inventory" InventoryListingR
81 , MenuItem "Reference" ReferenceListingR
82 , MenuItem "List" ListR
83 ]
84 currentMenu = listToMaybe
85 [ menuItemLabel
86 | MenuItem{..} <- menuItems
87 , Just menuItemRoute == mCurrentRoute
81 ] 88 ]
82 89
83 -- We break up the default layout into two components: 90 -- We break up the default layout into two components:
@@ -87,6 +94,10 @@ instance Yesod App where
87 -- you to use normal widget features in default-layout. 94 -- you to use normal widget features in default-layout.
88 95
89 pc <- widgetToPageContent $ do 96 pc <- widgetToPageContent $ do
97 setTitle . toHtml . maybe "Bar Inventory" ("Bar Inventory – " <>) $ do
98 cM <- currentMenu
99 guard $ cM /= "Inventory"
100 return cM
90 addScript $ StaticR jquery_js 101 addScript $ StaticR jquery_js
91 addScript $ StaticR webshim_polyfiller_js 102 addScript $ StaticR webshim_polyfiller_js
92 $(widgetFile "default-layout") 103 $(widgetFile "default-layout")