File tree Expand file tree Collapse file tree 11 files changed +31
-33
lines changed
rest_framework/templates/rest_framework/inline Expand file tree Collapse file tree 11 files changed +31
-33
lines changed Original file line number Diff line number Diff line change 1- < div class ="mb-3 {% if field.errors %}has-error{% endif %} ">
2- < div class ="checkbox ">
1+ < div class ="col-12 ">
2+ < div class ="form-check ">
33 < label >
4- < input type ="checkbox " name ="{{ field.name }} " value ="true " {% if field.value %}checked{% endif %} >
4+ < input class =" form-check-input{% if field.errors %} is-invalid{% endif %} " type ="checkbox " name ="{{ field.name }} " value ="true " {% if field.value %}checked{% endif %} >
55 {% if field.label %}{{ field.label }}{% endif %}
66 </ label >
77 </ div >
Original file line number Diff line number Diff line change 11{% load rest_framework %}
22
3- < div class ="mb-3 {% if field.errors %}has-error{% endif %} ">
3+ < div class ="col-12 ">
44 {% if field.label %}
55 < label class ="sr-only "> {{ field.label }}</ label >
66 {% endif %}
77
88 {% for key, text in field.choices|items %}
9- < div class ="checkbox ">
10- < label >
11- < input type ="checkbox " name ="{{ field.name }} " value ="{{ key }} " {% if key|as_string in field.value|as_list_of_strings %}checked{% endif %} >
12- {{ text }}
13- </ label >
9+ < div class ="form-check {% if style.inline %}form-check-inline {% endif %} ">
10+ < input class ="form-check-input{% if field.errors %} is-invalid{% endif %} " type ="checkbox " name ="{{ field.name }} " value ="{{ key }} " {% if key|as_string in field.value|as_list_of_strings %}checked{% endif %} >
11+ < label > {{ text }}</ label >
1412 </ div >
1513 {% endfor %}
1614</ div >
Original file line number Diff line number Diff line change 1- < div class ="mb-3 ">
1+ < div class ="col-12 ">
22 {% if field.label %}
33 < label class ="sr-only ">
44 {{ field.label }}
55 </ label >
66 {% endif %}
77
8- < p class ="form-control-static "> Dictionaries are not currently supported in HTML input.</ p >
8+ < p class ="form-text "> Dictionaries are not currently supported in HTML input.</ p >
99</ div >
Original file line number Diff line number Diff line change 11{% load rest_framework %}
2+ < div class ="row row-cols-md-auto g-3 align-items-center ">
23{% for field in form %}
34 {% if not field.read_only %}
45 {% render_field field style=style %}
56 {% endif %}
67{% endfor %}
8+ </ div >
Original file line number Diff line number Diff line change 1- < div class ="mb-3 {% if field.errors %}has-error{% endif %} ">
1+ < div class ="col-12 ">
22 {% if field.label %}
33 < label class ="sr-only ">
44 {{ field.label }}
55 </ label >
66 {% endif %}
77
8- < input name ="{{ field.name }} " {% if style.input_type ! = "file " %}class ="form-control "{% endif %} type ="{{ style.input_type }} " {% if style.placeholder %}placeholder ="{{ style.placeholder }} "{% endif %} {% if field.value is not None %}value ="{{ field.value }} "{% endif %} {% if style.autofocus and style.input_type ! = "hidden " %}autofocus{% endif %} >
8+ < input name ="{{ field.name }} " {% if style.input_type ! = "file " %}class ="form-control{% if field.errors %} is-invalid{% endif %} "{% endif %} type ="{{ style.input_type }} " {% if style.placeholder %}placeholder ="{{ style.placeholder }} "{% endif %} {% if field.value is not None %}value ="{{ field.value }} "{% endif %} {% if style.autofocus and style.input_type ! = "hidden " %}autofocus{% endif %} >
99</ div >
Original file line number Diff line number Diff line change 1- < div class ="mb-3 ">
1+ < div class ="col-12 ">
22 {% if field.label %}
33 < label class ="sr-only ">
44 {{ field.label }}
55 </ label >
66 {% endif %}
77
8- < p class ="form-control-static "> Lists are not currently supported in HTML input.</ p >
8+ < p class ="form-text "> Lists are not currently supported in HTML input.</ p >
99</ div >
Original file line number Diff line number Diff line change 1- < span > Lists are not currently supported in HTML input.</ span >
1+ < div class ="col-12 ">
2+ < span class ="form-text "> Lists are not currently supported in HTML input.</ span >
3+ </ div >
Original file line number Diff line number Diff line change 22{% load rest_framework %}
33{% trans "None" as none_choice %}
44
5- < div class ="mb-3 {% if field.errors %}has-error{% endif %} ">
5+ < div class ="col-12 ">
66 {% if field.label %}
77 < label class ="sr-only ">
88 {{ field.label }}
99 </ label >
1010 {% endif %}
1111
1212 {% if field.allow_null or field.allow_blank %}
13- < div class ="radio ">
14- < label >
15- < input type ="radio " name ="{{ field.name }} " value ="" {% if not field.value %}checked{% endif %} >
16- {{ none_choice }}
17- </ label >
13+ < div class ="form-check {% if style.inline %}form-check-inline {% endif %} ">
14+ < input class ="form-check-input{% if field.errors %} is-invalid{% endif %} " type ="radio " name ="{{ field.name }} " value ="" {% if not field.value %}checked{% endif %} >
15+ < label > {{ none_choice }}</ label >
1816 </ div >
1917 {% endif %}
2018
2119 {% for key, text in field.choices|items %}
22- < div class ="radio ">
23- < label >
24- < input type ="radio " name ="{{ field.name }} " value ="{{ key }} " {% if key|as_string == field.value|as_string %}checked{% endif %} >
25- {{ text }}
26- </ label >
20+ < div class ="form-check {% if style.inline %}form-check-inline {% endif %} ">
21+ < input class ="form-check-input{% if field.errors %} is-invalid{% endif %} " type ="radio " name ="{{ field.name }} " value ="{{ key }} " {% if key|as_string == field.value|as_string %}checked{% endif %} >
22+ < label > {{ text }}</ label >
2723 </ div >
2824 {% endfor %}
2925</ div >
Original file line number Diff line number Diff line change 11{% load rest_framework %}
22
3- < div class ="mb-3 {% if field.errors %}has-error{% endif %} ">
3+ < div class ="col-12 ">
44 {% if field.label %}
55 < label class ="sr-only ">
66 {{ field.label }}
77 </ label >
88 {% endif %}
99
10- < select class ="form-control " name ="{{ field.name }} ">
10+ < select class ="form-select{% if field.errors %} is-invalid{% endif %} " name ="{{ field.name }} ">
1111 {% if field.allow_null or field.allow_blank %}
1212 < option value ="" {% if not field.value %}selected{% endif %} > --------</ option >
1313 {% endif %}
Original file line number Diff line number Diff line change 22{% load rest_framework %}
33{% trans "No items to select." as no_items %}
44
5- < div class ="mb-3 {% if field.errors %}has-error{% endif %} ">
5+ < div class ="col-12 ">
66 {% if field.label %}
77 < label class ="sr-only ">
88 {{ field.label }}
99 </ label >
1010 {% endif %}
1111
12- < select multiple {{ field.choices|yesno: ",disabled" }} class="form-control " name ="{{ field.name }} ">
12+ < select multiple {{ field.choices|yesno: ",disabled" }} class="form-select{% if field.errors %} is-invalid{% endif %} " name ="{{ field.name }} ">
1313 {% for select in field.iter_options %}
1414 {% if select.start_option_group %}
1515 < optgroup label ="{{ select.label }} ">
You can’t perform that action at this time.
0 commit comments