-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
47 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -787,7 +787,7 @@ This generates: | |
```html | ||
<form accept-charset="UTF-8" action="/users" class="new_user" id="new_user" method="post"> | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<label class="col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<div class="col-sm-10"> | ||
<input aria-required="true" class="form-control-plaintext" id="user_email" name="user[email]" readonly required="required" type="text" value="[email protected]"> | ||
</div> | ||
|
@@ -1049,11 +1049,11 @@ This generates: | |
```html | ||
<form accept-charset="UTF-8" action="/users" class="new_user row row-cols-auto g-3 align-items-center" id="new_user" method="post"> | ||
<div class="col"> | ||
<label class="visually-hidden me-sm-2 required" for="user_email">Email</label> | ||
<label class="visually-hidden required" for="user_email">Email</label> | ||
<input aria-required="true" class="form-control" id="user_email" name="user[email]" required="required" type="email" value="[email protected]"> | ||
</div> | ||
<div class="col"> | ||
<label class="visually-hidden me-sm-2" for="user_password">Password</label> | ||
<label class="visually-hidden" for="user_password">Password</label> | ||
<input class="form-control" id="user_password" name="user[password]" type="password"> | ||
</div> | ||
<div class="col"> | ||
|
@@ -1110,13 +1110,13 @@ This generates: | |
```html | ||
<form accept-charset="UTF-8" action="/users" class="new_user" id="new_user" method="post"> | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<label class="col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<div class="col-sm-10"> | ||
<input aria-required="true" class="form-control" id="user_email" name="user[email]" required="required" type="email" value="[email protected]"> | ||
</div> | ||
</div> | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2" for="user_password">Password</label> | ||
<label class="col-form-label col-sm-2" for="user_password">Password</label> | ||
<div class="col-sm-10"> | ||
<input class="form-control" id="user_password" name="user[password]" type="password"> | ||
</div> | ||
|
@@ -1157,13 +1157,13 @@ This generates: | |
```html | ||
<form accept-charset="UTF-8" action="/users" class="new_user" id="new_user" method="post"> | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<label class="col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<div class="col-sm-10"> | ||
<input aria-required="true" class="form-control" id="user_email" name="user[email]" required="required" type="email" value="[email protected]"> | ||
</div> | ||
</div> | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-3" for="user_age">Age</label> | ||
<label class="col-form-label col-sm-3" for="user_age">Age</label> | ||
<div class="col-sm-3"> | ||
<input class="form-control" id="user_age" name="user[age]" type="text" value="42"> | ||
</div> | ||
|
@@ -1223,13 +1223,13 @@ This generates: | |
```html | ||
<form accept-charset="UTF-8" action="/users" class="new_user" id="new_user" method="post"> | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<label class="col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<div class="col-sm-10"> | ||
<input aria-required="true" class="form-control" id="user_email" name="user[email]" required="required" type="email" value="[email protected]"> | ||
</div> | ||
</div> | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2" for="user_age">Age</label> | ||
<label class="col-form-label col-sm-2" for="user_age">Age</label> | ||
<div class="col-sm-10 additional-control-col-class"> | ||
<input class="form-control" id="user_age" name="user[age]" type="text" value="42"> | ||
</div> | ||
|
@@ -1264,7 +1264,7 @@ This generates: | |
```html | ||
<form accept-charset="UTF-8" action="/users" class="new_user" id="new_user" method="post"> | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<label class="col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<div class="col-sm-10"> | ||
<input aria-required="true" class="form-control" id="user_email" name="user[email]" required="required" type="email" value="[email protected]"> | ||
</div> | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,7 +218,7 @@ class BootstrapFieldsTest < ActionView::TestCase | |
test "text fields are wrapped correctly when horizontal and gutter classes are given" do | ||
expected = <<~HTML | ||
<div class="mb-3 g-3"> | ||
<label class="form-label col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<label class="col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<div class="col-sm-10"> | ||
<input aria-required="true" required="required" class="form-control" id="user_email" name="user[email]" type="text" value="[email protected]" /> | ||
</div> | ||
|
@@ -231,7 +231,7 @@ class BootstrapFieldsTest < ActionView::TestCase | |
test "text fields are wrapped correctly when horizontal and multiple wrapper classes specified" do | ||
expected = <<~HTML | ||
<div class="bogus-2 row"> | ||
<label class="form-label col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<label class="col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<div class="col-sm-10"> | ||
<input aria-required="true" required="required" class="form-control" id="user_email" name="user[email]" type="text" value="[email protected]" /> | ||
</div> | ||
|
@@ -244,7 +244,7 @@ class BootstrapFieldsTest < ActionView::TestCase | |
test "text fields are wrapped correctly when horizontal and wrapper class specified" do | ||
expected = <<~HTML | ||
<div class="bogus-1 row"> | ||
<label class="form-label col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<label class="col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<div class="col-sm-10"> | ||
<input aria-required="true" required="required" class="form-control" id="user_email" name="user[email]" type="text" value="[email protected]" /> | ||
</div> | ||
|
@@ -256,7 +256,7 @@ class BootstrapFieldsTest < ActionView::TestCase | |
test "text fields are wrapped correctly when horizontal and multiple wrapper classes specified (reverse order)" do | ||
expected = <<~HTML | ||
<div class="bogus-2 row"> | ||
<label class="form-label col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<label class="col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<div class="col-sm-10"> | ||
<input aria-required="true" required="required" class="form-control" id="user_email" name="user[email]" type="text" value="[email protected]" /> | ||
</div> | ||
|
@@ -383,7 +383,7 @@ class BootstrapFieldsTest < ActionView::TestCase | |
<form accept-charset="UTF-8" action="/users" class="new_user" id="new_user" method="post"> | ||
#{'<input name="utf8" type="hidden" value="✓"/>' unless ::Rails::VERSION::STRING >= '6'} | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2" for="user_address_attributes_street">Street</label> | ||
<label class="col-form-label col-sm-2" for="user_address_attributes_street">Street</label> | ||
<div class="col-sm-10"> | ||
<input class="form-control" id="user_address_attributes_street" name="user[address_attributes][street]" type="text" value="123 Main Street" /> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -210,7 +210,7 @@ class BootstrapFormGroupTest < ActionView::TestCase | |
test "help messages for horizontal forms" do | ||
expected = <<~HTML | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<label class="col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<div class="col-sm-10"> | ||
<input aria-required="true" required="required" class="form-control" id="user_email" name="user[email]" type="text" value="[email protected]" /> | ||
<small class="form-text text-muted">This is required</small> | ||
|
@@ -287,7 +287,7 @@ class BootstrapFormGroupTest < ActionView::TestCase | |
|
||
expected = <<~HTML | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2" for="user_nil">Foo</label> | ||
<label class="col-form-label col-sm-2" for="user_nil">Foo</label> | ||
<div class="col-sm-10"> | ||
<input class="form-control-plaintext" value="Bar"> | ||
</div> | ||
|
@@ -318,7 +318,7 @@ class BootstrapFormGroupTest < ActionView::TestCase | |
|
||
expected = <<~HTML | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2 required" for="user_email">Custom Control</label> | ||
<label class="col-form-label col-sm-2 required" for="user_email">Custom Control</label> | ||
<div class="col-sm-10"> | ||
<input class="form-control-plaintext" value="Bar"> | ||
</div> | ||
|
@@ -373,7 +373,7 @@ class BootstrapFormGroupTest < ActionView::TestCase | |
end | ||
|
||
test "form_group overrides the label's 'class' and 'for' attributes if others are passed" do | ||
output = @horizontal_builder.form_group nil, label: { text: "Custom Control", class: "foo", for: "bar" } do | ||
output = @horizontal_builder.form_group nil, label: { text: "Custom Control", add_class: "foo", for: "bar" } do | ||
'<input class="form-control-plaintext" value="Bar">'.html_safe | ||
end | ||
|
||
|
@@ -538,7 +538,7 @@ class BootstrapFormGroupTest < ActionView::TestCase | |
<div class="col-sm-10 offset-sm-2">Hallo</div> | ||
</div> | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<label class="col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<div class="col-sm-10"> | ||
<input aria-required="true" required="required" class="form-control" id="user_email" name="user[email]" type="text" value="[email protected]" /> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase | |
|
||
expected = <<~HTML | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<label class="col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<div class="col-sm-10"> | ||
<input aria-required="true" required="required" class="form-control-plaintext" id="user_email" extra="extra arg" name="user[email]" readonly="readonly" type="text" value="[email protected]"/> | ||
</div> | ||
|
@@ -24,7 +24,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase | |
|
||
expected = <<~HTML | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2 required" for="custom_id">Email</label> | ||
<label class="col-form-label col-sm-2 required" for="custom_id">Email</label> | ||
<div class="col-sm-10"> | ||
<input aria-required="true" required="required" class="form-control-plaintext" id="custom_id" name="user[email]" readonly="readonly" type="text" value="[email protected]"/> | ||
</div> | ||
|
@@ -38,7 +38,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase | |
|
||
expected = <<~HTML | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2" for="user_">My Label</label> | ||
<label class="col-form-label col-sm-2" for="user_">My Label</label> | ||
<div class="col-sm-10"> | ||
<input class="form-control-plaintext" id="user_" name="user[]" readonly="readonly" type="text" value="this is a test"/> | ||
</div> | ||
|
@@ -52,7 +52,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase | |
|
||
expected = <<~HTML | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2" for="user_">Custom Label</label> | ||
<label class="col-form-label col-sm-2" for="user_">Custom Label</label> | ||
<div class="col-sm-10"> | ||
<input class="form-control-plaintext" id="user_" name="user[]" readonly="readonly" type="text" value="Custom Control"/> | ||
</div> | ||
|
@@ -66,7 +66,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase | |
|
||
expected = <<~HTML | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2" for="user_">Custom Label</label> | ||
<label class="col-form-label col-sm-2" for="user_">Custom Label</label> | ||
<div class="col-sm-10"> | ||
<input class="form-control-plaintext" id="user_" name="user[]" readonly="readonly" type="text"/> | ||
</div> | ||
|
@@ -80,7 +80,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase | |
|
||
expected = <<~HTML | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<label class="col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<div class="col-sm-10"> | ||
<input aria-required="true" required="required" class="test_class form-control-plaintext" id="user_email" name="user[email]" readonly="readonly" type="text" value="[email protected]"/> | ||
</div> | ||
|
@@ -96,7 +96,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase | |
|
||
expected = <<~HTML | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<label class="col-form-label col-sm-2 required" for="user_email">Email</label> | ||
<div class="col-sm-10">this is a test</div> | ||
</div> | ||
HTML | ||
|
@@ -110,7 +110,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase | |
|
||
expected = <<~HTML | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2" for="user_">My Label</label> | ||
<label class="col-form-label col-sm-2" for="user_">My Label</label> | ||
<div class="col-sm-10">this is a test</div> | ||
</div> | ||
HTML | ||
|
@@ -124,7 +124,7 @@ class BootstrapOtherComponentsTest < ActionView::TestCase | |
|
||
expected = <<~HTML | ||
<div class="mb-3 row"> | ||
<label class="form-label col-form-label col-sm-2" for="user_">Custom Label</label> | ||
<label class="col-form-label col-sm-2" for="user_">Custom Label</label> | ||
<div class="col-sm-10">Custom Control</div> | ||
</div> | ||
HTML | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters