Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
7159b310
Commit
7159b310
authored
Mar 07, 2015
by
Aider Ibragimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update vertical and inline layouts for radio choices
parent
fdd811ec
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
2 deletions
+31
-2
rest_framework/templates/rest_framework/horizontal/radio.html
+3
-2
rest_framework/templates/rest_framework/inline/radio.html
+11
-0
rest_framework/templates/rest_framework/vertical/radio.html
+17
-0
No files found.
rest_framework/templates/rest_framework/horizontal/radio.html
View file @
7159b310
{% load i18n %}
{% load i18n %}
{% trans "None" as none_choice %}
<div
class=
"form-group"
>
<div
class=
"form-group"
>
{% if field.label %}
{% if field.label %}
...
@@ -9,7 +10,7 @@
...
@@ -9,7 +10,7 @@
{% if field.allow_null or field.allow_blank %}
{% if field.allow_null or field.allow_blank %}
<label
class=
"radio-inline"
>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
""
{%
if
not
field
.
value
%}
checked
{%
endif
%}
/>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
""
{%
if
not
field
.
value
%}
checked
{%
endif
%}
/>
{
% trans "None" %
}
{
{ none_choice }
}
</label>
</label>
{% endif %}
{% endif %}
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
...
@@ -23,7 +24,7 @@
...
@@ -23,7 +24,7 @@
<div
class=
"radio"
>
<div
class=
"radio"
>
<label>
<label>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
""
{%
if
not
field
.
value
%}
checked
{%
endif
%}
/>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
""
{%
if
not
field
.
value
%}
checked
{%
endif
%}
/>
{
% trans "None" %
}
{
{ none_choice }
}
</label>
</label>
</div>
</div>
{% endif %}
{% endif %}
...
...
rest_framework/templates/rest_framework/inline/radio.html
View file @
7159b310
{% load i18n %}
{% trans "None" as none_choice %}
<div
class=
"form-group {% if field.errors %}has-error{% endif %}"
>
<div
class=
"form-group {% if field.errors %}has-error{% endif %}"
>
{% if field.label %}
{% if field.label %}
<label
class=
"sr-only"
>
{{ field.label }}
</label>
<label
class=
"sr-only"
>
{{ field.label }}
</label>
{% endif %}
{% endif %}
{% if field.allow_null or field.allow_blank %}
<div
class=
"radio"
>
<label>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
""
{%
if
not
field
.
value
%}
checked
{%
endif
%}
>
{{ none_choice }}
</label>
</div>
{% endif %}
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<div
class=
"radio"
>
<div
class=
"radio"
>
<label>
<label>
...
...
rest_framework/templates/rest_framework/vertical/radio.html
View file @
7159b310
{% load i18n %}
{% trans "None" as none_choice %}
<div
class=
"form-group {% if field.errors %}has-error{% endif %}"
>
<div
class=
"form-group {% if field.errors %}has-error{% endif %}"
>
{% if field.label %}
{% if field.label %}
<label
{%
if
style
.
hide_label
%}
class=
"sr-only"
{%
endif
%}
>
{{ field.label }}
</label>
<label
{%
if
style
.
hide_label
%}
class=
"sr-only"
{%
endif
%}
>
{{ field.label }}
</label>
{% endif %}
{% endif %}
{% if style.inline %}
{% if style.inline %}
<div>
<div>
{% if field.allow_null or field.allow_blank %}
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
""
{%
if
not
field
.
value
%}
checked
{%
endif
%}
/>
{{ none_choice }}
</label>
{% endif %}
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<label
class=
"radio-inline"
>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
checked
{%
endif
%}
>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
checked
{%
endif
%}
>
...
@@ -12,6 +21,14 @@
...
@@ -12,6 +21,14 @@
{% endfor %}
{% endfor %}
</div>
</div>
{% else %}
{% else %}
{% if field.allow_null or field.allow_blank %}
<div
class=
"radio"
>
<label>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
""
{%
if
not
field
.
value
%}
checked
{%
endif
%}
/>
{{ none_choice }}
</label>
</div>
{% endif %}
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<div
class=
"radio"
>
<div
class=
"radio"
>
<label>
<label>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment