File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
rest_framework/templates/rest_framework/horizontal Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change
1
+ {% load i18n %}
2
+
1
3
< div class ="form-group ">
2
4
{% if field.label %}
3
5
< label class ="col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %} "> {{ field.label }}</ label >
4
6
{% endif %}
5
7
< div class ="col-sm-10 ">
6
8
{% if style.inline %}
9
+ {% if field.allow_null or field.allow_blank %}
10
+ < label class ="radio-inline ">
11
+ < input type ="radio " name ="{{ field.name }} " value ="" {% if not field.value %}checked{% endif %} />
12
+ {% trans "None" %}
13
+ </ label >
14
+ {% endif %}
7
15
{% for key, text in field.choices.items %}
8
16
< label class ="radio-inline ">
9
- < input type ="radio " name ="{{ field.name }} " value ="{{ key }} " {% if key == field.value %}checked{% endif %} >
17
+ < input type ="radio " name ="{{ field.name }} " value ="{{ key }} " {% if key == field.value %}checked{% endif %} / >
10
18
{{ text }}
11
19
</ label >
12
20
{% endfor %}
13
21
{% else %}
22
+ {% if field.allow_null or field.allow_blank %}
23
+ < div class ="radio ">
24
+ < label >
25
+ < input type ="radio " name ="{{ field.name }} " value ="" {% if not field.value %}checked{% endif %} />
26
+ {% trans "None" %}
27
+ </ label >
28
+ </ div >
29
+ {% endif %}
14
30
{% for key, text in field.choices.items %}
15
31
< div class ="radio ">
16
32
< label >
17
- < input type ="radio " name ="{{ field.name }} " value ="{{ key }} " {% if key == field.value %}checked{% endif %} >
33
+ < input type ="radio " name ="{{ field.name }} " value ="{{ key }} " {% if key == field.value %}checked{% endif %} / >
18
34
{{ text }}
19
35
</ label >
20
36
</ div >
You can’t perform that action at this time.
0 commit comments