digestive-functors-heist 0.3.0.0 → 0.3.0.1
raw patch · 2 files changed
+21/−7 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
digestive-functors-heist.cabal view
@@ -1,5 +1,5 @@ Name: digestive-functors-heist-Version: 0.3.0.0+Version: 0.3.0.1 Synopsis: Heist frontend for the digestive-functors library Description: Heist frontend for the digestive-functors library Homepage: http://github.com/jaspervdj/digestive-functors
src/Text/Digestive/Heist.hs view
@@ -65,6 +65,7 @@ , ("dfInputSelect", dfInputSelect view) , ("dfInputRadio", dfInputRadio view) , ("dfInputCheckbox", dfInputCheckbox view)+ , ("dfInputFile", dfInputFile view) , ("dfInputSubmit", dfInputSubmit view) , ("dfLabel", dfLabel view) , ("dfForm", dfForm view)@@ -190,6 +191,18 @@ return $ makeElement "input" [] $ attr value ("checked", "checked") $ ("type", "checkbox") : ("id", ref') : ("name", ref') : attrs +-- | Generate a file upload element. Example:+--+-- > <dfInputFile ref="user.avatar" />+dfInputFile :: Monad m => View Text -> Splice m+dfInputFile view = do+ (ref, attrs) <- getRefAttributes+ let ref' = absoluteRef ref view+ value = maybe "" T.pack $ fieldInputFile ref view+ return $ makeElement "input" [] $+ ("type", "file") : ("id", ref') :+ ("name", ref') : ("value", value) : attrs+ -- | Generate a submit button. Example: -- -- > <dfInputSubmit />@@ -209,8 +222,10 @@ let ref' = absoluteRef ref view return $ makeElement "label" content $ ("for", ref') : attrs --- | Generate a form tag with the @method@ attribute set to @POST@ and the--- @enctype@ set to the right value (depending on the form). Example:+-- | Generate a form tag with the @method@ attribute set to @POST@ and+-- the @enctype@ set to the right value (depending on the form).+-- Custom @method@ or @enctype@ attributes would override this+-- behavior. Example: -- -- > <dfForm action="/users/new"> -- > <dfInputText ... />@@ -222,9 +237,9 @@ (_, attrs) <- getRefAttributes content <- getContent return $ makeElement "form" content $- ("method", "POST") :- ("enctype", T.pack (show $ viewEncType view)) :- attrs+ attrs ++ + [ ("method", "POST")+ , ("enctype", T.pack (show $ viewEncType view)) ] errorList :: [Text] -> [(Text, Text)] -> [X.Node] errorList [] _ = []@@ -283,5 +298,4 @@ content <- getContent let view' = subView ref view nodes <- localTS (bindDigestiveSplices view') $ runNodeList content- stopRecursion return nodes