Add a .container over the widget in defaultLayout

This commit is contained in:
Dan Burton 2015-03-17 13:29:19 -07:00 committed by Chris Done
parent fd89710c69
commit 450ec9562a
2 changed files with 39 additions and 29 deletions

View File

@ -83,18 +83,11 @@ deriving instance Show Progress
type Form x = Html -> MForm (HandlerT App IO) (FormResult x, Widget) type Form x = Html -> MForm (HandlerT App IO) (FormResult x, Widget)
-- Please see the documentation for the Yesod typeclass. There are a number defaultLayoutNoContainer :: Widget -> Handler Html
-- of settings which can be configured by overriding methods here. defaultLayoutNoContainer = defaultLayoutWithContainer False
instance Yesod App where
approot = ApprootMaster $ appRoot . settings
-- Store session data on the client in encrypted cookies, defaultLayoutWithContainer :: Bool -> Widget -> Handler Html
-- default session idle timeout is 120 minutes defaultLayoutWithContainer insideContainer widget = do
makeSessionBackend _ = fmap Just $ defaultClientSessionBackend
(120 * 60) -- 120 minutes
"config/client_session_key.aes"
defaultLayout widget = do
mmsg <- getMessage mmsg <- getMessage
muser <- catch maybeAuth $ \e -> case e of muser <- catch maybeAuth $ \e -> case e of
Couldn'tGetSQLConnection -> return Nothing Couldn'tGetSQLConnection -> return Nothing
@ -124,6 +117,19 @@ instance Yesod App where
withUrlRenderer $(hamletFile "templates/default-layout-wrapper.hamlet") withUrlRenderer $(hamletFile "templates/default-layout-wrapper.hamlet")
-- Please see the documentation for the Yesod typeclass. There are a number
-- of settings which can be configured by overriding methods here.
instance Yesod App where
approot = ApprootMaster $ appRoot . settings
-- Store session data on the client in encrypted cookies,
-- default session idle timeout is 120 minutes
makeSessionBackend _ = fmap Just $ defaultClientSessionBackend
(120 * 60) -- 120 minutes
"config/client_session_key.aes"
defaultLayout = defaultLayoutWithContainer True
-- This is done to provide an optimization for serving static files from -- This is done to provide an optimization for serving static files from
-- a separate domain. Please see the staticRoot setting in Settings.hs -- a separate domain. Please see the staticRoot setting in Settings.hs
urlRenderOverride y (StaticR s) = urlRenderOverride y (StaticR s) =

View File

@ -41,6 +41,10 @@ $case cur
<p>Please login with an authorization method below: <p>Please login with an authorization method below:
^{widget} ^{widget}
$of _ $of _
$if insideContainer
<div .container>
^{widget}
$else
^{widget} ^{widget}
<div .footer> <div .footer>