mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 09:36:49 +03:00
Consistent 2 space tabbing and formatting
This commit is contained in:
parent
e368986fcf
commit
5e917789ec
|
@ -57,12 +57,10 @@
|
|||
<body onload="prettyPrint()" class="{% if current_page and current_page.is_homepage %}index{% endif %}-page">
|
||||
|
||||
<div class="wrapper">
|
||||
|
||||
{% include "nav.html" %}
|
||||
|
||||
<div class="body-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- Search Modal -->
|
||||
<div id="mkdocs_search_modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-header">
|
||||
|
@ -85,17 +83,9 @@
|
|||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<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">
|
||||
<ul class="nav nav-list side-nav well sidebar-nav-fixed">
|
||||
|
||||
{% if current_page and current_page.is_homepage %}
|
||||
<li class="main">
|
||||
<a href="#">Django REST framework</a>
|
||||
|
@ -103,7 +93,6 @@
|
|||
{% endif %}
|
||||
|
||||
{% for toc_item in toc %}
|
||||
|
||||
<li class="{% if current_page and not current_page.is_homepage %}main{% endif %}">
|
||||
<a href="{{ toc_item.url }}">{{ toc_item.title }}</a>
|
||||
</li>
|
||||
|
@ -113,7 +102,6 @@
|
|||
<a href="{{ toc_item.url }}">{{ toc_item.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% if current_page and current_page.is_homepage %}
|
||||
|
@ -122,16 +110,13 @@
|
|||
<script type="text/javascript" src="//cdn.fusionads.net/fusion.js?zoneid=1332&serve=C6SDP2Y&placement=djangorestframework" id="_fusionads_js"></script>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="main-content" class="span9">
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if meta.source %}
|
||||
{% for filename in meta.source %}
|
||||
<a class="github" href="https://github.com/tomchristie/django-rest-framework/tree/master/rest_framework/{{ filename }}">
|
||||
|
@ -141,20 +126,14 @@
|
|||
{% endif %}
|
||||
|
||||
{{ content }}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
</div>
|
||||
<!--/span-->
|
||||
</div>
|
||||
<!--/row-->
|
||||
</div>
|
||||
<!--/.fluid-container-->
|
||||
</div>
|
||||
<!--/.body content-->
|
||||
</div> <!--/span-->
|
||||
</div> <!--/row-->
|
||||
</div> <!--/.fluid-container-->
|
||||
</div> <!--/.body content-->
|
||||
<div id="push"></div>
|
||||
</div>
|
||||
<!--/.wrapper -->
|
||||
</div> <!--/.wrapper -->
|
||||
|
||||
<footer class="span12">
|
||||
<p>Documentation built with <a href="http://www.mkdocs.org/">MkDocs</a>.</a>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{% load rest_framework %}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<head>
|
||||
{% block head %}
|
||||
|
||||
{% block meta %}
|
||||
|
@ -18,18 +18,18 @@
|
|||
<link rel="stylesheet" type="text/css" href="{% static "rest_framework/css/bootstrap.min.css" %}"/>
|
||||
<link rel="stylesheet" type="text/css" href="{% static "rest_framework/css/bootstrap-tweaks.css" %}"/>
|
||||
{% endblock %}
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{% static "rest_framework/css/prettify.css" %}"/>
|
||||
<link rel="stylesheet" type="text/css" href="{% static "rest_framework/css/default.css" %}"/>
|
||||
{% endblock %}
|
||||
|
||||
{% endblock %}
|
||||
</head>
|
||||
</head>
|
||||
|
||||
{% block body %}
|
||||
<body class="{% block bodyclass %}{% endblock %}">
|
||||
{% block body %}
|
||||
<body class="{% block bodyclass %}{% endblock %}">
|
||||
|
||||
<div class="wrapper">
|
||||
|
||||
{% block navbar %}
|
||||
<div class="navbar navbar-static-top {% block bootstrap_navbar_variant %}navbar-inverse{% endblock %}">
|
||||
<div class="container">
|
||||
|
@ -73,22 +73,15 @@
|
|||
<form id="get-form" class="pull-right">
|
||||
<fieldset>
|
||||
<div class="btn-group format-selection">
|
||||
<a class="btn btn-primary js-tooltip" href='{{ request.get_full_path }}'
|
||||
rel="nofollow" title="Make a GET request on the {{ name }} resource">GET</a>
|
||||
<a class="btn btn-primary js-tooltip" href='{{ request.get_full_path }}' rel="nofollow" title="Make a GET request on the {{ name }} resource">GET</a>
|
||||
|
||||
<button class="btn btn-primary dropdown-toggle js-tooltip" data-toggle="dropdown"
|
||||
title="Specify a format for the GET request">
|
||||
<button class="btn btn-primary dropdown-toggle js-tooltip" data-toggle="dropdown" title="Specify a format for the GET request">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{% for format in available_formats %}
|
||||
<li>
|
||||
<a class="js-tooltip format-option"
|
||||
href='{% add_query_param request api_settings.URL_FORMAT_OVERRIDE format %}'
|
||||
rel="nofollow"
|
||||
title="Make a GET request on the {{ name }} resource with the format set to `{{ format }}`">
|
||||
{{ format }}
|
||||
</a>
|
||||
<a class="js-tooltip format-option" href='{% add_query_param request api_settings.URL_FORMAT_OVERRIDE format %}' rel="nofollow" title="Make a GET request on the {{ name }} resource with the format set to `{{ format }}`">{{ format }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
@ -101,8 +94,7 @@
|
|||
<form class="button-form" action="{{ request.get_full_path }}" method="POST">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="{{ api_settings.FORM_METHOD_OVERRIDE }}" value="OPTIONS" />
|
||||
<button class="btn btn-primary js-tooltip"
|
||||
title="Make an OPTIONS request on the {{ name }} resource">OPTIONS</button>
|
||||
<button class="btn btn-primary js-tooltip" title="Make an OPTIONS request on the {{ name }} resource">OPTIONS</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
|
@ -110,8 +102,7 @@
|
|||
<form class="button-form" action="{{ request.get_full_path }}" method="POST">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="{{ api_settings.FORM_METHOD_OVERRIDE }}" value="DELETE" />
|
||||
<button class="btn btn-danger js-tooltip"
|
||||
title="Make a DELETE request on the {{ name }} resource">DELETE</button>
|
||||
<button class="btn btn-danger js-tooltip" title="Make a DELETE request on the {{ name }} resource">DELETE</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
|
@ -134,6 +125,7 @@
|
|||
<div class="request-info" style="clear: both" >
|
||||
<pre class="prettyprint"><b>{{ request.method }}</b> {{ request.get_full_path }}</pre>
|
||||
</div>
|
||||
|
||||
<div class="response-info">
|
||||
<pre class="prettyprint"><span class="meta nocode"><b>HTTP {{ response.status_code }} {{ response.status_text }}</b>{% autoescape off %}
|
||||
{% for key, val in response_headers.items %}<b>{{ key }}:</b> <span class="lit">{{ val|break_long_headers|urlize_quoted_links }}</span>
|
||||
|
@ -156,31 +148,30 @@
|
|||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
<div class="well tab-content">
|
||||
{% if post_form %}
|
||||
<div class="tab-pane" id="post-object-form">
|
||||
{% with form=post_form %}
|
||||
<form action="{{ request.get_full_path }}"
|
||||
method="POST" enctype="multipart/form-data" class="form-horizontal" novalidate>
|
||||
<form action="{{ request.get_full_path }}" method="POST" enctype="multipart/form-data" class="form-horizontal" novalidate>
|
||||
<fieldset>
|
||||
{{ post_form }}
|
||||
<div class="form-actions">
|
||||
<button class="btn btn-primary"
|
||||
title="Make a POST request on the {{ name }} resource">POST</button>
|
||||
<button class="btn btn-primary" title="Make a POST request on the {{ name }} resource">POST</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
{% endwith %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div {% if post_form %}class="tab-pane"{% endif %} id="post-generic-content-form">
|
||||
{% with form=raw_data_post_form %}
|
||||
<form action="{{ request.get_full_path }}" method="POST" class="form-horizontal">
|
||||
<fieldset>
|
||||
{% include "rest_framework/raw_data_form.html" %}
|
||||
<div class="form-actions">
|
||||
<button class="btn btn-primary"
|
||||
title="Make a POST request on the {{ name }} resource">POST</button>
|
||||
<button class="btn btn-primary" title="Make a POST request on the {{ name }} resource">POST</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
@ -202,22 +193,21 @@
|
|||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
<div class="well tab-content">
|
||||
{% if put_form %}
|
||||
<div class="tab-pane" id="put-object-form">
|
||||
<form action="{{ request.get_full_path }}"
|
||||
method="POST" enctype="multipart/form-data" class="form-horizontal" novalidate>
|
||||
<form action="{{ request.get_full_path }}" method="POST" enctype="multipart/form-data" class="form-horizontal" novalidate>
|
||||
<fieldset>
|
||||
{{ put_form }}
|
||||
<div class="form-actions">
|
||||
<button class="btn btn-primary js-tooltip"
|
||||
name="{{ api_settings.FORM_METHOD_OVERRIDE }}"
|
||||
value="PUT" title="Make a PUT request on the {{ name }} resource">PUT</button>
|
||||
<button class="btn btn-primary js-tooltip" name="{{ api_settings.FORM_METHOD_OVERRIDE }}" value="PUT" title="Make a PUT request on the {{ name }} resource">PUT</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div {% if put_form %}class="tab-pane"{% endif %} id="put-generic-content-form">
|
||||
{% with form=raw_data_put_or_patch_form %}
|
||||
<form action="{{ request.get_full_path }}" method="POST" class="form-horizontal">
|
||||
|
@ -225,14 +215,10 @@
|
|||
{% include "rest_framework/raw_data_form.html" %}
|
||||
<div class="form-actions">
|
||||
{% if raw_data_put_form %}
|
||||
<button class="btn btn-primary js-tooltip"
|
||||
name="{{ api_settings.FORM_METHOD_OVERRIDE }}"
|
||||
value="PUT" title="Make a PUT request on the {{ name }} resource">PUT</button>
|
||||
<button class="btn btn-primary js-tooltip" name="{{ api_settings.FORM_METHOD_OVERRIDE }}" value="PUT" title="Make a PUT request on the {{ name }} resource">PUT</button>
|
||||
{% endif %}
|
||||
{% if raw_data_patch_form %}
|
||||
<button class="btn btn-primary js-tooltip"
|
||||
name="{{ api_settings.FORM_METHOD_OVERRIDE }}"
|
||||
value="PATCH" title="Make a PATCH request on the {{ name }} resource">PATCH</button>
|
||||
<button class="btn btn-primary js-tooltip" name="{{ api_settings.FORM_METHOD_OVERRIDE }}" value="PATCH" title="Make a PATCH request on the {{ name }} resource">PATCH</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</fieldset>
|
||||
|
@ -243,8 +229,7 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<!-- END Content -->
|
||||
</div><!-- /.content -->
|
||||
</div><!-- /.container -->
|
||||
</div><!-- ./wrapper -->
|
||||
|
||||
|
@ -254,6 +239,6 @@
|
|||
<script src="{% static "rest_framework/js/prettify-min.js" %}"></script>
|
||||
<script src="{% static "rest_framework/js/default.js" %}"></script>
|
||||
{% endblock %}
|
||||
</body>
|
||||
{% endblock %}
|
||||
</body>
|
||||
{% endblock %}
|
||||
</html>
|
||||
|
|
|
@ -6,9 +6,13 @@
|
|||
{% if field.label %}{{ field.label }}{% endif %}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{% 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 %}
|
||||
|
||||
{% if field.help_text %}
|
||||
<span class="help-block">{{ field.help_text }}</span>
|
||||
{% endif %}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<div class="form-group">
|
||||
{% 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">
|
||||
{% if style.inline %}
|
||||
{% for key, text in field.choices.items %}
|
||||
|
@ -20,9 +23,13 @@
|
|||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% 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 %}
|
||||
|
||||
{% if field.help_text %}
|
||||
<span class="help-block">{{ field.help_text }}</span>
|
||||
{% endif %}
|
||||
|
|
|
@ -2,9 +2,12 @@
|
|||
<fieldset>
|
||||
{% if field.label %}
|
||||
<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">
|
||||
{{ field.label }}
|
||||
</legend>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% for nested_field in field %}
|
||||
{% if not nested_field.read_only %}
|
||||
{% render_field nested_field style=style %}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{% load rest_framework %}
|
||||
|
||||
<form class="form-horizontal" role="form" action="." method="POST" novalidate>
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
|
@ -6,7 +7,7 @@
|
|||
{% render_field field style=style %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<!-- form.non_field_errors -->
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-default">Submit</button>
|
||||
|
|
|
@ -1,12 +1,19 @@
|
|||
<div class="form-group {% if field.errors %}has-error{% endif %}">
|
||||
{% 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 %}
|
||||
{% 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 %}
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
{% load rest_framework %}
|
||||
|
||||
<fieldset>
|
||||
{% if field.label %}
|
||||
<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">
|
||||
{{ field.label }}
|
||||
</legend>
|
||||
</div>
|
||||
{% endif %}
|
||||
<!--
|
||||
<ul>
|
||||
{% for child in field.value %}
|
||||
<li>TODO</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
-->
|
||||
|
||||
<p>Lists are not currently supported in HTML input.</p>
|
||||
</fieldset>
|
||||
|
|
|
@ -3,8 +3,11 @@
|
|||
|
||||
<div class="form-group">
|
||||
{% 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">
|
||||
{% if style.inline %}
|
||||
{% if field.allow_null or field.allow_blank %}
|
||||
|
@ -13,6 +16,7 @@
|
|||
{{ none_choice }}
|
||||
</label>
|
||||
{% endif %}
|
||||
|
||||
{% for key, text in field.choices.items %}
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="{{ field.name }}" value="{{ key }}" {% if key == field.value %}checked{% endif %} />
|
||||
|
@ -37,9 +41,13 @@
|
|||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% 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 %}
|
||||
|
||||
{% if field.help_text %}
|
||||
<span class="help-block">{{ field.help_text }}</span>
|
||||
{% endif %}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<div class="form-group">
|
||||
{% 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 %}
|
||||
|
@ -11,9 +14,13 @@
|
|||
<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 %}
|
||||
{% 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 %}
|
||||
|
|
|
@ -3,8 +3,11 @@
|
|||
|
||||
<div class="form-group">
|
||||
{% 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 %}
|
||||
|
@ -13,9 +16,13 @@
|
|||
<option>{{ no_items }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
{% 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 %}
|
||||
|
||||
{% if field.help_text %}
|
||||
<span class="help-block">{{ field.help_text }}</span>
|
||||
{% endif %}
|
||||
|
|
|
@ -1,12 +1,19 @@
|
|||
<div class="form-group {% if field.errors %}has-error{% endif %}">
|
||||
{% 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 %}
|
||||
{% 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 %}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
{% if field.label %}
|
||||
<label class="sr-only">{{ field.label }}</label>
|
||||
{% endif %}
|
||||
|
||||
{% for key, text in field.choices.items %}
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
{% load rest_framework %}
|
||||
|
||||
<form class="form-inline" role="form" action="." method="POST" novalidate>
|
||||
{% csrf_token %}
|
||||
|
||||
{% for field in form %}
|
||||
{% if not field.read_only %}
|
||||
{% render_field field style=style %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<!-- form.non_field_errors -->
|
||||
|
||||
<button type="submit" class="btn btn-default">Submit</button>
|
||||
</form>
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<div class="form-group {% if field.errors %}has-error{% endif %}">
|
||||
{% if field.label %}
|
||||
<label class="sr-only">{{ field.label }}</label>
|
||||
<label class="sr-only">
|
||||
{{ field.label }}
|
||||
</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>
|
||||
|
|
|
@ -3,8 +3,11 @@
|
|||
|
||||
<div class="form-group {% if field.errors %}has-error{% endif %}">
|
||||
{% if field.label %}
|
||||
<label class="sr-only">{{ field.label }}</label>
|
||||
<label class="sr-only">
|
||||
{{ field.label }}
|
||||
</label>
|
||||
{% endif %}
|
||||
|
||||
{% if field.allow_null or field.allow_blank %}
|
||||
<div class="radio">
|
||||
<label>
|
||||
|
@ -13,6 +16,7 @@
|
|||
</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% for key, text in field.choices.items %}
|
||||
<div class="radio">
|
||||
<label>
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
<div class="form-group {% if field.errors %}has-error{% endif %}">
|
||||
{% 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 %}
|
||||
|
||||
{% for key, text in field.choices.items %}
|
||||
<option value="{{ key }}" {% if key == field.value %}selected{% endif %}>{{ text }}</option>
|
||||
{% endfor %}
|
||||
|
|
|
@ -3,8 +3,11 @@
|
|||
|
||||
<div class="form-group {% if field.errors %}has-error{% endif %}">
|
||||
{% if field.label %}
|
||||
<label class="sr-only">{{ field.label }}</label>
|
||||
<label class="sr-only">
|
||||
{{ field.label }}
|
||||
</label>
|
||||
{% endif %}
|
||||
|
||||
<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>
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<div class="form-group {% if field.errors %}has-error{% endif %}">
|
||||
{% if field.label %}
|
||||
<label class="sr-only">{{ field.label }}</label>
|
||||
<label class="sr-only">
|
||||
{{ field.label }}
|
||||
</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>
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
{% load staticfiles %}
|
||||
{% load rest_framework %}
|
||||
|
||||
{% block body %}
|
||||
<body class="container">
|
||||
|
||||
{% block body %}
|
||||
<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">
|
||||
|
@ -19,8 +18,9 @@
|
|||
<div>
|
||||
<form action="{% url 'rest_framework:login' %}" role="form" method="post">
|
||||
{% csrf_token %}
|
||||
<div id="div_id_username"
|
||||
class="clearfix control-group {% if form.username.errors %}error{% endif %}">
|
||||
<input type="hidden" name="next" value="{{ next }}" />
|
||||
|
||||
<div id="div_id_username" class="clearfix control-group {% if form.username.errors %}error{% endif %}">
|
||||
<div class="form-group">
|
||||
<label for="id_username">Username:</label>
|
||||
<input type="text" name="username" maxlength="100"
|
||||
|
@ -35,13 +35,11 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div id="div_id_password"
|
||||
class="clearfix control-group {% if form.password.errors %}error{% endif %}">
|
||||
|
||||
<div id="div_id_password" class="clearfix control-group {% if form.password.errors %}error{% endif %}">
|
||||
<div class="form-group">
|
||||
<label for="id_password">Password:</label>
|
||||
<input type="password" name="password" maxlength="100"
|
||||
autocapitalize="off" autocorrect="off" class="form-control textinput textInput"
|
||||
id="id_password" required>
|
||||
<input type="password" name="password" maxlength="100" autocapitalize="off" autocorrect="off" class="form-control textinput textInput" id="id_password" required>
|
||||
{% if form.password.errors %}
|
||||
<p class="text-error">
|
||||
{{ form.password.errors|striptags }}
|
||||
|
@ -49,12 +47,13 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="next" value="{{ next }}" />
|
||||
|
||||
{% if form.non_field_errors %}
|
||||
{% for error in form.non_field_errors %}
|
||||
<div class="well well-small text-error" style="border: none">{{ error }}</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<div class="form-actions-no-box">
|
||||
<input type="submit" name="submit" value="Log in" class="btn btn-primary form-control" id="submit-id-submit">
|
||||
</div>
|
||||
|
@ -64,5 +63,5 @@
|
|||
</div><!--/.well-->
|
||||
</div><!-- /.row-fluid -->
|
||||
</div><!-- /.container-fluid -->
|
||||
</body>
|
||||
{% endblock %}
|
||||
</body>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,8 +1,16 @@
|
|||
<ul class="pagination" style="margin: 5px 0 10px 0">
|
||||
{% if previous_url %}
|
||||
<li><a href="{{ previous_url }}" aria-label="Previous"><span aria-hidden="true">«</span></a></li>
|
||||
<li>
|
||||
<a href="{{ previous_url }}" aria-label="Previous">
|
||||
<span aria-hidden="true">«</span>
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="disabled"><a href="#" aria-label="Previous"><span aria-hidden="true">«</span></a></li>
|
||||
<li class="disabled">
|
||||
<a href="#" aria-label="Previous">
|
||||
<span aria-hidden="true">«</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% for page_link in page_links %}
|
||||
|
@ -12,16 +20,28 @@
|
|||
</li>
|
||||
{% else %}
|
||||
{% if page_link.is_active %}
|
||||
<li class="active"><a href="{{ page_link.url }}">{{ page_link.number }}</a></li>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<li class="disabled">
|
||||
<a href="#" aria-label="Next">
|
||||
<span aria-hidden="true">»</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
|
|
@ -1,12 +1,21 @@
|
|||
<ul class="pager">
|
||||
{% if previous_url %}
|
||||
<li class="previous"><a href="{{ previous_url }}">« Previous</a></li>
|
||||
{% else %}
|
||||
<li class="previous disabled"><a href="#">« Previous</a></li>
|
||||
{% 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 %}
|
||||
{% if previous_url %}
|
||||
<li class="previous">
|
||||
<a href="{{ previous_url }}">« Previous</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="previous disabled">
|
||||
<a href="#">« Previous</a>
|
||||
</li>
|
||||
{% 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>
|
||||
|
|
|
@ -5,9 +5,13 @@
|
|||
{% if field.label %}{{ field.label }}{% endif %}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{% 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 %}
|
||||
|
||||
{% if field.help_text %}
|
||||
<span class="help-block">{{ field.help_text }}</span>
|
||||
{% endif %}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
{% if field.label %}
|
||||
<label {% if style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</label>
|
||||
{% endif %}
|
||||
|
||||
{% if style.inline %}
|
||||
<div>
|
||||
{% for key, text in field.choices.items %}
|
||||
|
@ -21,9 +22,13 @@
|
|||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% 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 %}
|
||||
|
||||
{% if field.help_text %}
|
||||
<span class="help-block">{{ field.help_text }}</span>
|
||||
{% endif %}
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
{% load rest_framework %}
|
||||
|
||||
<fieldset>
|
||||
{% if field.label %}<legend {% if 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 %}
|
||||
{% if not nested_field.read_only %}
|
||||
{% render_field nested_field style=style %}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{% load rest_framework %}
|
||||
|
||||
<form role="form" action="." method="POST" novalidate>
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
|
@ -6,6 +7,6 @@
|
|||
{% render_field field style=style %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<!-- form.non_field_errors -->
|
||||
|
||||
<button type="submit" class="btn btn-default">Submit</button>
|
||||
</form>
|
||||
|
|
|
@ -2,10 +2,15 @@
|
|||
{% if field.label %}
|
||||
<label {% if style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</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 %}>
|
||||
|
||||
{% 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 %}
|
||||
|
||||
{% if field.help_text %}
|
||||
<span class="help-block">{{ field.help_text }}</span>
|
||||
{% endif %}
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
<fieldset>
|
||||
{% if field.label %}<legend {% if 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 %}
|
||||
|
||||
<p>Lists are not currently supported in HTML input.</p>
|
||||
</fieldset>
|
||||
|
|
|
@ -3,8 +3,11 @@
|
|||
|
||||
<div class="form-group {% if field.errors %}has-error{% endif %}">
|
||||
{% 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 %}
|
||||
|
||||
{% if style.inline %}
|
||||
<div>
|
||||
{% if field.allow_null or field.allow_blank %}
|
||||
|
@ -13,6 +16,7 @@
|
|||
{{ none_choice }}
|
||||
</label>
|
||||
{% endif %}
|
||||
|
||||
{% for key, text in field.choices.items %}
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="{{ field.name }}" value="{{ key }}" {% if key == field.value %}checked{% endif %}>
|
||||
|
@ -29,6 +33,7 @@
|
|||
</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% for key, text in field.choices.items %}
|
||||
<div class="radio">
|
||||
<label>
|
||||
|
@ -38,9 +43,13 @@
|
|||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% 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 %}
|
||||
|
||||
{% if field.help_text %}
|
||||
<span class="help-block">{{ field.help_text }}</span>
|
||||
{% endif %}
|
||||
|
|
|
@ -1,18 +1,26 @@
|
|||
<div class="form-group {% if field.errors %}has-error{% endif %}">
|
||||
{% 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 %}
|
||||
|
||||
<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 %}
|
||||
{% 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 %}
|
||||
|
|
|
@ -3,8 +3,11 @@
|
|||
|
||||
<div class="form-group {% if field.errors %}has-error{% endif %}">
|
||||
{% 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 %}
|
||||
|
||||
<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>
|
||||
|
@ -12,9 +15,11 @@
|
|||
<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 %}
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
<div class="form-group {% if field.errors %}has-error{% endif %}">
|
||||
{% 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 %}
|
||||
|
||||
<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 %}
|
||||
|
|
Loading…
Reference in New Issue
Block a user