Merge pull request #1604 from jprider63/optional-labels
Optional labels
This commit is contained in:
commit
af038b75f8
@ -1,5 +1,9 @@
|
|||||||
# ChangeLog for yesod-form
|
# ChangeLog for yesod-form
|
||||||
|
|
||||||
|
## 1.6.5
|
||||||
|
|
||||||
|
* Add `.sr-only` to labels in `renderBootstrap3` when they are null.
|
||||||
|
|
||||||
## 1.6.4
|
## 1.6.4
|
||||||
|
|
||||||
* Make FormResult an instance of Eq
|
* Make FormResult an instance of Eq
|
||||||
|
|||||||
@ -32,6 +32,7 @@ import Control.Arrow (second)
|
|||||||
import Control.Monad (liftM)
|
import Control.Monad (liftM)
|
||||||
import Data.Text (Text)
|
import Data.Text (Text)
|
||||||
import Data.String (IsString(..))
|
import Data.String (IsString(..))
|
||||||
|
import qualified Text.Blaze.Internal as Blaze
|
||||||
import Yesod.Core
|
import Yesod.Core
|
||||||
import Yesod.Form.Types
|
import Yesod.Form.Types
|
||||||
import Yesod.Form.Functions
|
import Yesod.Form.Functions
|
||||||
@ -154,7 +155,7 @@ renderBootstrap3 formLayout aform fragment = do
|
|||||||
$case formLayout
|
$case formLayout
|
||||||
$of BootstrapBasicForm
|
$of BootstrapBasicForm
|
||||||
$if fvId view /= bootstrapSubmitId
|
$if fvId view /= bootstrapSubmitId
|
||||||
<label for=#{fvId view}>#{fvLabel view}
|
<label :Blaze.null (fvLabel view):.sr-only for=#{fvId view}>#{fvLabel view}
|
||||||
^{fvInput view}
|
^{fvInput view}
|
||||||
^{helpWidget view}
|
^{helpWidget view}
|
||||||
$of BootstrapInlineForm
|
$of BootstrapInlineForm
|
||||||
@ -164,7 +165,7 @@ renderBootstrap3 formLayout aform fragment = do
|
|||||||
^{helpWidget view}
|
^{helpWidget view}
|
||||||
$of BootstrapHorizontalForm labelOffset labelSize inputOffset inputSize
|
$of BootstrapHorizontalForm labelOffset labelSize inputOffset inputSize
|
||||||
$if fvId view /= bootstrapSubmitId
|
$if fvId view /= bootstrapSubmitId
|
||||||
<label .control-label .#{toOffset labelOffset} .#{toColumn labelSize} for=#{fvId view}>#{fvLabel view}
|
<label :Blaze.null (fvLabel view):.sr-only .control-label .#{toOffset labelOffset} .#{toColumn labelSize} for=#{fvId view}>#{fvLabel view}
|
||||||
<div .#{toOffset inputOffset} .#{toColumn inputSize}>
|
<div .#{toOffset inputOffset} .#{toColumn inputSize}>
|
||||||
^{fvInput view}
|
^{fvInput view}
|
||||||
^{helpWidget view}
|
^{helpWidget view}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-form
|
name: yesod-form
|
||||||
version: 1.6.4
|
version: 1.6.5
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user