yesod-form 1.0.0.2 → 1.0.0.3
raw patch · 6 files changed
+50/−3 lines, 6 filesdep +blaze-markupdep ~blaze-html
Dependencies added: blaze-markup
Dependency ranges changed: blaze-html
Files
- Yesod/Form/Fields.hs +8/−0
- Yesod/Form/Functions.hs +7/−0
- Yesod/Form/MassInput.hs +5/−0
- Yesod/Form/Nic.hs +8/−1
- Yesod/Form/Types.hs +8/−0
- yesod-form.cabal +14/−2
Yesod/Form/Fields.hs view
@@ -3,6 +3,7 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE CPP #-} module Yesod.Form.Fields ( -- * i18n FormMessage (..)@@ -50,7 +51,14 @@ import Yesod.Widget (toWidget, whamlet, GWidget) import Yesod.Message (RenderMessage (renderMessage), SomeMessage (..)) import Text.Hamlet+#if MIN_VERSION_blaze_html(0, 5, 0)+import Text.Blaze (ToMarkup (toMarkup), preEscapedToMarkup, unsafeByteString)+#define ToHtml ToMarkup+#define toHtml toMarkup+#define preEscapedText preEscapedToMarkup+#else import Text.Blaze (ToHtml (..), preEscapedText, unsafeByteString)+#endif import Text.Cassius import Data.Time (Day, TimeOfDay(..)) import qualified Text.Email.Validate as Email
Yesod/Form/Functions.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE CPP #-} module Yesod.Form.Functions ( -- * Running in MForm monad newFormIdent@@ -43,7 +44,13 @@ import Control.Monad.Trans.RWS (ask, get, put, runRWST, tell, evalRWST) import Control.Monad.Trans.Class (lift) import Control.Monad (liftM, join)+#if MIN_VERSION_blaze_html(0, 5, 0)+import Text.Blaze (Markup, toMarkup)+#define Html Markup+#define toHtml toMarkup+#else import Text.Blaze (Html, toHtml)+#endif import Yesod.Handler (GHandler, getRequest, runRequestBody, newIdent, getYesod) import Yesod.Core (RenderMessage, SomeMessage (..)) import Yesod.Widget (GWidget, whamlet)
Yesod/Form/MassInput.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE CPP#-} module Yesod.Form.MassInput ( inputList , massDivs@@ -14,7 +15,11 @@ import Yesod.Widget (GWidget, whamlet) import Yesod.Message (RenderMessage) import Yesod.Handler (newIdent, GHandler)+#if MIN_VERSION_blaze_html(0, 5, 0)+import Text.Blaze.Html (Html)+#else import Text.Blaze (Html)+#endif import Control.Monad.Trans.Class (lift) import Control.Monad.Trans.RWS (get, put, ask) import Data.Maybe (fromMaybe)
Yesod/Form/Nic.hs view
@@ -3,6 +3,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoMonomorphismRestriction #-} -- FIXME remove+{-# LANGUAGE CPP #-} -- | Provide the user with a rich text editor. module Yesod.Form.Nic ( YesodNic (..)@@ -16,8 +17,14 @@ import Text.HTML.SanitizeXSS (sanitizeBalance) import Text.Hamlet (Html, shamlet) import Text.Julius (julius)-import Text.Blaze.Renderer.String (renderHtml)+#if MIN_VERSION_blaze_html(0, 5, 0)+import Text.Blaze (preEscapedToMarkup)+import Text.Blaze.Html.Renderer.String (renderHtml)+#define preEscapedText preEscapedToMarkup+#else import Text.Blaze (preEscapedText)+import Text.Blaze.Renderer.String (renderHtml)+#endif import Data.Text (Text, pack) import Data.Maybe (listToMaybe)
Yesod/Form/Types.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ExistentialQuantification #-}+{-# LANGUAGE CPP #-} module Yesod.Form.Types ( -- * Helpers Enctype (..)@@ -22,7 +23,14 @@ import Yesod.Request (FileInfo) import Data.Text (Text) import Data.Monoid (Monoid (..))+#if MIN_VERSION_blaze_html(0, 5, 0)+import Text.Blaze (Markup, ToMarkup (toMarkup))+#define Html Markup+#define ToHtml ToMarkup+#define toHtml toMarkup+#else import Text.Blaze (Html, ToHtml (toHtml))+#endif import Control.Applicative ((<$>), Applicative (..)) import Control.Monad (liftM) import Data.String (IsString (..))
yesod-form.cabal view
@@ -1,5 +1,5 @@ name: yesod-form-version: 1.0.0.2+version: 1.0.0.3 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>@@ -12,6 +12,10 @@ homepage: http://www.yesodweb.com/ description: Form handling support for Yesod Web Framework +flag blaze_html_0_5+ description: use blaze-html 0.5 and blaze-markup 0.5+ default: False+ library build-depends: base >= 4 && < 5 , yesod-core >= 1.0 && < 1.1@@ -28,11 +32,19 @@ , blaze-builder >= 0.2.1.4 && < 0.4 , network >= 2.2 && < 2.4 , email-validate >= 0.2.6 && < 0.3- , blaze-html >= 0.4.1.3 && < 0.5 , bytestring >= 0.9.1.4 && < 0.10 , text >= 0.9 && < 1.0 , wai >= 1.2 && < 1.3 , containers >= 0.2 && < 0.5++ if flag(blaze_html_0_5)+ build-depends:+ blaze-html >= 0.5 && < 0.6+ , blaze-markup >= 0.5.1 && < 0.6+ else+ build-depends:+ blaze-html >= 0.4 && < 0.5+ exposed-modules: Yesod.Form Yesod.Form.Class Yesod.Form.Types