Permalink
Browse files

Update for new heist

  • Loading branch information...
1 parent d358192 commit 557ea1882a485f3509200db7d5733fef6f9cfc70 @mightybyte mightybyte committed Aug 22, 2013
@@ -36,8 +36,8 @@ initFlashNotice
:: HasHeist b
=> Snaplet (Heist b) -> SnapletLens b SessionManager -> Initializer b v ()
initFlashNotice h session = do
- let splices = ("flash" ?! flashSplice session)
- csplices = ("flash" ?! flashCSplice session)
+ let splices = ("flash" ## flashSplice session)
+ csplices = ("flash" ## flashCSplice session)
addConfig h $ mempty { hcCompiledSplices = csplices
, hcInterpretedSplices = splices }
@@ -81,8 +81,8 @@ flashSplice session = do
Just msg' -> do
lift $ withTop session $ deleteFromSession k >> commitSession
callTemplateWithText "_flash" $ do
- "type" ?! typ'
- "message" ?! msg'
+ "type" ## typ'
+ "message" ## msg'
-------------------------------------------------------------------------------
@@ -97,8 +97,8 @@ flashCSplice session = do
k = T.concat ["_", typ]
splice getVal = do
let ss = do
- "type" ?! return $ C.yieldPureText typ
- "message" ?! return $ C.yieldRuntimeText $ liftM fromJust
+ "type" ## return $ C.yieldPureText typ
+ "message" ## return $ C.yieldRuntimeText $ liftM fromJust
$ getVal
flashTemplate <- C.withLocalSplices ss
noSplices (C.callTemplate "_flash")
@@ -129,11 +129,11 @@ addNavTrailSplices heist = do
lens <- getLens
addConfig heist $
mempty { hcCompiledSplices = do
- "linkToFocus" ?! focusCSplice lens
- "linkToBack" ?! backCSplice
+ "linkToFocus" ## focusCSplice lens
+ "linkToBack" ## backCSplice
, hcInterpretedSplices = do
- "linkToFocus" ?! focusSplice lens
- "linkToBack" ?! backSplice
+ "linkToFocus" ## focusSplice lens
+ "linkToBack" ## backSplice
}
@@ -6,7 +6,6 @@ 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
@@ -19,8 +18,8 @@ import Text.XmlHtml
utilSplices :: MonadSnap m => Splices (Splice m)
utilSplices = do
- "rqparam" ?! paramSplice
- "refererLink" ?! refererCSplice
+ "rqparam" ## paramSplice
+ "refererLink" ## refererCSplice
refererCSplice :: MonadSnap m => Splice m
@@ -32,8 +32,8 @@ import Text.XmlHtml
-- | A list of splices offered in this module
utilSplices :: Splices (SnapletISplice b)
utilSplices = do
- "rqparam" ?! paramSplice
- "refererLink" ?! refererSplice
+ "rqparam" ## paramSplice
+ "refererLink" ## refererSplice
refererSplice :: MonadSnap m => Splice m
@@ -63,7 +63,7 @@ paramSplice = do
--
-- > heistLocal runTextAreas $ render "joo/index"
runTextAreas :: Monad m => HeistState m -> HeistState m
-runTextAreas = bindSplices ("textarea" ?! ta)
+runTextAreas = bindSplices ("textarea" ## ta)
where
ta = do
hs <- getHS
@@ -91,16 +91,16 @@ selectSplice
-> Splice m
selectSplice nm fid xs defv =
callTemplate "_select" $ do
- "options" ?! opts
- "name" ?! textSplice nm
- "id" ?! textSplice fid
+ "options" ## opts
+ "name" ## textSplice nm
+ "id" ## textSplice fid
where
opts = mapSplices gen xs
gen (val,txt) = runChildrenWith $ do
- "val" ?! textSplice val
- "text" ?! textSplice txt
- "ifSelected" ?! ifISplice $ maybe False (== val) defv
- "ifNotSelected" ?! ifISplice $ maybe True (/= val) defv
+ "val" ## textSplice val
+ "text" ## textSplice txt
+ "ifSelected" ## ifISplice $ maybe False (== val) defv
+ "ifNotSelected" ## ifISplice $ maybe True (/= val) defv
------------------------------------------------------------------------------
View
@@ -43,8 +43,8 @@ import qualified Text.XmlHtml as X
-------------------------------------------------------------------------------
initTabs :: HasHeist b => Snaplet (Heist b) -> Initializer b v ()
initTabs h = do
- let splices = ("tabs" ?! tabsSplice)
- csplices = ("tabs" ?! tabsCSplice)
+ let splices = ("tabs" ## tabsSplice)
+ csplices = ("tabs" ## tabsCSplice)
addConfig h $ mempty { hcCompiledSplices = csplices
, hcInterpretedSplices = splices }
@@ -60,7 +60,7 @@ tabsCSplice :: MonadSnap m => C.Splice m
tabsCSplice = do
n <- getParamNode
let getCtx = lift $ (T.decodeUtf8 . rqURI) `liftM` getRequest
- splices = ("tab" ?! tabCSplice getCtx)
+ splices = ("tab" ## tabCSplice getCtx)
case n of
Element _ attrs ch -> C.withLocalSplices splices noSplices $
C.runNode $ X.Element "ul" attrs ch
@@ -122,7 +122,7 @@ tabSpliceWorker _ _ = []
tabsSplice :: MonadSnap m => Splice m
tabsSplice = do
context <- lift $ (T.decodeUtf8 . rqURI) `liftM` getRequest
- let bind = bindSplices ("tab" ?! tabSplice context)
+ let bind = bindSplices ("tab" ## tabSplice context)
n <- getParamNode
case n of
Element _ attrs ch -> localHS bind $ runNodeList [X.Element "ul" attrs ch]

0 comments on commit 557ea18

Please sign in to comment.