Support for partial templates

This commit is contained in:
Gregor Kleen 2018-02-19 16:08:50 +01:00
parent a2739df985
commit a94a8e3f81
5 changed files with 14 additions and 0 deletions

View File

@ -52,6 +52,8 @@ import qualified Data.UUID.Cryptographic as UUID
import qualified System.FilePath.Cryptographic as FilePath import qualified System.FilePath.Cryptographic as FilePath
import System.FilePath import System.FilePath
import Handler.Utils.Templates
-- | The foundation datatype for your application. This can be a good place to -- | The foundation datatype for your application. This can be a good place to
-- keep settings and values requiring initialization before your application -- keep settings and values requiring initialization before your application
-- starts running, such as database connections. Every handler will have -- starts running, such as database connections. Every handler will have

View File

@ -16,6 +16,7 @@ import Handler.Utils.Table as Handler.Utils
import Handler.Utils.Zip as Handler.Utils import Handler.Utils.Zip as Handler.Utils
import Handler.Utils.Rating as Handler.Utils import Handler.Utils.Rating as Handler.Utils
import Handler.Utils.Submission as Handler.Utils import Handler.Utils.Submission as Handler.Utils
import Handler.Utils.Templates as Handler.Utils
import Text.Blaze (Markup) import Text.Blaze (Markup)

View File

@ -0,0 +1,8 @@
{-# LANGUAGE NoImplicitPrelude, TemplateHaskell #-}
module Handler.Utils.Templates where
import Import.NoFoundation
mainMenu :: WidgetT site IO ()
mainMenu = $(widgetFile "main-menu")

View File

@ -10,6 +10,8 @@
<span class="icon-bar"></span> <span class="icon-bar"></span>
<div #navbar .collapse.navbar-collapse> <div #navbar .collapse.navbar-collapse>
^{mainMenu}
<ul .nav.navbar-nav> <ul .nav.navbar-nav>
$forall menuType <- menuTypes $forall menuType <- menuTypes
$case menuType $case menuType

View File

@ -0,0 +1 @@
This is a Menu.