Support for partial templates
This commit is contained in:
parent
a2739df985
commit
a94a8e3f81
@ -52,6 +52,8 @@ import qualified Data.UUID.Cryptographic as UUID
|
||||
import qualified System.FilePath.Cryptographic as FilePath
|
||||
import System.FilePath
|
||||
|
||||
import Handler.Utils.Templates
|
||||
|
||||
-- | The foundation datatype for your application. This can be a good place to
|
||||
-- keep settings and values requiring initialization before your application
|
||||
-- starts running, such as database connections. Every handler will have
|
||||
|
||||
@ -16,6 +16,7 @@ import Handler.Utils.Table as Handler.Utils
|
||||
import Handler.Utils.Zip as Handler.Utils
|
||||
import Handler.Utils.Rating as Handler.Utils
|
||||
import Handler.Utils.Submission as Handler.Utils
|
||||
import Handler.Utils.Templates as Handler.Utils
|
||||
|
||||
import Text.Blaze (Markup)
|
||||
|
||||
|
||||
8
src/Handler/Utils/Templates.hs
Normal file
8
src/Handler/Utils/Templates.hs
Normal file
@ -0,0 +1,8 @@
|
||||
{-# LANGUAGE NoImplicitPrelude, TemplateHaskell #-}
|
||||
|
||||
module Handler.Utils.Templates where
|
||||
|
||||
import Import.NoFoundation
|
||||
|
||||
mainMenu :: WidgetT site IO ()
|
||||
mainMenu = $(widgetFile "main-menu")
|
||||
@ -10,6 +10,8 @@
|
||||
<span class="icon-bar"></span>
|
||||
|
||||
<div #navbar .collapse.navbar-collapse>
|
||||
^{mainMenu}
|
||||
|
||||
<ul .nav.navbar-nav>
|
||||
$forall menuType <- menuTypes
|
||||
$case menuType
|
||||
|
||||
1
templates/main-menu.hamlet
Normal file
1
templates/main-menu.hamlet
Normal file
@ -0,0 +1 @@
|
||||
This is a Menu.
|
||||
Loading…
Reference in New Issue
Block a user