web: fix breakage with yesod < 1.6

[ci skip]
This commit is contained in:
Simon Michael 2018-04-02 16:30:43 +01:00
parent 7f1ab4485f
commit 98647ee6f2
2 changed files with 8 additions and 0 deletions

View File

@ -92,7 +92,11 @@ mkYesodData "App" $(parseRoutesFile "config/routes")
-- | A convenience alias.
type AppRoute = Route App
#if MIN_VERSION_yesod(1,6,0)
type Form x = Html -> MForm (HandlerFor App) (FormResult x, Widget)
#else
type Form x = Html -> MForm (HandlerT App IO) (FormResult x, Widget)
#endif
-- Please see the documentation for the Yesod typeclass. There are a number
-- of settings which can be configured by overriding methods here.

View File

@ -28,7 +28,11 @@ import Hledger.Web.WebOptions
-- Common page layout
-- | Standard hledger-web page layout.
#if MIN_VERSION_yesod(1,6,0)
hledgerLayout :: ViewData -> String -> HtmlUrl AppRoute -> HandlerFor App Html
#else
hledgerLayout :: ViewData -> String -> HtmlUrl AppRoute -> HandlerT App IO Html
#endif
hledgerLayout vd title content = do
defaultLayout $ do
setTitle $ toHtml $ title ++ " - hledger-web"