mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-03-16 09:56:44 +01:00
Add a .container over the widget in defaultLayout
This commit is contained in:
parent
fd89710c69
commit
450ec9562a
@ -83,18 +83,11 @@ deriving instance Show Progress
|
||||
|
||||
type Form x = Html -> MForm (HandlerT App IO) (FormResult x, Widget)
|
||||
|
||||
-- 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
|
||||
defaultLayoutNoContainer :: Widget -> Handler Html
|
||||
defaultLayoutNoContainer = defaultLayoutWithContainer False
|
||||
|
||||
-- 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 widget = do
|
||||
defaultLayoutWithContainer :: Bool -> Widget -> Handler Html
|
||||
defaultLayoutWithContainer insideContainer widget = do
|
||||
mmsg <- getMessage
|
||||
muser <- catch maybeAuth $ \e -> case e of
|
||||
Couldn'tGetSQLConnection -> return Nothing
|
||||
@ -124,6 +117,19 @@ instance Yesod App where
|
||||
|
||||
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
|
||||
-- a separate domain. Please see the staticRoot setting in Settings.hs
|
||||
urlRenderOverride y (StaticR s) =
|
||||
|
||||
@ -41,6 +41,10 @@ $case cur
|
||||
<p>Please login with an authorization method below:
|
||||
^{widget}
|
||||
$of _
|
||||
$if insideContainer
|
||||
<div .container>
|
||||
^{widget}
|
||||
$else
|
||||
^{widget}
|
||||
|
||||
<div .footer>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user