diff options
Diffstat (limited to 'Foundation.hs')
-rw-r--r-- | Foundation.hs | 11 |
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") |