Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Upgrade to work with snap 0.12

  • Loading branch information...
commit 33801eec13c1eebf3073b8db125b07d7823ca30f 1 parent 1a0539c
@mightybyte mightybyte authored
View
2  snap-extras.cabal
@@ -52,7 +52,7 @@ Library
, directory-tree >= 0.10 && < 0.12
, errors >= 1.4 && < 1.5
, filepath
- , heist >= 0.11
+ , heist >= 0.12
, mtl >= 2.0 && < 2.2
, readable >= 0.1 && < 0.2
, safe
View
8 src/Snap/Extras.hs
@@ -11,6 +11,8 @@ module Snap.Extras
) where
-------------------------------------------------------------------------------
+import Data.Monoid
+import Heist
import Snap.Snaplet
import Snap.Snaplet.Heist
import Snap.Snaplet.Session
@@ -20,6 +22,7 @@ import Snap.Extras.CoreUtils
import Snap.Extras.FlashNotice
import Snap.Extras.FormUtils
import Snap.Extras.JSON
+import qualified Snap.Extras.SpliceUtils.Compiled as C
import qualified Snap.Extras.SpliceUtils.Interpreted as I
import Snap.Extras.Tabs
import Snap.Extras.TextUtils
@@ -43,5 +46,8 @@ initExtras heistSnaplet session =
addTemplatesAt heistSnaplet "" . (</> "resources/templates")
=<< getSnapletFilePath
initFlashNotice heistSnaplet session
- I.addUtilSplices
+ addConfig heistSnaplet $ mempty
+ { hcInterpretedSplices = I.utilSplices
+ , hcCompiledSplices = C.utilSplices
+ }
initTabs heistSnaplet
View
6 src/Snap/Extras/SpliceUtils/Compiled.hs
@@ -6,6 +6,7 @@ module Snap.Extras.SpliceUtils.Compiled where
import Blaze.ByteString.Builder.ByteString
import Control.Monad.Trans
import Data.Monoid
+import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import Snap.Core
@@ -16,6 +17,11 @@ import Text.XmlHtml
-------------------------------------------------------------------------------
+utilSplices :: MonadSnap m => [(Text, Splice m)]
+utilSplices = [ ("rqparam", paramSplice)
+ ]
+
+
------------------------------------------------------------------------------
-- | Gets the value of a request parameter. Example use:
--
View
7 src/Snap/Extras/SpliceUtils/Interpreted.hs
@@ -4,7 +4,6 @@
module Snap.Extras.SpliceUtils.Interpreted
( paramSplice
, utilSplices
- , addUtilSplices
, selectSplice
, runTextAreas
, scriptsSplice
@@ -29,12 +28,6 @@ import Text.XmlHtml
-------------------------------------------------------------------------------
--- | Bind splices offered in this module in your 'Initializer'
-addUtilSplices :: HasHeist b => Initializer b v ()
-addUtilSplices = addSplices utilSplices
-
-
--------------------------------------------------------------------------------
-- | A list of splices offered in this module
utilSplices :: [(Text, SnapletISplice b)]
utilSplices =

0 comments on commit 33801ee

Please sign in to comment.
Something went wrong with that request. Please try again.