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
5e917789
Commit
5e917789
authored
Jun 18, 2015
by
José Padilla
Committed by
José Padilla
Jun 18, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consistent 2 space tabbing and formatting
parent
e368986f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
634 additions
and
507 deletions
+634
-507
docs_theme/base.html
+12
-33
rest_framework/templates/rest_framework/api_form.html
+3
-3
rest_framework/templates/rest_framework/base.html
+0
-0
rest_framework/templates/rest_framework/horizontal/checkbox.html
+17
-13
rest_framework/templates/rest_framework/horizontal/checkbox_multiple.html
+32
-25
rest_framework/templates/rest_framework/horizontal/fieldset.html
+12
-9
rest_framework/templates/rest_framework/horizontal/form.html
+12
-11
rest_framework/templates/rest_framework/horizontal/input.html
+18
-11
rest_framework/templates/rest_framework/horizontal/list_fieldset.html
+10
-13
rest_framework/templates/rest_framework/horizontal/radio.html
+41
-33
rest_framework/templates/rest_framework/horizontal/select.html
+25
-18
rest_framework/templates/rest_framework/horizontal/select_multiple.html
+24
-17
rest_framework/templates/rest_framework/horizontal/textarea.html
+18
-11
rest_framework/templates/rest_framework/inline/checkbox.html
+6
-6
rest_framework/templates/rest_framework/inline/checkbox_multiple.html
+10
-9
rest_framework/templates/rest_framework/inline/fieldset.html
+3
-3
rest_framework/templates/rest_framework/inline/form.html
+9
-7
rest_framework/templates/rest_framework/inline/input.html
+7
-4
rest_framework/templates/rest_framework/inline/radio.html
+23
-19
rest_framework/templates/rest_framework/inline/select.html
+14
-10
rest_framework/templates/rest_framework/inline/select_multiple.html
+13
-10
rest_framework/templates/rest_framework/inline/textarea.html
+7
-4
rest_framework/templates/rest_framework/login_base.html
+61
-62
rest_framework/templates/rest_framework/pagination/numbers.html
+42
-22
rest_framework/templates/rest_framework/pagination/previous_and_next.html
+19
-10
rest_framework/templates/rest_framework/raw_data_form.html
+6
-6
rest_framework/templates/rest_framework/vertical/checkbox.html
+17
-14
rest_framework/templates/rest_framework/vertical/checkbox_multiple.html
+33
-28
rest_framework/templates/rest_framework/vertical/fieldset.html
+12
-6
rest_framework/templates/rest_framework/vertical/form.html
+9
-8
rest_framework/templates/rest_framework/vertical/input.html
+16
-11
rest_framework/templates/rest_framework/vertical/list_fieldset.html
+7
-2
rest_framework/templates/rest_framework/vertical/radio.html
+40
-31
rest_framework/templates/rest_framework/vertical/select.html
+24
-16
rest_framework/templates/rest_framework/vertical/select_multiple.html
+17
-12
rest_framework/templates/rest_framework/vertical/textarea.html
+15
-10
No files found.
docs_theme/base.html
View file @
5e917789
...
@@ -57,12 +57,10 @@
...
@@ -57,12 +57,10 @@
<body
onload=
"prettyPrint()"
class=
"{% if current_page and current_page.is_homepage %}index{% endif %}-page"
>
<body
onload=
"prettyPrint()"
class=
"{% if current_page and current_page.is_homepage %}index{% endif %}-page"
>
<div
class=
"wrapper"
>
<div
class=
"wrapper"
>
{% include "nav.html" %}
{% include "nav.html" %}
<div
class=
"body-content"
>
<div
class=
"body-content"
>
<div
class=
"container-fluid"
>
<div
class=
"container-fluid"
>
<!-- Search Modal -->
<!-- Search Modal -->
<div
id=
"mkdocs_search_modal"
class=
"modal hide fade"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
id=
"mkdocs_search_modal"
class=
"modal hide fade"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-header"
>
<div
class=
"modal-header"
>
...
@@ -85,25 +83,16 @@
...
@@ -85,25 +83,16 @@
</div>
</div>
<div
class=
"row-fluid"
>
<div
class=
"row-fluid"
>
<div
class=
"span3"
>
<div
class=
"span3"
>
<!-- TODO
<p style="margin-top: -12px">
<a class="btn btn-mini btn-primary" style="width: 60px">« previous</a>
<a class="btn btn-mini btn-primary" style="float: right; margin-right: 8px; width: 60px;">next »</a>
</p>
-->
<div
id=
"table-of-contents"
>
<div
id=
"table-of-contents"
>
<ul
class=
"nav nav-list side-nav well sidebar-nav-fixed"
>
<ul
class=
"nav nav-list side-nav well sidebar-nav-fixed"
>
{% if current_page and current_page.is_homepage %}
{% if current_page and current_page.is_homepage %}
<li
class=
"main"
>
<li
class=
"main"
>
<a
href=
"#"
>
Django REST framework
</a>
<a
href=
"#"
>
Django REST framework
</a>
</li>
</li>
{% endif %}
{% endif %}
{% for toc_item in toc %}
{% for toc_item in toc %}
<li
class=
"{% if current_page and not current_page.is_homepage %}main{% endif %}"
>
<li
class=
"{% if current_page and not current_page.is_homepage %}main{% endif %}"
>
<a
href=
"{{ toc_item.url }}"
>
{{ toc_item.title }}
</a>
<a
href=
"{{ toc_item.url }}"
>
{{ toc_item.title }}
</a>
</li>
</li>
...
@@ -113,25 +102,21 @@
...
@@ -113,25 +102,21 @@
<a
href=
"{{ toc_item.url }}"
>
{{ toc_item.title }}
</a>
<a
href=
"{{ toc_item.url }}"
>
{{ toc_item.title }}
</a>
</li>
</li>
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
{% if current_page and current_page.is_homepage %}
{% if current_page and current_page.is_homepage %}
<div
class=
"promo"
>
<div
class=
"promo"
>
<hr/>
<hr/>
<script
type=
"text/javascript"
src=
"//cdn.fusionads.net/fusion.js?zoneid=1332&serve=C6SDP2Y&placement=djangorestframework"
id=
"_fusionads_js"
></script>
<script
type=
"text/javascript"
src=
"//cdn.fusionads.net/fusion.js?zoneid=1332&serve=C6SDP2Y&placement=djangorestframework"
id=
"_fusionads_js"
></script>
</div>
</div>
{% endif %}
{% endif %}
</ul>
</ul>
</div>
</div>
</div>
</div>
<div
id=
"main-content"
class=
"span9"
>
<div
id=
"main-content"
class=
"span9"
>
{% block content %}
{% block content %}
{% if meta.source %}
{% if meta.source %}
{% for filename in meta.source %}
{% for filename in meta.source %}
<a
class=
"github"
href=
"https://github.com/tomchristie/django-rest-framework/tree/master/rest_framework/{{ filename }}"
>
<a
class=
"github"
href=
"https://github.com/tomchristie/django-rest-framework/tree/master/rest_framework/{{ filename }}"
>
...
@@ -141,20 +126,14 @@
...
@@ -141,20 +126,14 @@
{% endif %}
{% endif %}
{{ content }}
{{ content }}
{% endblock %}
{% endblock %}
</div>
</div>
<!--/span-->
<!--/span-->
</div>
<!--/row-->
</div>
</div>
<!--/.fluid-container-->
<!--/row-->
</div>
<!--/.body content-->
</div>
<!--/.fluid-container-->
</div>
<!--/.body content-->
<div
id=
"push"
></div>
<div
id=
"push"
></div>
</div>
</div>
<!--/.wrapper -->
<!--/.wrapper -->
<footer
class=
"span12"
>
<footer
class=
"span12"
>
<p>
Documentation built with
<a
href=
"http://www.mkdocs.org/"
>
MkDocs
</a>
.
</a>
<p>
Documentation built with
<a
href=
"http://www.mkdocs.org/"
>
MkDocs
</a>
.
</a>
...
...
rest_framework/templates/rest_framework/api_form.html
View file @
5e917789
{% load rest_framework %}
{% load rest_framework %}
{% csrf_token %}
{% csrf_token %}
{% for field in form %}
{% for field in form %}
{% if not field.read_only %}
{% if not field.read_only %}
{% render_field field style=style %}
{% render_field field style=style %}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
<!-- form.non_field_errors -->
<!-- form.non_field_errors -->
rest_framework/templates/rest_framework/base.html
View file @
5e917789
This diff is collapsed.
Click to expand it.
rest_framework/templates/rest_framework/horizontal/checkbox.html
View file @
5e917789
<div
class=
"form-group {% if field.errors %}has-error{% endif %}"
>
<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>
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"true"
{%
if
field
.
value
%}
checked
{%
endif
%}
>
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"true"
{%
if
field
.
value
%}
checked
{%
endif
%}
>
{% if field.label %}{{ field.label }}{% endif %}
{% if field.label %}{{ field.label }}{% endif %}
</label>
</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>
</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>
rest_framework/templates/rest_framework/horizontal/checkbox_multiple.html
View file @
5e917789
<div
class=
"form-group"
>
<div
class=
"form-group"
>
{% if field.label %}
{% if field.label %}
<label
class=
"col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}"
>
{{ field.label }}
</label>
<label
class=
"col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}"
>
{% endif %}
{{ field.label }}
<div
class=
"col-sm-10"
>
</label>
{% endif %}
<div
class=
"col-sm-10"
>
{% if 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
%}
>
{{ text }}
{{ text }}
</label>
</label>
{% endfor %}
{% endfor %}
{% else %}
{% else %}
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<div
class=
"checkbox"
>
<div
class=
"checkbox"
>
<label>
<label>
<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
%}
>
{{ text }}
{{ text }}
</label>
</label>
</div>
</div>
{% endfor %}
{% endfor %}
{% 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 %}
</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>
rest_framework/templates/rest_framework/horizontal/fieldset.html
View file @
5e917789
{% load rest_framework %}
{% load rest_framework %}
<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 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"
>
</div>
{{ field.label }}
</legend>
</div>
{% endif %}
{% for nested_field in field %}
{% if not nested_field.read_only %}
{% render_field nested_field style=style %}
{% endif %}
{% endif %}
{% for nested_field in field %}
{% endfor %}
{% if not nested_field.read_only %}
{% render_field nested_field style=style %}
{% endif %}
{% endfor %}
</fieldset>
</fieldset>
rest_framework/templates/rest_framework/horizontal/form.html
View file @
5e917789
{% load rest_framework %}
{% load rest_framework %}
<form
class=
"form-horizontal"
role=
"form"
action=
"."
method=
"POST"
novalidate
>
<form
class=
"form-horizontal"
role=
"form"
action=
"."
method=
"POST"
novalidate
>
{% csrf_token %}
{% csrf_token %}
{% for field in form %}
{% for field in form %}
{% if not field.read_only %}
{% if not field.read_only %}
{% render_field field style=style %}
{% render_field field style=style %}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
<!-- form.non_field_errors -->
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<div
class=
"col-sm-offset-2 col-sm-10"
>
<div
class=
"col-sm-offset-2 col-sm-10"
>
<button
type=
"submit"
class=
"btn btn-default"
>
Submit
</button>
<button
type=
"submit"
class=
"btn btn-default"
>
Submit
</button>
</div>
</div>
</div>
</div>
</form>
</form>
rest_framework/templates/rest_framework/horizontal/input.html
View file @
5e917789
<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=
"col-sm-2 control-label {% if 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 %}
<div
class=
"col-sm-10"
>
<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
%}
value=
"{{ field.value }}"
{%
endif
%}
>
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% endif %}
<div
class=
"col-sm-10"
>
<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
%}
value=
"{{ field.value }}"
{%
endif
%}
>
{% if field.help_text %}
{% if field.errors %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% endif %}
</div>
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
</div>
</div>
</div>
rest_framework/templates/rest_framework/horizontal/list_fieldset.html
View file @
5e917789
{% load rest_framework %}
{% load rest_framework %}
<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 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"
>
</div>
{{ field.label }}
{% endif %}
</legend>
<!--
</div>
<ul>
{% endif %}
{% for child in field.value %}
<li>TODO</li>
<p>
Lists are not currently supported in HTML input.
</p>
{% endfor %}
</ul>
-->
<p>
Lists are not currently supported in HTML input.
</p>
</fieldset>
</fieldset>
rest_framework/templates/rest_framework/horizontal/radio.html
View file @
5e917789
...
@@ -2,46 +2,54 @@
...
@@ -2,46 +2,54 @@
{% trans "None" as none_choice %}
{% trans "None" as none_choice %}
<div
class=
"form-group"
>
<div
class=
"form-group"
>
{% if field.label %}
{% if field.label %}
<label
class=
"col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}"
>
{{ field.label }}
</label>
<label
class=
"col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}"
>
{% endif %}
{{ field.label }}
<div
class=
"col-sm-10"
>
</label>
{% endif %}
<div
class=
"col-sm-10"
>
{% if style.inline %}
{% if style.inline %}
{% 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
%}
/>
{{ none_choice }}
{{ none_choice }}
</label>
</label>
{% endif %}
{% endif %}
{% for key, text in field.choices.items %}
<label
class=
"radio-inline"
>
{% for key, text in field.choices.items %}
<input
type=
"radio"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
checked
{%
endif
%}
/>
<label
class=
"radio-inline"
>
{{ text }}
<input
type=
"radio"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
checked
{%
endif
%}
/>
</label>
{{ text }}
{% endfor %}
</label>
{% endfor %}
{% else %}
{% else %}
{% if field.allow_null or field.allow_blank %}
{% if field.allow_null or field.allow_blank %}
<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
%}
/>
{{ none_choice }}
{{ none_choice }}
</label>
</label>
</div>
</div>
{% endif %}
{% endif %}
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<div
class=
"radio"
>
<div
class=
"radio"
>
<label>
<label>
<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
%}
/>
{{ text }}
{{ text }}
</label>
</label>
</div>
</div>
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
{% if field.errors %}
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% endif %}
{% if field.help_text %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
{% endif %}
</div>
</div>
</div>
</div>
rest_framework/templates/rest_framework/horizontal/select.html
View file @
5e917789
<div
class=
"form-group"
>
<div
class=
"form-group"
>
{% if field.label %}
{% if field.label %}
<label
class=
"col-sm-2 control-label {% if 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 %}
<div
class=
"col-sm-10"
>
<select
class=
"form-control"
name=
"{{ field.name }}"
>
{% if field.allow_null or field.allow_blank %}
<option
value=
""
{%
if
not
field
.
value
%}
selected
{%
endif
%}
>
--------
</option>
{% endif %}
{% for key, text in field.choices.items %}
<option
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% endfor %}
</select>
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% endif %}
<div
class=
"col-sm-10"
>
<select
class=
"form-control"
name=
"{{ field.name }}"
>
{% if field.help_text %}
{% if field.allow_null or field.allow_blank %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
<option
value=
""
{%
if
not
field
.
value
%}
selected
{%
endif
%}
>
--------
</option>
{% endif %}
{% endif %}
</div>
{% for key, text in field.choices.items %}
<option
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% endfor %}
</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>
rest_framework/templates/rest_framework/horizontal/select_multiple.html
View file @
5e917789
...
@@ -2,22 +2,29 @@
...
@@ -2,22 +2,29 @@
{% trans "No items to select." as no_items %}
{% trans "No items to select." as no_items %}
<div
class=
"form-group"
>
<div
class=
"form-group"
>
{% if field.label %}
{% if field.label %}
<label
class=
"col-sm-2 control-label {% if 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 %}
<div
class=
"col-sm-10"
>
<select
multiple
{{
field
.
choices
|
yesno:
",
disabled
"
}}
class=
"form-control"
name=
"{{ field.name }}"
>
{% for key, text in field.choices.items %}
<option
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% empty %}
<option>
{{ no_items }}
</option>
{% endfor %}
</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 %}
{% endif %}
<div
class=
"col-sm-10"
>
</div>
<select
multiple
{{
field
.
choices
|
yesno:
",
disabled
"
}}
class=
"form-control"
name=
"{{ field.name }}"
>
{% for key, text in field.choices.items %}
<option
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% empty %}
<option>
{{ no_items }}
</option>
{% endfor %}
</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>
rest_framework/templates/rest_framework/horizontal/textarea.html
View file @
5e917789
<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=
"col-sm-2 control-label {% if 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 %}
<div
class=
"col-sm-10"
>
<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 %}
{% endif %}
<div
class=
"col-sm-10"
>
<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 %}
{% if field.errors %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% endif %}
</div>
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
</div>
</div>
</div>
rest_framework/templates/rest_framework/inline/checkbox.html
View file @
5e917789
<div
class=
"form-group {% if field.errors %}has-error{% endif %}"
>
<div
class=
"form-group {% if field.errors %}has-error{% endif %}"
>
<div
class=
"checkbox"
>
<div
class=
"checkbox"
>
<label>
<label>
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"true"
{%
if
field
.
value
%}
checked
{%
endif
%}
>
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"true"
{%
if
field
.
value
%}
checked
{%
endif
%}
>
{% if field.label %}{{ field.label }}{% endif %}
{% if field.label %}{{ field.label }}{% endif %}
</label>
</label>
</div>
</div>
</div>
</div>
rest_framework/templates/rest_framework/inline/checkbox_multiple.html
View file @
5e917789
<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 %}
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<div
class=
"checkbox"
>
<div
class=
"checkbox"
>
<label>
<label>
<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
%}
>
{{ text }}
{{ text }}
</label>
</label>
</div>
</div>
{% endfor %}
{% endfor %}
</div>
</div>
rest_framework/templates/rest_framework/inline/fieldset.html
View file @
5e917789
{% load rest_framework %}
{% load rest_framework %}
{% for nested_field in field %}
{% for nested_field in field %}
{% if not nested_field.read_only %}
{% if not nested_field.read_only %}
{% render_field nested_field style=style %}
{% render_field nested_field style=style %}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
rest_framework/templates/rest_framework/inline/form.html
View file @
5e917789
{% load rest_framework %}
{% load rest_framework %}
<form
class=
"form-inline"
role=
"form"
action=
"."
method=
"POST"
novalidate
>
<form
class=
"form-inline"
role=
"form"
action=
"."
method=
"POST"
novalidate
>
{% csrf_token %}
{% csrf_token %}
{% for field in form %}
{% if not field.read_only %}
{% for field in form %}
{% render_field field style=style %}
{% if not field.read_only %}
{% endif %}
{% render_field field style=style %}
{% endfor %}
{% endif %}
<!-- form.non_field_errors -->
{% endfor %}
<button
type=
"submit"
class=
"btn btn-default"
>
Submit
</button>
<button
type=
"submit"
class=
"btn btn-default"
>
Submit
</button>
</form>
</form>
rest_framework/templates/rest_framework/inline/input.html
View file @
5e917789
<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"
>
{% endif %}
{{ field.label }}
<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
%}
value=
"{{ field.value }}"
{%
endif
%}
>
</label>
{% endif %}
<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
%}
value=
"{{ field.value }}"
{%
endif
%}
>
</div>
</div>
rest_framework/templates/rest_framework/inline/radio.html
View file @
5e917789
...
@@ -2,23 +2,27 @@
...
@@ -2,23 +2,27 @@
{% trans "None" as none_choice %}
{% 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"
>
{% endif %}
{{ field.label }}
{% if field.allow_null or field.allow_blank %}
</label>
<div
class=
"radio"
>
{% endif %}
<label>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
""
{%
if
not
field
.
value
%}
checked
{%
endif
%}
>
{% if field.allow_null or field.allow_blank %}
{{ none_choice }}
<div
class=
"radio"
>
</label>
<label>
</div>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
""
{%
if
not
field
.
value
%}
checked
{%
endif
%}
>
{% endif %}
{{ none_choice }}
{% for key, text in field.choices.items %}
</label>
<div
class=
"radio"
>
</div>
<label>
{% endif %}
<input
type=
"radio"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
checked
{%
endif
%}
>
{{ text }}
{% for key, text in field.choices.items %}
</label>
<div
class=
"radio"
>
</div>
<label>
{% endfor %}
<input
type=
"radio"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
checked
{%
endif
%}
>
{{ text }}
</label>
</div>
{% endfor %}
</div>
</div>
rest_framework/templates/rest_framework/inline/select.html
View file @
5e917789
<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 %}
<select
class=
"form-control"
name=
"{{ field.name }}"
>
{% if field.allow_null or field.allow_blank %}
<option
value=
""
{%
if
not
field
.
value
%}
selected
{%
endif
%}
>
--------
</option>
{% endif %}
{% endif %}
<select
class=
"form-control"
name=
"{{ field.name }}"
>
{% if field.allow_null or field.allow_blank %}
{% for key, text in field.choices.items %}
<option
value=
""
{%
if
not
field
.
value
%}
selected
{%
endif
%}
>
--------
</option>
<option
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% endif %}
{% endfor %}
{% for key, text in field.choices.items %}
</select>
<option
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% endfor %}
</select>
</div>
</div>
rest_framework/templates/rest_framework/inline/select_multiple.html
View file @
5e917789
...
@@ -2,14 +2,17 @@
...
@@ -2,14 +2,17 @@
{% trans "No items to select." as no_items %}
{% trans "No items to select." as no_items %}
<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"
>
{% endif %}
{{ field.label }}
<select
multiple
{{
field
.
choices
|
yesno:
",
disabled
"
}}
class=
"form-control"
name=
"{{ field.name }}"
>
</label>
{% for key, text in field.choices.items %}
{% endif %}
<option
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% empty %}
<select
multiple
{{
field
.
choices
|
yesno:
",
disabled
"
}}
class=
"form-control"
name=
"{{ field.name }}"
>
<option>
{{ no_items }}
</option>
{% for key, text in field.choices.items %}
{% endfor %}
<option
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
</select>
{% empty %}
<option>
{{ no_items }}
</option>
{% endfor %}
</select>
</div>
</div>
rest_framework/templates/rest_framework/inline/textarea.html
View file @
5e917789
<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"
>
{% endif %}
{{ field.label }}
<input
name=
"{{ field.name }}"
type=
"text"
class=
"form-control"
{%
if
style
.
placeholder
%}
placeholder=
"{{ style.placeholder }}"
{%
endif
%}
{%
if
field
.
value
%}
value=
"{{ field.value }}"
{%
endif
%}
>
</label>
{% 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/login_base.html
View file @
5e917789
...
@@ -3,66 +3,65 @@
...
@@ -3,66 +3,65 @@
{% load staticfiles %}
{% load staticfiles %}
{% load rest_framework %}
{% load rest_framework %}
{% block body %}
{% block body %}
<body
class=
"container"
>
<body
class=
"container"
>
<div
class=
"container-fluid"
style=
"margin-top: 30px"
>
<div
class=
"row-fluid"
>
<div
class=
"well"
style=
"width: 320px; margin-left: auto; margin-right: auto"
>
<div
class=
"row-fluid"
>
<div>
{% block branding %}
<h3
style=
"margin: 0 0 20px;"
>
Django REST framework
</h3>
{% endblock %}
</div>
</div>
<!-- /row fluid -->
<div
class=
"container-fluid"
style=
"margin-top: 30px"
>
<div
class=
"row-fluid"
>
<div
class=
"row-fluid"
>
<div>
<div
class=
"well"
style=
"width: 320px; margin-left: auto; margin-right: auto"
>
<form
action=
"{% url 'rest_framework:login' %}"
role=
"form"
method=
"post"
>
<div
class=
"row-fluid"
>
{% csrf_token %}
<div>
<input
type=
"hidden"
name=
"next"
value=
"{{ next }}"
/>
{% block branding %}
<h3
style=
"margin: 0 0 20px;"
>
Django REST framework
</h3>
{% endblock %}
</div>
<div
id=
"div_id_username"
class=
"clearfix control-group {% if form.username.errors %}error{% endif %}"
>
</div>
<!-- /row fluid -->
<div
class=
"form-group"
>
<label
for=
"id_username"
>
Username:
</label>
<div
class=
"row-fluid"
>
<input
type=
"text"
name=
"username"
maxlength=
"100"
<div>
autocapitalize=
"off"
<form
action=
"{% url 'rest_framework:login' %}"
role=
"form"
method=
"post"
>
autocorrect=
"off"
class=
"form-control textinput textInput"
{% csrf_token %}
id=
"id_username"
required
<div
id=
"div_id_username"
{%
if
form
.
username
.
value
%}
value=
"{{ form.username.value }}"
{%
endif
%}
>
class=
"clearfix control-group {% if form.username.errors %}error{% endif %}"
>
{% if form.username.errors %}
<div
class=
"form-group"
>
<p
class=
"text-error"
>
<label
for=
"id_username"
>
Username:
</label>
{{ form.username.errors|striptags }}
<input
type=
"text"
name=
"username"
maxlength=
"100"
</p>
autocapitalize=
"off"
{% endif %}
autocorrect=
"off"
class=
"form-control textinput textInput"
</div>
id=
"id_username"
required
</div>
{%
if
form
.
username
.
value
%}
value=
"{{ form.username.value }}"
{%
endif
%}
>
{% if form.username.errors %}
<div
id=
"div_id_password"
class=
"clearfix control-group {% if form.password.errors %}error{% endif %}"
>
<p
class=
"text-error"
>
<div
class=
"form-group"
>
{{ form.username.errors|striptags }}
<label
for=
"id_password"
>
Password:
</label>
</p>
<input
type=
"password"
name=
"password"
maxlength=
"100"
autocapitalize=
"off"
autocorrect=
"off"
class=
"form-control textinput textInput"
id=
"id_password"
required
>
{% endif %}
{% if form.password.errors %}
</div>
<p
class=
"text-error"
>
</div>
{{ form.password.errors|striptags }}
<div
id=
"div_id_password"
</p>
class=
"clearfix control-group {% if form.password.errors %}error{% endif %}"
>
{% endif %}
<div
class=
"form-group"
>
</div>
<label
for=
"id_password"
>
Password:
</label>
</div>
<input
type=
"password"
name=
"password"
maxlength=
"100"
autocapitalize=
"off"
autocorrect=
"off"
class=
"form-control textinput textInput"
{% if form.non_field_errors %}
id=
"id_password"
required
>
{% for error in form.non_field_errors %}
{% if form.password.errors %}
<div
class=
"well well-small text-error"
style=
"border: none"
>
{{ error }}
</div>
<p
class=
"text-error"
>
{% endfor %}
{{ form.password.errors|striptags }}
{% endif %}
</p>
{% endif %}
<div
class=
"form-actions-no-box"
>
</div>
<input
type=
"submit"
name=
"submit"
value=
"Log in"
class=
"btn btn-primary form-control"
id=
"submit-id-submit"
>
</div>
</div>
<input
type=
"hidden"
name=
"next"
value=
"{{ next }}"
/>
</form>
{% if form.non_field_errors %}
</div>
{% for error in form.non_field_errors %}
</div>
<!-- /.row-fluid -->
<div
class=
"well well-small text-error"
style=
"border: none"
>
{{ error }}
</div>
</div>
<!--/.well-->
{% endfor %}
</div>
<!-- /.row-fluid -->
{% endif %}
</div>
<!-- /.container-fluid -->
<div
class=
"form-actions-no-box"
>
</body>
<input
type=
"submit"
name=
"submit"
value=
"Log in"
class=
"btn btn-primary form-control"
id=
"submit-id-submit"
>
{% endblock %}
</div>
</form>
</div>
</div>
<!-- /.row-fluid -->
</div>
<!--/.well-->
</div>
<!-- /.row-fluid -->
</div>
<!-- /.container-fluid -->
</body>
{% endblock %}
rest_framework/templates/rest_framework/pagination/numbers.html
View file @
5e917789
<ul
class=
"pagination"
style=
"margin: 5px 0 10px 0"
>
<ul
class=
"pagination"
style=
"margin: 5px 0 10px 0"
>
{% if previous_url %}
{% if previous_url %}
<li><a
href=
"{{ previous_url }}"
aria-label=
"Previous"
><span
aria-hidden=
"true"
>
«
</span></a></li>
<li>
{% else %}
<a
href=
"{{ previous_url }}"
aria-label=
"Previous"
>
<li
class=
"disabled"
><a
href=
"#"
aria-label=
"Previous"
><span
aria-hidden=
"true"
>
«
</span></a></li>
<span
aria-hidden=
"true"
>
«
</span>
{% endif %}
</a>
</li>
{% else %}
<li
class=
"disabled"
>
<a
href=
"#"
aria-label=
"Previous"
>
<span
aria-hidden=
"true"
>
«
</span>
</a>
</li>
{% endif %}
{% for page_link in page_links %}
{% for page_link in page_links %}
{% if page_link.is_break %}
{% if page_link.is_break %}
<li
class=
"disabled"
>
<li
class=
"disabled"
>
<a
href=
"#"
><span
aria-hidden=
"true"
>
…
</span></a>
<a
href=
"#"
><span
aria-hidden=
"true"
>
…
</span></a>
</li>
</li>
{% else %}
{% if page_link.is_active %}
<li
class=
"active"
><a
href=
"{{ page_link.url }}"
>
{{ page_link.number }}
</a></li>
{% else %}
<li><a
href=
"{{ page_link.url }}"
>
{{ page_link.number }}
</a></li>
{% endif %}
{% endif %}
{% endfor %}
{% if next_url %}
<li><a
href=
"{{ next_url }}"
aria-label=
"Next"
><span
aria-hidden=
"true"
>
»
</span></a></li>
{% else %}
{% else %}
<li
class=
"disabled"
><a
href=
"#"
aria-label=
"Next"
><span
aria-hidden=
"true"
>
»
</span></a></li>
{% if page_link.is_active %}
<li
class=
"active"
>
<a
href=
"{{ page_link.url }}"
>
{{ page_link.number }}
</a>
</li>
{% else %}
<li>
<a
href=
"{{ page_link.url }}"
>
{{ page_link.number }}
</a>
</li>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% if next_url %}
<li>
<a
href=
"{{ next_url }}"
aria-label=
"Next"
>
<span
aria-hidden=
"true"
>
»
</span>
</a>
</li>
{% else %}
<li
class=
"disabled"
>
<a
href=
"#"
aria-label=
"Next"
>
<span
aria-hidden=
"true"
>
»
</span>
</a>
</li>
{% endif %}
</ul>
</ul>
rest_framework/templates/rest_framework/pagination/previous_and_next.html
View file @
5e917789
<ul
class=
"pager"
>
<ul
class=
"pager"
>
{% if previous_url %}
{% if previous_url %}
<li
class=
"previous"
><a
href=
"{{ previous_url }}"
>
«
Previous
</a></li>
<li
class=
"previous"
>
{% else %}
<a
href=
"{{ previous_url }}"
>
«
Previous
</a>
<li
class=
"previous disabled"
><a
href=
"#"
>
«
Previous
</a></li>
</li>
{% endif %}
{% else %}
{% if next_url %}
<li
class=
"previous disabled"
>
<li
class=
"next"
><a
href=
"{{ next_url }}"
>
Next
»
</a></li>
<a
href=
"#"
>
«
Previous
</a>
{% else %}
</li>
<li
class=
"next disabled"
><a
href=
"#"
>
Next
»
</a></li>
{% endif %}
{% endif %}
{% if next_url %}
<li
class=
"next"
>
<a
href=
"{{ next_url }}"
>
Next
»
</a>
</li>
{% else %}
<li
class=
"next disabled"
>
<a
href=
"#"
>
Next
»
</a>
</li>
{% endif %}
</ul>
</ul>
rest_framework/templates/rest_framework/raw_data_form.html
View file @
5e917789
...
@@ -2,11 +2,11 @@
...
@@ -2,11 +2,11 @@
{% csrf_token %}
{% csrf_token %}
{{ form.non_field_errors }}
{{ form.non_field_errors }}
{% for field in form %}
{% for field in form %}
<div
class=
"form-group"
>
<div
class=
"form-group"
>
{{ field.label_tag|add_class:"col-sm-2 control-label" }}
{{ field.label_tag|add_class:"col-sm-2 control-label" }}
<div
class=
"col-sm-10"
>
<div
class=
"col-sm-10"
>
{{ field|add_class:"form-control" }}
{{ field|add_class:"form-control" }}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
</div>
</div>
</div>
</div>
{% endfor %}
{% endfor %}
rest_framework/templates/rest_framework/vertical/checkbox.html
View file @
5e917789
<div
class=
"form-group {% if field.errors %}has-error{% endif %}"
>
<div
class=
"form-group {% if field.errors %}has-error{% endif %}"
>
<div
class=
"checkbox"
>
<div
class=
"checkbox"
>
<label>
<label>
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"true"
{%
if
value
%}
checked
{%
endif
%}
>
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"true"
{%
if
value
%}
checked
{%
endif
%}
>
{% 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 %}
{% if field.errors %}
{% endif %}
{% for error in field.errors %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ error }}
</span>
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endfor %}
{% endif %}
{% endif %}
</div>
\ No newline at end of file
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
</div>
rest_framework/templates/rest_framework/vertical/checkbox_multiple.html
View file @
5e917789
<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 %}
<div>
{% if style.inline %}
{% for key, text in field.choices.items %}
<div>
<label
class=
"checkbox-inline"
>
{% for key, text in field.choices.items %}
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
checked
{%
endif
%}
>
<label
class=
"checkbox-inline"
>
{{ text }}
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
checked
{%
endif
%}
>
</label>
{{ text }}
{% endfor %}
</label>
</div>
{% endfor %}
{% else %}
</div>
{% for key, text in field.choices.items %}
{% else %}
<div
class=
"checkbox"
>
{% for key, text in field.choices.items %}
<label>
<div
class=
"checkbox"
>
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
checked
{%
endif
%}
>
<label>
{{ text }}
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
checked
{%
endif
%}
>
</label>
{{ text }}
</div>
</label>
{% endfor %}
</div>
{% endif %}
{% endfor %}
{% if field.errors %}
{% endif %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% if field.errors %}
{% if field.help_text %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
<span
class=
"help-block"
>
{{ error }}
</span>
{% endif %}
{% endfor %}
{% endif %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
</div>
</div>
rest_framework/templates/rest_framework/vertical/fieldset.html
View file @
5e917789
{% load rest_framework %}
{% load rest_framework %}
<fieldset>
<fieldset>
{% if field.label %}
<legend
{%
if
style
.
hide_label
%}
class=
"sr-only"
{%
endif
%}
>
{{ field.label }}
</legend>
{% endif %}
{% if field.label %}
{% for nested_field in field %}
<legend
{%
if
style
.
hide_label
%}
class=
"sr-only"
{%
endif
%}
>
{% if not nested_field.read_only %}
{{ field.label }}
{% render_field nested_field style=style %}
</legend>
{% endif %}
{% endif %}
{% endfor %}
{% for nested_field in field %}
{% if not nested_field.read_only %}
{% render_field nested_field style=style %}
{% endif %}
{% endfor %}
</fieldset>
</fieldset>
rest_framework/templates/rest_framework/vertical/form.html
View file @
5e917789
{% load rest_framework %}
{% load rest_framework %}
<form
role=
"form"
action=
"."
method=
"POST"
novalidate
>
<form
role=
"form"
action=
"."
method=
"POST"
novalidate
>
{% csrf_token %}
{% csrf_token %}
{% for field in form %}
{% for field in form %}
{% if not field.read_only %}
{% if not field.read_only %}
{% render_field field style=style %}
{% render_field field style=style %}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
<!-- form.non_field_errors -->
<button
type=
"submit"
class=
"btn btn-default"
>
Submit
</button>
<button
type=
"submit"
class=
"btn btn-default"
>
Submit
</button>
</form>
</form>
rest_framework/templates/rest_framework/vertical/input.html
View file @
5e917789
<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 %}
<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
%}
value=
"{{ field.value }}"
{%
endif
%}
>
{% if field.errors %}
<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
%}
value=
"{{ field.value }}"
{%
endif
%}
>
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% if field.errors %}
{% if field.help_text %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
<span
class=
"help-block"
>
{{ error }}
</span>
{% endif %}
{% endfor %}
{% endif %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
</div>
</div>
rest_framework/templates/rest_framework/vertical/list_fieldset.html
View file @
5e917789
<fieldset>
<fieldset>
{% if field.label %}
<legend
{%
if
style
.
hide_label
%}
class=
"sr-only"
{%
endif
%}
>
{{ field.label }}
</legend>
{% endif %}
{% if field.label %}
<p>
Lists are not currently supported in HTML input.
</p>
<legend
{%
if
style
.
hide_label
%}
class=
"sr-only"
{%
endif
%}
>
{{ field.label }}
</legend>
{% endif %}
<p>
Lists are not currently supported in HTML input.
</p>
</fieldset>
</fieldset>
rest_framework/templates/rest_framework/vertical/radio.html
View file @
5e917789
...
@@ -2,46 +2,55 @@
...
@@ -2,46 +2,55 @@
{% trans "None" as none_choice %}
{% 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
%}
>
{% endif %}
{{ field.label }}
</label>
{% endif %}
{% if style.inline %}
{% if style.inline %}
<div>
<div>
{% 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
%}
/>
{{ none_choice }}
{{ none_choice }}
</label>
</label>
{% endif %}
{% 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
%}
>
{{ text }}
{{ text }}
</label>
</label>
{% endfor %}
{% endfor %}
</div>
</div>
{% else %}
{% else %}
{% if field.allow_null or field.allow_blank %}
{% if field.allow_null or field.allow_blank %}
<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
%}
/>
{{ none_choice }}
{{ none_choice }}
</label>
</label>
</div>
</div>
{% endif %}
{% endif %}
{% for key, text in field.choices.items %}
<div
class=
"radio"
>
{% for key, text in field.choices.items %}
<label>
<div
class=
"radio"
>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
checked
{%
endif
%}
>
<label>
{{ text }}
<input
type=
"radio"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
checked
{%
endif
%}
>
</label>
{{ text }}
</div>
</label>
{% endfor %}
</div>
{% endfor %}
{% endif %}
{% endif %}
{% if field.errors %}
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% endif %}
{% if field.help_text %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
{% endif %}
</div>
</div>
rest_framework/templates/rest_framework/vertical/select.html
View file @
5e917789
<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
%}
>
{% endif %}
{{ field.label }}
<select
class=
"form-control"
name=
"{{ field.name }}"
>
</label>
{% if field.allow_null or field.allow_blank %}
{% endif %}
<option
value=
""
{%
if
not
field
.
value
%}
selected
{%
endif
%}
>
--------
</option>
{% endif %}
<select
class=
"form-control"
name=
"{{ field.name }}"
>
{% for key, text in field.choices.items %}
{% if field.allow_null or field.allow_blank %}
<option
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
<option
value=
""
{%
if
not
field
.
value
%}
selected
{%
endif
%}
>
--------
</option>
{% endfor %}
</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 %}
{% endif %}
{% for key, text in field.choices.items %}
<option
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% endfor %}
</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/select_multiple.html
View file @
5e917789
...
@@ -2,20 +2,25 @@
...
@@ -2,20 +2,25 @@
{% trans "No items to select." as no_items %}
{% trans "No items to select." as no_items %}
<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
%}
>
{% endif %}
{{ field.label }}
<select
multiple
{{
field
.
choices
|
yesno:
",
disabled
"
}}
class=
"form-control"
name=
"{{ field.name }}"
>
</label>
{% for key, text in field.choices.items %}
{% endif %}
<option
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% empty %}
<select
multiple
{{
field
.
choices
|
yesno:
",
disabled
"
}}
class=
"form-control"
name=
"{{ field.name }}"
>
<option>
{{ no_items }}
</option>
{% for key, text in field.choices.items %}
{% endfor %}
<option
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
</select>
{% empty %}
<option>
{{ no_items }}
</option>
{% endfor %}
</select>
{% if field.errors %}
{% if field.errors %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% endif %}
{% endif %}
{% if field.help_text %}
{% if field.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% endif %}
{% endif %}
</div>
</div>
rest_framework/templates/rest_framework/vertical/textarea.html
View file @
5e917789
<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
%}
>
{% endif %}
{{ field.label }}
<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>
</label>
{% if field.errors %}
{% endif %}
{% for error in field.errors %}
<span
class=
"help-block"
>
{{ error }}
</span>
{% endfor %}
{% 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.help_text %}
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
{% if field.errors %}
{% endif %}
{% 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>
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