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