File tree Expand file tree Collapse file tree 3 files changed +33
-3
lines changed
crispy_bootstrap5/templates/bootstrap5/layout Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 1
- < div {% if div.css_id %}id ="{{ div.css_id }} "{% endif %} class ="form- row {{ div.css_class|default:'' }} " {{ div.flat_attrs|safe }} >
2
- {{ fields|safe }}
1
+ < div {% if div.css_id %}id ="{{ div.css_id }} "{% endif %} class ="row {{ div.css_class|default:'' }} " {{ div.flat_attrs|safe }} >
2
+ {{ fields|safe }}
3
3
</ div >
Original file line number Diff line number Diff line change
1
+ < form method ="post ">
2
+ < div class ="row ">
3
+ < div class ="col-md ">
4
+ < div id ="div_id_first_name " class ="mb-3 "> < label for ="id_first_name " class ="form-label requiredField "> first
5
+ name< span class ="asteriskField "> *</ span > </ label >
6
+ < div > < input type ="text " name ="first_name " maxlength ="5 "
7
+ class ="textinput textInput inputtext form-control " required id ="id_first_name "> </ div >
8
+ </ div >
9
+ </ div >
10
+ < div class ="col-md ">
11
+ < div id ="div_id_last_name " class ="mb-3 "> < label for ="id_last_name " class ="form-label requiredField "> last
12
+ name< span class ="asteriskField "> *</ span > </ label >
13
+ < div > < input type ="text " name ="last_name " maxlength ="5 "
14
+ class ="textinput textInput inputtext form-control " required id ="id_last_name "> </ div >
15
+ </ div >
16
+ </ div >
17
+ </ div >
18
+ </ form >
Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ def test_layout_fieldset_row_html_with_unicode_fieldnames(settings):
195
195
assert 'id="row_passwords"' in html
196
196
assert html .count ("<label" ) == 6
197
197
198
- assert 'class="form- row rows"' in html
198
+ assert 'class="row rows"' in html
199
199
200
200
assert "Hello!" in html
201
201
assert "testLink" in html
@@ -550,3 +550,15 @@ def test_file_field():
550
550
'<input type="file" name="file_field" class="fileinput fileUpload '
551
551
'form-control" required id="id_file_field">' in html
552
552
)
553
+
554
+
555
+ def test_row ():
556
+ form = SampleForm ()
557
+ form .helper = FormHelper ()
558
+ form .helper .layout = Layout (
559
+ Row (
560
+ Column ("first_name" ),
561
+ Column ("last_name" ),
562
+ )
563
+ )
564
+ assert parse_form (form ) == parse_expected ("row.html" )
You can’t perform that action at this time.
0 commit comments