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
36fbc767
Commit
36fbc767
authored
Oct 15, 2014
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moar form styling
parent
cc1c4232
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
146 additions
and
61 deletions
+146
-61
rest_framework/templates/rest_framework/base.html
+1
-1
rest_framework/templates/rest_framework/horizontal/fields/checkbox.html
+7
-1
rest_framework/templates/rest_framework/horizontal/fields/checkbox_multiple.html
+8
-2
rest_framework/templates/rest_framework/horizontal/fields/fieldset.html
+2
-2
rest_framework/templates/rest_framework/horizontal/fields/input.html
+9
-4
rest_framework/templates/rest_framework/horizontal/fields/list_fieldset.html
+1
-1
rest_framework/templates/rest_framework/horizontal/fields/radio.html
+8
-2
rest_framework/templates/rest_framework/horizontal/fields/select.html
+7
-1
rest_framework/templates/rest_framework/horizontal/fields/select_multiple.html
+7
-1
rest_framework/templates/rest_framework/horizontal/fields/textarea.html
+9
-4
rest_framework/templates/rest_framework/inline/fields/checkbox.html
+7
-5
rest_framework/templates/rest_framework/inline/fields/checkbox_multiple.html
+1
-1
rest_framework/templates/rest_framework/inline/fields/fieldset.html
+1
-1
rest_framework/templates/rest_framework/inline/fields/input.html
+2
-2
rest_framework/templates/rest_framework/inline/fields/radio.html
+1
-1
rest_framework/templates/rest_framework/inline/fields/select.html
+1
-1
rest_framework/templates/rest_framework/inline/fields/select_multiple.html
+1
-1
rest_framework/templates/rest_framework/inline/fields/textarea.html
+2
-2
rest_framework/templates/rest_framework/vertical/fields/checkbox.html
+15
-6
rest_framework/templates/rest_framework/vertical/fields/checkbox_multiple.html
+9
-3
rest_framework/templates/rest_framework/vertical/fields/fieldset.html
+2
-2
rest_framework/templates/rest_framework/vertical/fields/input.html
+9
-4
rest_framework/templates/rest_framework/vertical/fields/list_fieldset.html
+2
-2
rest_framework/templates/rest_framework/vertical/fields/radio.html
+9
-3
rest_framework/templates/rest_framework/vertical/fields/select.html
+8
-2
rest_framework/templates/rest_framework/vertical/fields/select_multiple.html
+8
-2
rest_framework/templates/rest_framework/vertical/fields/textarea.html
+9
-4
No files found.
rest_framework/templates/rest_framework/base.html
View file @
36fbc767
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
<ul
class=
"breadcrumb"
>
<ul
class=
"breadcrumb"
>
{% for breadcrumb_name, breadcrumb_url in breadcrumblist %}
{% for breadcrumb_name, breadcrumb_url in breadcrumblist %}
{% if forloop.last %}
{% if forloop.last %}
<li
class=
"active"
>
{{ breadcrumb_name }}
</li>
<li
class=
"active"
>
<a
href=
"{{ breadcrumb_url }}"
>
{{ breadcrumb_name }}
</a>
</li>
{% else %}
{% else %}
<li><a
href=
"{{ breadcrumb_url }}"
>
{{ breadcrumb_name }}
</a></li>
<li><a
href=
"{{ breadcrumb_url }}"
>
{{ breadcrumb_name }}
</a></li>
{% endif %}
{% endif %}
...
...
rest_framework/templates/rest_framework/horizontal/fields/checkbox.html
View file @
36fbc767
<div
class=
"form-group"
>
<div
class=
"form-group
{% if field.errors %}has-error{% endif %}
"
>
<div
class=
"col-sm-offset-2 col-sm-10"
>
<div
class=
"col-sm-offset-2 col-sm-10"
>
<div
class=
"checkbox"
>
<div
class=
"checkbox"
>
<label>
<label>
...
@@ -6,5 +6,11 @@
...
@@ -6,5 +6,11 @@
{% if field.label %}{{ field.label }}{% endif %}
{% if field.label %}{{ field.label }}{% endif %}
</label>
</label>
</div>
</div>
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
</div>
</div>
</div>
</div>
rest_framework/templates/rest_framework/horizontal/fields/
select_checkbox
.html
→
rest_framework/templates/rest_framework/horizontal/fields/
checkbox_multiple
.html
View file @
36fbc767
<div
class=
"form-group"
>
<div
class=
"form-group"
>
{% if field.label %}
{% if field.label %}
<label
class=
"col-sm-2 control-label {% if
field.
style.hide_label %}sr-only{% endif %}"
>
{{ field.label }}
</label>
<label
class=
"col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}"
>
{{ field.label }}
</label>
{% endif %}
{% endif %}
<div
class=
"col-sm-10"
>
<div
class=
"col-sm-10"
>
{% if
field.
style.inline %}
{% if style.inline %}
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<label
class=
"checkbox-inline"
>
<label
class=
"checkbox-inline"
>
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
checked
{%
endif
%}
>
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
checked
{%
endif
%}
>
...
@@ -20,5 +20,11 @@
...
@@ -20,5 +20,11 @@
</div>
</div>
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
</div>
</div>
</div>
</div>
rest_framework/templates/rest_framework/horizontal/fields/fieldset.html
View file @
36fbc767
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
<fieldset>
<fieldset>
{% if field.label %}
{% if field.label %}
<div
class=
"form-group"
style=
"border-bottom: 1px solid #e5e5e5"
>
<div
class=
"form-group"
style=
"border-bottom: 1px solid #e5e5e5"
>
<legend
class=
"control-label col-sm-2 {% if
field.
style.hide_label %}sr-only{% endif %}"
style=
"border-bottom: 0"
>
{{ field.label }}
</legend>
<legend
class=
"control-label col-sm-2 {% if style.hide_label %}sr-only{% endif %}"
style=
"border-bottom: 0"
>
{{ field.label }}
</legend>
</div>
</div>
{% endif %}
{% endif %}
{% for nested_field in field %}
{% for nested_field in field %}
{% render_field nested_field
layout=layout
renderer=renderer %}
{% render_field nested_field
template_pack=template_pack
renderer=renderer %}
{% endfor %}
{% endfor %}
</fieldset>
</fieldset>
rest_framework/templates/rest_framework/horizontal/fields/input.html
View file @
36fbc767
<div
class=
"form-group"
>
<div
class=
"form-group
{% if field.errors %}has-error{% endif %}
"
>
{% if field.label %}
{% if field.label %}
<label
class=
"col-sm-2 control-label {% if
field.
style.hide_label %}sr-only{% endif %}"
>
{{ field.label }}
</label>
<label
class=
"col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}"
>
{{ field.label }}
</label>
{% endif %}
{% endif %}
<div
class=
"col-sm-10"
>
<div
class=
"col-sm-10"
>
<input
name=
"{{ field.name }}"
type=
"{{ input_type }}"
class=
"form-control"
{%
if
field
.
style
.
placeholder
%}
placeholder=
"{{ field.style.placeholder }}"
{%
endif
%}
{%
if
field
.
value
%}
value=
"{{ field.value }}"
{%
endif
%}
>
<input
name=
"{{ field.name }}"
class=
"form-control"
type=
"{{ style.input_type }}"
novalidate
{%
if
style
.
placeholder
%}
placeholder=
"{{ style.placeholder }}"
{%
endif
%}
{%
if
field
.
value
%}
value=
"{{ field.value }}"
{%
endif
%}
>
{% if field.help_text %}
<p
class=
"help-block"
>
{{ field.help_text }}
</p>
{% endif %}
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
</div>
</div>
</div>
</div>
rest_framework/templates/rest_framework/horizontal/fields/list_fieldset.html
View file @
36fbc767
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<fieldset>
<fieldset>
{% if field.label %}
{% if field.label %}
<div
class=
"form-group"
style=
"border-bottom: 1px solid #e5e5e5"
>
<div
class=
"form-group"
style=
"border-bottom: 1px solid #e5e5e5"
>
<legend
class=
"control-label col-sm-2 {% if
field.
style.hide_label %}sr-only{% endif %}"
style=
"border-bottom: 0"
>
{{ field.label }}
</legend>
<legend
class=
"control-label col-sm-2 {% if style.hide_label %}sr-only{% endif %}"
style=
"border-bottom: 0"
>
{{ field.label }}
</legend>
</div>
</div>
{% endif %}
{% endif %}
<ul>
<ul>
...
...
rest_framework/templates/rest_framework/horizontal/fields/
select_
radio.html
→
rest_framework/templates/rest_framework/horizontal/fields/radio.html
View file @
36fbc767
<div
class=
"form-group"
>
<div
class=
"form-group"
>
{% if field.label %}
{% if field.label %}
<label
class=
"col-sm-2 control-label {% if
field.
style.hide_label %}sr-only{% endif %}"
>
{{ field.label }}
</label>
<label
class=
"col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}"
>
{{ field.label }}
</label>
{% endif %}
{% endif %}
<div
class=
"col-sm-10"
>
<div
class=
"col-sm-10"
>
{% if
field.
style.inline %}
{% if style.inline %}
{% 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
%}
>
...
@@ -20,5 +20,11 @@
...
@@ -20,5 +20,11 @@
</div>
</div>
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
</div>
</div>
</div>
</div>
rest_framework/templates/rest_framework/horizontal/fields/select.html
View file @
36fbc767
<div
class=
"form-group"
>
<div
class=
"form-group"
>
{% if field.label %}
{% if field.label %}
<label
class=
"col-sm-2 control-label {% if
field.
style.hide_label %}sr-only{% endif %}"
>
{{ field.label }}
</label>
<label
class=
"col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}"
>
{{ field.label }}
</label>
{% endif %}
{% endif %}
<div
class=
"col-sm-10"
>
<div
class=
"col-sm-10"
>
<select
class=
"form-control"
name=
"{{ field.name }}"
>
<select
class=
"form-control"
name=
"{{ field.name }}"
>
...
@@ -8,5 +8,11 @@
...
@@ -8,5 +8,11 @@
<option
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
<option
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% endfor %}
{% endfor %}
</select>
</select>
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
</div>
</div>
</div>
</div>
rest_framework/templates/rest_framework/horizontal/fields/select_multiple.html
View file @
36fbc767
<div
class=
"form-group"
>
<div
class=
"form-group"
>
{% if field.label %}
{% if field.label %}
<label
class=
"col-sm-2 control-label {% if
field.
style.hide_label %}sr-only{% endif %}"
>
{{ field.label }}
</label>
<label
class=
"col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}"
>
{{ field.label }}
</label>
{% endif %}
{% endif %}
<div
class=
"col-sm-10"
>
<div
class=
"col-sm-10"
>
<select
multiple
class=
"form-control"
name=
"{{ field.name }}"
>
<select
multiple
class=
"form-control"
name=
"{{ field.name }}"
>
...
@@ -8,5 +8,11 @@
...
@@ -8,5 +8,11 @@
<option
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
<option
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% endfor %}
{% endfor %}
</select>
</select>
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
</div>
</div>
</div>
</div>
rest_framework/templates/rest_framework/horizontal/fields/textarea.html
View file @
36fbc767
<div
class=
"form-group"
>
<div
class=
"form-group
{% if field.errors %}has-error{% endif %}
"
>
{% if field.label %}
{% if field.label %}
<label
class=
"col-sm-2 control-label {% if
field.
style.hide_label %}sr-only{% endif %}"
>
{{ field.label }}
</label>
<label
class=
"col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}"
>
{{ field.label }}
</label>
{% endif %}
{% endif %}
<div
class=
"col-sm-10"
>
<div
class=
"col-sm-10"
>
<textarea
name=
"{{ field.name }}"
class=
"form-control"
{%
if
field
.
style
.
placeholder
%}
placeholder=
"{{ field.style.placeholder }}"
{%
endif
%}
{%
if
field
.
style
.
rows
%}
rows=
"{{ field.style.rows }}"
{%
endif
%}
>
{% if field.value %}{{ field.value }}{% endif %}
</textarea>
<textarea
name=
"{{ field.name }}"
class=
"form-control"
{%
if
style
.
placeholder
%}
placeholder=
"{{ style.placeholder }}"
{%
endif
%}
{%
if
style
.
rows
%}
rows=
"{{ style.rows }}"
{%
endif
%}
>
{% if field.value %}{{ field.value }}{% endif %}
</textarea>
{% if field.help_text %}
<p
class=
"help-block"
>
{{ field.help_text }}
</p>
{% endif %}
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
</div>
</div>
</div>
</div>
rest_framework/templates/rest_framework/inline/fields/checkbox.html
View file @
36fbc767
<div
class=
"checkbox"
>
<div
class=
"form-group {% if field.errors %}has-error{% endif %}"
>
<label>
<div
class=
"checkbox"
>
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"true"
{%
if
field
.
value
%}
checked
{%
endif
%}
>
<label>
{% if field.label %}{{ field.label }}{% endif %}
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"true"
{%
if
field
.
value
%}
checked
{%
endif
%}
>
</label>
{% if field.label %}{{ field.label }}{% endif %}
</label>
</div>
</div>
</div>
rest_framework/templates/rest_framework/inline/fields/
select_checkbox
.html
→
rest_framework/templates/rest_framework/inline/fields/
checkbox_multiple
.html
View file @
36fbc767
<div
class=
"form-group"
>
<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 %}
...
...
rest_framework/templates/rest_framework/inline/fields/fieldset.html
View file @
36fbc767
{% load rest_framework %}
{% load rest_framework %}
{% for nested_field in field %}
{% for nested_field in field %}
{% render_field nested_field
layout=layout
renderer=renderer %}
{% render_field nested_field
template_pack=template_pack
renderer=renderer %}
{% endfor %}
{% endfor %}
rest_framework/templates/rest_framework/inline/fields/input.html
View file @
36fbc767
<div
class=
"form-group"
>
<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 %}
<input
name=
"{{ field.name }}"
type=
"{{ input_type }}"
class=
"form-control"
{%
if
field
.
style
.
placeholder
%}
placeholder=
"{{ field.
style.placeholder }}"
{%
endif
%}
{%
if
field
.
value
%}
value=
"{{ field.value }}"
{%
endif
%}
>
<input
name=
"{{ field.name }}"
class=
"form-control"
type=
"{{ style.input_type }}"
novalidate
{%
if
style
.
placeholder
%}
placeholder=
"{{
style.placeholder }}"
{%
endif
%}
{%
if
field
.
value
%}
value=
"{{ field.value }}"
{%
endif
%}
>
</div>
</div>
rest_framework/templates/rest_framework/inline/fields/
select_
radio.html
→
rest_framework/templates/rest_framework/inline/fields/radio.html
View file @
36fbc767
<div
class=
"form-group"
>
<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 %}
...
...
rest_framework/templates/rest_framework/inline/fields/select.html
View file @
36fbc767
<div
class=
"form-group"
>
<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 %}
...
...
rest_framework/templates/rest_framework/inline/fields/select_multiple.html
View file @
36fbc767
<div
class=
"form-group"
>
<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 %}
...
...
rest_framework/templates/rest_framework/inline/fields/textarea.html
View file @
36fbc767
<div
class=
"form-group"
>
<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 %}
<input
name=
"{{ field.name }}"
type=
"
{{ input_type }}"
class=
"form-control"
{%
if
field
.
style
.
placeholder
%}
placeholder=
"{{ field.
style.placeholder }}"
{%
endif
%}
{%
if
field
.
value
%}
value=
"{{ field.value }}"
{%
endif
%}
>
<input
name=
"{{ field.name }}"
type=
"
text"
class=
"form-control"
{%
if
style
.
placeholder
%}
placeholder=
"{{
style.placeholder }}"
{%
endif
%}
{%
if
field
.
value
%}
value=
"{{ field.value }}"
{%
endif
%}
>
</div>
</div>
rest_framework/templates/rest_framework/vertical/fields/checkbox.html
View file @
36fbc767
<div
class=
"checkbox"
>
<div
class=
"form-group {% if field.errors %}has-error{% endif %}"
>
<label>
<div
class=
"checkbox"
>
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"true"
{%
if
value
%}
checked
{%
endif
%}
>
<label>
{% if field.label %}{{ field.label }}{% endif %}
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"true"
{%
if
value
%}
checked
{%
endif
%}
>
</label>
{% if field.label %}{{ field.label }}{% endif %}
</div>
</label>
</div>
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
</div>
\ No newline at end of file
rest_framework/templates/rest_framework/vertical/fields/
select_checkbox
.html
→
rest_framework/templates/rest_framework/vertical/fields/
checkbox_multiple
.html
View file @
36fbc767
<div
class=
"form-group"
>
<div
class=
"form-group
{% if field.errors %}has-error{% endif %}
"
>
{% if field.label %}
{% if field.label %}
<label
{%
if
field
.
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
field.
style.inline %}
{% if style.inline %}
<div>
<div>
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<label
class=
"checkbox-inline"
>
<label
class=
"checkbox-inline"
>
...
@@ -21,4 +21,10 @@
...
@@ -21,4 +21,10 @@
</div>
</div>
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
</div>
</div>
rest_framework/templates/rest_framework/vertical/fields/fieldset.html
View file @
36fbc767
{% load rest_framework %}
{% load rest_framework %}
<fieldset>
<fieldset>
{% if field.label %}
<legend
{%
if
field
.
style
.
hide_label
%}
class=
"sr-only"
{%
endif
%}
>
{{ field.label }}
</legend>
{% endif %}
{% if field.label %}
<legend
{%
if
style
.
hide_label
%}
class=
"sr-only"
{%
endif
%}
>
{{ field.label }}
</legend>
{% endif %}
{% for nested_field in field %}
{% for nested_field in field %}
{% render_field nested_field
layout=layout
renderer=renderer %}
{% render_field nested_field
template_pack=template_pack
renderer=renderer %}
{% endfor %}
{% endfor %}
</fieldset>
</fieldset>
rest_framework/templates/rest_framework/vertical/fields/input.html
View file @
36fbc767
<div
class=
"form-group"
>
<div
class=
"form-group
{% if field.errors %}has-error{% endif %}
"
>
{% if field.label %}
{% if field.label %}
<label
{%
if
field
.
style
.
hide_label
%}
class=
"sr-only"
{%
endif
%}
>
{{ field.label }}
</label>
<label
{%
if
style
.
hide_label
%}
class=
"sr-only"
{%
endif
%}
>
{{ field.label }}
</label>
{% endif %}
<input
name=
"{{ field.name }}"
class=
"form-control"
type=
"{{ style.input_type }}"
novalidate
{%
if
style
.
placeholder
%}
placeholder=
"{{ style.placeholder }}"
{%
endif
%}
{%
if
field
.
value
%}
value=
"{{ field.value }}"
{%
endif
%}
>
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
{% endif %}
<input
name=
"{{ field.name }}"
type=
"{{ input_type }}"
class=
"form-control"
{%
if
field
.
style
.
placeholder
%}
placeholder=
"{{ field.style.placeholder }}"
{%
endif
%}
{%
if
field
.
style
.
rows
%}
rows=
"{{ field.style.rows }}"
{%
endif
%}
{%
if
field
.
value
%}
value=
"{{ field.value }}"
{%
endif
%}
>
{% if field.help_text %}
<p
class=
"help-block"
>
{{ field.help_text }}
</p>
{% endif %}
</div>
</div>
rest_framework/templates/rest_framework/vertical/fields/list_fieldset.html
View file @
36fbc767
<fieldset>
<fieldset>
{% if field.label %}
<legend
{%
if
field
.
style
.
hide_label
%}
class=
"sr-only"
{%
endif
%}
>
{{ field.label }}
</legend>
{% endif %}
{% if field.label %}
<legend
{%
if
style
.
hide_label
%}
class=
"sr-only"
{%
endif
%}
>
{{ field.label }}
</legend>
{% endif %}
<!-- {% if field.label %}<legend {% if
field.
style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</legend>{% endif %}
<!-- {% if field.label %}<legend {% if style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</legend>{% endif %}
{% for field_item in field.value.field_items.values() %}
{% for field_item in field.value.field_items.values() %}
{{ renderer.render_field(field_item, layout=layout) }}
{{ renderer.render_field(field_item, layout=layout) }}
{% endfor %} -->
{% endfor %} -->
...
...
rest_framework/templates/rest_framework/vertical/fields/
select_
radio.html
→
rest_framework/templates/rest_framework/vertical/fields/radio.html
View file @
36fbc767
<div
class=
"form-group"
>
<div
class=
"form-group
{% if field.errors %}has-error{% endif %}
"
>
{% if field.label %}
{% if field.label %}
<label
{%
if
field
.
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
field.
style.inline %}
{% if style.inline %}
<div>
<div>
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<label
class=
"radio-inline"
>
<label
class=
"radio-inline"
>
...
@@ -21,4 +21,10 @@
...
@@ -21,4 +21,10 @@
</div>
</div>
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
</div>
</div>
rest_framework/templates/rest_framework/vertical/fields/select.html
View file @
36fbc767
<div
class=
"form-group"
>
<div
class=
"form-group
{% if field.errors %}has-error{% endif %}
"
>
{% if field.label %}
{% if field.label %}
<label
{%
if
field
.
style
.
hide_label
%}
class=
"sr-only"
{%
endif
%}
>
{{ field.label }}
</label>
<label
{%
if
style
.
hide_label
%}
class=
"sr-only"
{%
endif
%}
>
{{ field.label }}
</label>
{% endif %}
{% endif %}
<select
class=
"form-control"
name=
"{{ field.name }}"
>
<select
class=
"form-control"
name=
"{{ field.name }}"
>
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<option
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
<option
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% endfor %}
{% endfor %}
</select>
</select>
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
</div>
</div>
rest_framework/templates/rest_framework/vertical/fields/select_multiple.html
View file @
36fbc767
<div
class=
"form-group"
>
<div
class=
"form-group
{% if field.errors %}has-error{% endif %}
"
>
{% if field.label %}
{% if field.label %}
<label
{%
if
field
.
style
.
hide_label
%}
class=
"sr-only"
{%
endif
%}
>
{{ field.label }}
</label>
<label
{%
if
style
.
hide_label
%}
class=
"sr-only"
{%
endif
%}
>
{{ field.label }}
</label>
{% endif %}
{% endif %}
<select
multiple
class=
"form-control"
name=
"{{ field.name }}"
>
<select
multiple
class=
"form-control"
name=
"{{ field.name }}"
>
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<option
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
<option
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% endfor %}
{% endfor %}
</select>
</select>
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
</div>
</div>
rest_framework/templates/rest_framework/vertical/fields/textarea.html
View file @
36fbc767
<div
class=
"form-group"
>
<div
class=
"form-group
{% if field.errors %}has-error{% endif %}
"
>
{% if field.label %}
{% if field.label %}
<label
{%
if
field
.
style
.
hide_label
%}
class=
"sr-only"
{%
endif
%}
>
{{ field.label }}
</label>
<label
{%
if
style
.
hide_label
%}
class=
"sr-only"
{%
endif
%}
>
{{ field.label }}
</label>
{% endif %}
<textarea
name=
"{{ field.name }}"
class=
"form-control"
{%
if
style
.
placeholder
%}
placeholder=
"{{ style.placeholder }}"
{%
endif
%}
{%
if
style
.
rows
%}
rows=
"{{ style.rows }}"
{%
endif
%}
>
{% if field.value %}{{ field.value }}{% endif %}
</textarea>
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
{% endif %}
<textarea
name=
"{{ field.name }}"
class=
"form-control"
{%
if
field
.
style
.
placeholder
%}
placeholder=
"{{ field.style.placeholder }}"
{%
endif
%}
{%
if
field
.
style
.
rows
%}
rows=
"{{ field.style.rows }}"
{%
endif
%}
>
{% if field.value %}{{ field.value }}{% endif %}
</textarea>
{% if field.help_text %}
<p
class=
"help-block"
>
{{ field.help_text }}
</p>
{% endif %}
</div>
</div>
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