summaryrefslogtreecommitdiff
path: root/Utility
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-10-28 12:39:22 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-10-28 12:39:22 -0400
commit7d2548531ce895d909081b2eb3e594ebf4348ba7 (patch)
tree79f62ce9989b93ebe0b1a62d4fc4ea0d52a92e87 /Utility
parentc8995036901c95f6627a31de4f3ab280f2dc5ef3 (diff)
parenta2053c437fd872705c3c14ac2bf034f025e7ee88 (diff)
Merge branch 'master' into s3-aws
Diffstat (limited to 'Utility')
-rw-r--r--Utility/Yesod.hs22
1 files changed, 17 insertions, 5 deletions
diff --git a/Utility/Yesod.hs b/Utility/Yesod.hs
index afe10a111..ecd4eaf94 100644
--- a/Utility/Yesod.hs
+++ b/Utility/Yesod.hs
@@ -1,9 +1,9 @@
{- Yesod stuff, that's typically found in the scaffolded site.
-
- Also a bit of a compatability layer to make it easier to support yesod
- - 1.1 and 1.2 in the same code base.
+ - 1.1-1.4 in the same code base.
-
- - Copyright 2012, 2013 Joey Hess <joey@kitenet.net>
+ - Copyright 2012-2014 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
@@ -17,8 +17,10 @@ module Utility.Yesod
, widgetFile
, hamletTemplate
#endif
+#if ! MIN_VERSION_yesod(1,4,0)
+ , withUrlRenderer
+#endif
#if ! MIN_VERSION_yesod(1,2,0)
- , giveUrlRenderer
, Html
#endif
) where
@@ -41,6 +43,11 @@ import Data.Default (def)
import Text.Hamlet hiding (Html)
#endif
#endif
+#if ! MIN_VERSION_yesod(1,4,0)
+#if MIN_VERSION_yesod(1,2,0)
+import Data.Text (Text)
+#endif
+#endif
#ifndef __NO_TH__
widgetFile :: String -> Q Exp
@@ -69,8 +76,13 @@ liftH = lift
{- Misc new names for stuff. -}
#if ! MIN_VERSION_yesod(1,2,0)
-giveUrlRenderer :: forall master sub. HtmlUrl (Route master) -> GHandler sub master RepHtml
-giveUrlRenderer = hamletToRepHtml
+withUrlRenderer :: forall master sub. HtmlUrl (Route master) -> GHandler sub master RepHtml
+withUrlRenderer = hamletToRepHtml
type Html = RepHtml
+#else
+#if ! MIN_VERSION_yesod_core(1,2,20)
+withUrlRenderer :: MonadHandler m => ((Route (HandlerSite m) -> [(Text, Text)] -> Text) -> output) -> m output
+withUrlRenderer = giveUrlRenderer
+#endif
#endif