yesod-form 0.4.1 → 0.4.2
raw patch · 4 files changed
+31/−20 lines, 4 filesdep ~yesod-corePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: yesod-core
API changes (from Hackage documentation)
- Yesod.Form.Nic: class YesodNic a where urlNicEdit _ = Right "http://js.nicedit.com/nicEdit-latest.js"
+ Yesod.Form.Nic: class Yesod a => YesodNic a where urlNicEdit _ = Right "http://js.nicedit.com/nicEdit-latest.js"
Files
- Yesod/Form/Functions.hs +14/−14
- Yesod/Form/I18n/German.hs +1/−1
- Yesod/Form/Nic.hs +14/−3
- yesod-form.cabal +2/−2
Yesod/Form/Functions.hs view
@@ -297,17 +297,17 @@ -- -- Sample Hamlet: ----- > <form method=post action=@{ActionR} enctype=#{formEnctype}>--- > <fieldset>--- > <legend>_{MsgLegend}--- > $case result--- > $of FormFailure reasons--- > $forall reason <- reasons--- > <div .alert-message .error>#{reason}--- > $of _--- > ^{formWidget}--- > <div .actions>--- > <input .btn .primary type=submit value=_{MsgSubmit}>+-- > <form .form-horizontal method=post action=@{ActionR} enctype=#{formEnctype}>+-- > <fieldset>+-- > <legend>_{MsgLegend}+-- > $case result+-- > $of FormFailure reasons+-- > $forall reason <- reasons+-- > <div .alert .alert-error>#{reason}+-- > $of _+-- > ^{formWidget}+-- > <div .form-actions>+-- > <input .btn .primary type=submit value=_{MsgSubmit}> renderBootstrap :: FormRender sub master a renderBootstrap aform fragment = do (res, views') <- aFormToForm aform@@ -317,9 +317,9 @@ let widget = [whamlet| \#{fragment} $forall view <- views- <div .clearfix :fvRequired view:.required :not $ fvRequired view:.optional :has $ fvErrors view:.error>- <label for=#{fvId view}>#{fvLabel view}- <div.input>+ <div .control-group .clearfix :fvRequired view:.required :not $ fvRequired view:.optional :has $ fvErrors view:.error>+ <label .control-label for=#{fvId view}>#{fvLabel view}+ <div .controls .input> ^{fvInput view} $maybe tt <- fvTooltip view <span .help-block>#{tt}
Yesod/Form/I18n/German.hs view
@@ -16,7 +16,7 @@ germanFormMessage (MsgInvalidHour t) = "Ungültige Stunde: " `mappend` t germanFormMessage (MsgInvalidMinute t) = "Ungültige Minute: " `mappend` t germanFormMessage (MsgInvalidSecond t) = "Ungültige Sekunde: " `mappend` t-germanFormMessage MsgCsrfWarning = "Bitte bestätigen Sie ihre Eingabe, als Schutz gegen Cross-Site Forgery Angriffen"+germanFormMessage MsgCsrfWarning = "Bitte bestätigen Sie ihre Eingabe, als Schutz gegen Cross-Site Forgery Angriffe" germanFormMessage MsgValueRequired = "Wert wird benötigt" germanFormMessage (MsgInputNotFound t) = "Eingabe nicht gefunden: " `mappend` t germanFormMessage MsgSelectNone = "<Nichts>"
Yesod/Form/Nic.hs view
@@ -11,7 +11,7 @@ ) where import Yesod.Handler-import Yesod.Core (Route)+import Yesod.Core (Route, ScriptLoadPosition(..), jsLoader, Yesod) import Yesod.Form import Yesod.Widget import Text.HTML.SanitizeXSS (sanitizeBalance)@@ -23,7 +23,7 @@ import qualified Data.Text as T import Data.Maybe (listToMaybe) -class YesodNic a where+class Yesod a => YesodNic a where -- | NIC Editor Javascript file. urlNicEdit :: a -> Either (Route a) Text urlNicEdit _ = Right "http://js.nicedit.com/nicEdit-latest.js"@@ -41,13 +41,24 @@ <textarea id="#{theId}" :not (null theClass):class="#{T.intercalate " " theClass}" name="#{name}" .html>#{showVal val} |] addScript' urlNicEdit- addJulius+ master <- lift getYesod+ addJulius $+ case jsLoader master of+ BottomOfHeadBlocking -> #if __GLASGOW_HASKELL__ >= 700 [julius| #else [$julius| #endif bkLib.onDomLoaded(function(){new nicEditor({fullPanel:true}).panelInstance("#{theId}")});+|]+ _ ->+#if __GLASGOW_HASKELL__ >= 700+ [julius|+#else+ [$julius|+#endif+(function(){new nicEditor({fullPanel:true}).panelInstance("#{theId}")})(); |] } where
yesod-form.cabal view
@@ -1,5 +1,5 @@ name: yesod-form-version: 0.4.1+version: 0.4.2 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>@@ -14,7 +14,7 @@ library build-depends: base >= 4 && < 5- , yesod-core >= 0.10.1 && < 0.11+ , yesod-core >= 0.10.2 && < 0.11 , yesod-persistent >= 0.3.1 && < 0.4 , time >= 1.1.4 , hamlet >= 0.10 && < 0.11