Fix according to Bootstrap 3 docs

This commit is contained in:
Yuriy Syrovetskiy 2022-10-05 20:16:12 +02:00
parent 5ac0138697
commit b841e8cf0b
2 changed files with 21 additions and 19 deletions

View File

@ -177,17 +177,17 @@ timeField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m Tim
timeField = timeFieldTypeTime timeField = timeFieldTypeTime
-- | Creates an input with @type="time"@. <http://caniuse.com/#search=time%20input%20type Browsers not supporting this type> will fallback to a text field, and Yesod will parse the time as described in 'timeFieldTypeText'. -- | Creates an input with @type="time"@. <http://caniuse.com/#search=time%20input%20type Browsers not supporting this type> will fallback to a text field, and Yesod will parse the time as described in 'timeFieldTypeText'.
-- --
-- Add the @time@ package and import the "Data.Time.LocalTime" module to use this function. -- Add the @time@ package and import the "Data.Time.LocalTime" module to use this function.
-- --
-- @since 1.4.2 -- @since 1.4.2
timeFieldTypeTime :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m TimeOfDay timeFieldTypeTime :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m TimeOfDay
timeFieldTypeTime = timeFieldOfType "time" timeFieldTypeTime = timeFieldOfType "time"
-- | Creates an input with @type="text"@, parsing the time from an [H]H:MM[:SS] format, with an optional AM or PM (if not given, AM is assumed for compatibility with the 24 hour clock system). -- | Creates an input with @type="text"@, parsing the time from an [H]H:MM[:SS] format, with an optional AM or PM (if not given, AM is assumed for compatibility with the 24 hour clock system).
-- --
-- This function exists for backwards compatibility with the old implementation of 'timeField', which used to use @type="text"@. Consider using 'timeField' or 'timeFieldTypeTime' for improved UX and validation from the browser. -- This function exists for backwards compatibility with the old implementation of 'timeField', which used to use @type="text"@. Consider using 'timeField' or 'timeFieldTypeTime' for improved UX and validation from the browser.
-- --
-- Add the @time@ package and import the "Data.Time.LocalTime" module to use this function. -- Add the @time@ package and import the "Data.Time.LocalTime" module to use this function.
-- --
-- @since 1.4.2 -- @since 1.4.2
@ -223,7 +223,7 @@ $newline never
where showVal = either id (pack . renderHtml) where showVal = either id (pack . renderHtml)
-- | A newtype wrapper around a 'Text' whose 'ToMarkup' instance converts newlines to HTML @\<br>@ tags. -- | A newtype wrapper around a 'Text' whose 'ToMarkup' instance converts newlines to HTML @\<br>@ tags.
-- --
-- (When text is entered into a @\<textarea>@, newline characters are used to separate lines. -- (When text is entered into a @\<textarea>@, newline characters are used to separate lines.
-- If this text is then placed verbatim into HTML, the lines won't be separated, thus the need for replacing with @\<br>@ tags). -- If this text is then placed verbatim into HTML, the lines won't be separated, thus the need for replacing with @\<br>@ tags).
-- If you don't need this functionality, simply use 'unTextarea' to access the raw text. -- If you don't need this functionality, simply use 'unTextarea' to access the raw text.
@ -352,7 +352,7 @@ timeParser = do
if i < 0 || i >= 60 if i < 0 || i >= 60
then fail $ show $ msg $ pack xy then fail $ show $ msg $ pack xy
else return $ fromIntegral (i :: Int) else return $ fromIntegral (i :: Int)
-- | Creates an input with @type="email"@. Yesod will validate the email's correctness according to RFC5322 and canonicalize it by removing comments and whitespace (see "Text.Email.Validate"). -- | Creates an input with @type="email"@. Yesod will validate the email's correctness according to RFC5322 and canonicalize it by removing comments and whitespace (see "Text.Email.Validate").
emailField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m Text emailField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m Text
emailField = Field emailField = Field
@ -534,17 +534,19 @@ radioField :: (Eq a, RenderMessage site FormMessage)
radioField = withRadioField radioField = withRadioField
(\theId optionWidget -> [whamlet| (\theId optionWidget -> [whamlet|
$newline never $newline never
<label .radio for=#{theId}-none> <div .radio>
<div> <label for=#{theId}-none>
^{optionWidget} <div>
_{MsgSelectNone} ^{optionWidget}
_{MsgSelectNone}
|]) |])
(\theId value _isSel text optionWidget -> [whamlet| (\theId value _isSel text optionWidget -> [whamlet|
$newline never $newline never
<label .radio for=#{theId}-#{value}> <div .radio>
<div> <label for=#{theId}-#{value}>
^{optionWidget} <div>
\#{text} ^{optionWidget}
\#{text}
|]) |])
@ -580,7 +582,7 @@ $newline never
-- --
-- If this field is optional, the first radio button is labeled "\<None>", the second \"Yes" and the third \"No". -- If this field is optional, the first radio button is labeled "\<None>", the second \"Yes" and the third \"No".
-- --
-- If this field is required, the first radio button is labeled \"Yes" and the second \"No". -- If this field is required, the first radio button is labeled \"Yes" and the second \"No".
-- --
-- (Exact label titles will depend on localization). -- (Exact label titles will depend on localization).
boolField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m Bool boolField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m Bool
@ -614,7 +616,7 @@ $newline never
t -> Left $ SomeMessage $ MsgInvalidBool t t -> Left $ SomeMessage $ MsgInvalidBool t
showVal = either (\_ -> False) showVal = either (\_ -> False)
-- | Creates an input with @type="checkbox"@. -- | Creates an input with @type="checkbox"@.
-- While the default @'boolField'@ implements a radio button so you -- While the default @'boolField'@ implements a radio button so you
-- can differentiate between an empty response (@Nothing@) and a no -- can differentiate between an empty response (@Nothing@) and a no
-- response (@Just False@), this simpler checkbox field returns an empty -- response (@Just False@), this simpler checkbox field returns an empty
@ -972,15 +974,15 @@ prependZero t0 = if T.null t1
-- $optionsOverview -- $optionsOverview
-- These functions create inputs where one or more options can be selected from a list. -- These functions create inputs where one or more options can be selected from a list.
-- --
-- The basic datastructure used is an 'Option', which combines a user-facing display value, the internal Haskell value being selected, and an external 'Text' stored as the @value@ in the form (used to map back to the internal value). A list of these, together with a function mapping from an external value back to a Haskell value, form an 'OptionList', which several of these functions take as an argument. -- The basic datastructure used is an 'Option', which combines a user-facing display value, the internal Haskell value being selected, and an external 'Text' stored as the @value@ in the form (used to map back to the internal value). A list of these, together with a function mapping from an external value back to a Haskell value, form an 'OptionList', which several of these functions take as an argument.
-- --
-- Typically, you won't need to create an 'OptionList' directly and can instead make one with functions like 'optionsPairs' or 'optionsEnum'. Alternatively, you can use functions like 'selectFieldList', which use their @[(msg, a)]@ parameter to create an 'OptionList' themselves. -- Typically, you won't need to create an 'OptionList' directly and can instead make one with functions like 'optionsPairs' or 'optionsEnum'. Alternatively, you can use functions like 'selectFieldList', which use their @[(msg, a)]@ parameter to create an 'OptionList' themselves.
-- | Creates an input with @type="color"@. -- | Creates an input with @type="color"@.
-- The input value must be provided in hexadecimal format #rrggbb. -- The input value must be provided in hexadecimal format #rrggbb.
-- --
-- @since 1.7.1 -- @since 1.7.1
colorField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m Text colorField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m Text
colorField = Field colorField = Field
{ fieldParse = parseHelper $ \s -> { fieldParse = parseHelper $ \s ->

View File

@ -1,6 +1,6 @@
cabal-version: >= 1.10 cabal-version: >= 1.10
name: yesod-form name: yesod-form
version: 1.7.2 version: 1.7.3
license: MIT license: MIT
license-file: LICENSE license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com> author: Michael Snoyman <michael@snoyman.com>