packages feed

yesod-form 1.4.11 → 1.4.12

raw patch · 5 files changed

+35/−4 lines, 5 files

Files

ChangeLog.md view
@@ -1,3 +1,7 @@+## 1.4.12++* Password field does not remember its previous value+ ## 1.4.11  * Fix warnings
Yesod/Form/Fields.hs view
@@ -267,9 +267,9 @@ passwordField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m Text passwordField = Field     { fieldParse = parseHelper $ Right-    , fieldView = \theId name attrs val isReq -> toWidget [hamlet|+    , fieldView = \theId name attrs _ isReq -> toWidget [hamlet| $newline never-<input id="#{theId}" name="#{name}" *{attrs} type="password" :isReq:required="" value="#{either id id val}">+<input id="#{theId}" name="#{name}" *{attrs} type="password" :isReq:required=""> |]     , fieldEnctype = UrlEncoded     }
+ Yesod/Form/I18n/Chinese.hs view
@@ -0,0 +1,26 @@+{-# LANGUAGE OverloadedStrings #-}+module Yesod.Form.I18n.Chinese where++import Yesod.Form.Types (FormMessage (..))+import Data.Monoid (mappend)+import Data.Text (Text)++chineseFormMessage :: FormMessage -> Text+chineseFormMessage (MsgInvalidInteger t) = "无效的整数: " `Data.Monoid.mappend` t+chineseFormMessage (MsgInvalidNumber t) = "无效的数字: " `mappend` t+chineseFormMessage (MsgInvalidEntry t) = "无效的条目: " `mappend` t+chineseFormMessage MsgInvalidTimeFormat = "无效的时间, 必须符合HH:MM[:SS]格式"+chineseFormMessage MsgInvalidDay = "无效的日期, 必须符合YYYY-MM-DD格式"+chineseFormMessage (MsgInvalidUrl t) = "无效的链接: " `mappend` t+chineseFormMessage (MsgInvalidEmail t) = "无效的邮箱地址: " `mappend` t+chineseFormMessage (MsgInvalidHour t) = "无效的小时: " `mappend` t+chineseFormMessage (MsgInvalidMinute t) = "无效的分钟: " `mappend` t+chineseFormMessage (MsgInvalidSecond t) = "无效的秒: " `mappend` t+chineseFormMessage MsgCsrfWarning = "为了防备跨站请求伪造, 请确认表格提交."+chineseFormMessage MsgValueRequired = "此项必填"+chineseFormMessage (MsgInputNotFound t) = "输入找不到: " `mappend` t+chineseFormMessage MsgSelectNone = "<空>"+chineseFormMessage (MsgInvalidBool t) = "无效的逻辑值: " `mappend` t+chineseFormMessage MsgBoolYes = "是"+chineseFormMessage MsgBoolNo = "否"+chineseFormMessage MsgDelete = "删除?"
Yesod/Form/Input.hs view
@@ -25,7 +25,7 @@ type DText = [Text] -> [Text]  -- | Type for a form which parses a value of type @a@ with the base monad @m@--- (usually your @Handler@). Can can compose this using its @Applicative@ instance.+-- (usually your @Handler@). Can compose this using its @Applicative@ instance. newtype FormInput m a = FormInput { unFormInput :: HandlerSite m -> [Text] -> Env -> FileEnv -> m (Either DText a) } instance Monad m => Functor (FormInput m) where     fmap a (FormInput f) = FormInput $ \c d e e' -> liftM (either Left (Right . a)) $ f c d e e'
yesod-form.cabal view
@@ -1,5 +1,5 @@ name:            yesod-form-version:         1.4.11+version:         1.4.12 license:         MIT license-file:    LICENSE author:          Michael Snoyman <michael@snoyman.com>@@ -68,6 +68,7 @@                      Yesod.Form.I18n.Russian                      Yesod.Form.I18n.Dutch                      Yesod.Form.I18n.Spanish+                     Yesod.Form.I18n.Chinese                      -- FIXME Yesod.Helpers.Crud     ghc-options:     -Wall