Fix indentation

This commit is contained in:
Andy Babic 2018-11-27 17:45:28 +00:00
parent c33e762c2a
commit 8a42188eba

View File

@ -76,135 +76,149 @@
{% block content %} {% block content %}
<div class="region" aria-label="{% trans "request form" %}"> <div class="region" aria-label="{% trans "request form" %}">
{% block request_forms %} {% block request_forms %}
{% if 'GET' in allowed_methods %} {% if 'GET' in allowed_methods %}
<form id="get-form" class="pull-right"> <form id="get-form" class="pull-right">
<fieldset> <fieldset>
{% if api_settings.URL_FORMAT_OVERRIDE %} {% if api_settings.URL_FORMAT_OVERRIDE %}
<div class="btn-group format-selection"> <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> <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{% for format in available_formats %} {% for format in available_formats %}
<li> <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> </li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
{% else %} {% else %}
<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>
{% endif %} {% endif %}
</fieldset> </fieldset>
</form> </form>
{% endif %} {% endif %}
{% if options_form %} {% if options_form %}
<form class="button-form" action="{{ request.get_full_path }}" data-method="OPTIONS"> <form class="button-form" action="{{ request.get_full_path }}" data-method="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> </form>
{% endif %} {% endif %}
{% if delete_form %} {% if delete_form %}
<button class="btn btn-danger button-form js-tooltip" title="Make a DELETE request on the {{ name }} resource" data-toggle="modal" data-target="#deleteModal">DELETE</button> <button class="btn btn-danger button-form js-tooltip" title="Make a DELETE request on the {{ name }} resource" data-toggle="modal" data-target="#deleteModal">DELETE</button>
<!-- Delete Modal --> <!-- Delete Modal -->
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-body"> <div class="modal-body">
<h4 class="text-center">Are you sure you want to delete this {{ name }}?</h4> <h4 class="text-center">Are you sure you want to delete this {{ name }}?</h4>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<form class="button-form" action="{{ request.get_full_path }}" data-method="DELETE"> <form class="button-form" action="{{ request.get_full_path }}" data-method="DELETE">
<button class="btn btn-danger">Delete</button> <button class="btn btn-danger">Delete</button>
</form> </form>
</div>
</div>
</div> </div>
</div> </div>
</div> {% endif %}
</div>
{% endif %}
{% if extra_actions %} {% if extra_actions %}
<div class="dropdown" style="float: right; margin-right: 10px"> <div class="dropdown" style="float: right; margin-right: 10px">
<button class="btn btn-default" id="extra-actions-menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> <button class="btn btn-default" id="extra-actions-menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
{% trans "Extra Actions" %} {% trans "Extra Actions" %}
<span class="caret"></span> <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu" aria-labelledby="extra-actions-menu"> <ul class="dropdown-menu" aria-labelledby="extra-actions-menu">
{% for action_name, url in extra_actions|items %} {% for action_name, url in extra_actions|items %}
<li><a href="{{ url }}">{{ action_name }}</a></li> <li><a href="{{ url }}">{{ action_name }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
{% endif %} {% endif %}
{% if filter_form %} {% if filter_form %}
<button style="float: right; margin-right: 10px" data-toggle="modal" data-target="#filtersModal" class="btn btn-default"> <button style="float: right; margin-right: 10px" data-toggle="modal" data-target="#filtersModal" class="btn btn-default">
<span class="glyphicon glyphicon-wrench" aria-hidden="true"></span> <span class="glyphicon glyphicon-wrench" aria-hidden="true"></span>
{% trans "Filters" %} {% trans "Filters" %}
</button> </button>
{% endif %} {% endif %}
{% endblock request_forms %} {% endblock request_forms %}
</div> </div>
<div class="content-main" role="main" aria-label="{% trans "main content" %}"> <div class="content-main" role="main" aria-label="{% trans "main content" %}">
{% block main_content %} {% block main_content %}
<div class="page-header"> <div class="page-header">
<h1>{{ name }}</h1> <h1>{{ name }}</h1>
</div> </div>
<div style="float:left"> <div style="float:left">
{% block description %} {% block description %}
{{ description }} {{ description }}
{% endblock %} {% endblock %}
</div> </div>
{% if paginator %} {% if paginator %}
<nav style="float: right"> <nav style="float: right">
{% get_pagination_html paginator %} {% get_pagination_html paginator %}
</nav> </nav>
{% endif %} {% endif %}
<div class="request-info" style="clear: both" aria-label="{% trans "request info" %}"> <div class="request-info" style="clear: both" aria-label="{% trans "request info" %}">
<pre class="prettyprint"><b>{{ request.method }}</b> {{ request.get_full_path }}</pre> <pre class="prettyprint"><b>{{ request.method }}</b> {{ request.get_full_path }}</pre>
</div> </div>
<div class="response-info" aria-label="{% trans "response info" %}"> <div class="response-info" aria-label="{% trans "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 %} <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>{% endfor %} <b>{{ key }}:</b> <span class="lit">{{ val|break_long_headers|urlize_quoted_links }}</span>{% endfor %}
</span>{{ content|urlize_quoted_links }}</pre>{% endautoescape %} </span>{{ content|urlize_quoted_links }}</pre>{% endautoescape %}
</div> </div>
{% endblock %} {% endblock %}
</div> </div>
{% block edit_forms %} {% block edit_forms %}
{% if display_edit_forms %} {% if display_edit_forms %}
{% if post_form or raw_data_post_form %} {% if post_form or raw_data_post_form %}
<div {% if post_form %}class="tabbable"{% endif %}> <div {% if post_form %}class="tabbable"{% endif %}>
{% if post_form %}
<ul class="nav nav-tabs form-switcher">
<li>
<a name='html-tab' href="#post-object-form" data-toggle="tab">HTML form</a>
</li>
<li>
<a name='raw-tab' href="#post-generic-content-form" data-toggle="tab">Raw data</a>
</li>
</ul>
{% endif %}
<div class="well tab-content">
{% if post_form %} {% if post_form %}
<div class="tab-pane" id="post-object-form"> <ul class="nav nav-tabs form-switcher">
{% with form=post_form %} <li>
<form action="{{ request.get_full_path }}" method="POST" enctype="multipart/form-data" class="form-horizontal" novalidate> <a name='html-tab' href="#post-object-form" data-toggle="tab">HTML form</a>
</li>
<li>
<a name='raw-tab' href="#post-generic-content-form" data-toggle="tab">Raw data</a>
</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>
<fieldset>
{% csrf_token %}
{{ post_form }}
<div class="form-actions">
<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> <fieldset>
{% csrf_token %} {% include "rest_framework/raw_data_form.html" %}
{{ post_form }}
<div class="form-actions"> <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> </div>
@ -212,72 +226,58 @@
</form> </form>
{% endwith %} {% endwith %}
</div> </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>
</div>
</fieldset>
</form>
{% endwith %}
</div> </div>
</div> </div>
</div> {% endif %}
{% endif %}
{% if put_form or raw_data_put_form or raw_data_patch_form %} {% if put_form or raw_data_put_form or raw_data_patch_form %}
<div {% if put_form %}class="tabbable"{% endif %}> <div {% if put_form %}class="tabbable"{% endif %}>
{% if put_form %}
<ul class="nav nav-tabs form-switcher">
<li>
<a name='html-tab' href="#put-object-form" data-toggle="tab">HTML form</a>
</li>
<li>
<a name='raw-tab' href="#put-generic-content-form" data-toggle="tab">Raw data</a>
</li>
</ul>
{% endif %}
<div class="well tab-content">
{% if put_form %} {% if put_form %}
<div class="tab-pane" id="put-object-form"> <ul class="nav nav-tabs form-switcher">
<form action="{{ request.get_full_path }}" data-method="PUT" enctype="multipart/form-data" class="form-horizontal" novalidate> <li>
<fieldset> <a name='html-tab' href="#put-object-form" data-toggle="tab">HTML form</a>
{{ put_form }} </li>
<div class="form-actions"> <li>
<button class="btn btn-primary js-tooltip" title="Make a PUT request on the {{ name }} resource">PUT</button> <a name='raw-tab' href="#put-generic-content-form" data-toggle="tab">Raw data</a>
</div> </li>
</fieldset> </ul>
</form>
</div>
{% endif %} {% endif %}
<div {% if put_form %}class="tab-pane"{% endif %} id="put-generic-content-form"> <div class="well tab-content">
{% with form=raw_data_put_or_patch_form %} {% if put_form %}
<form action="{{ request.get_full_path }}" data-method="PUT" class="form-horizontal"> <div class="tab-pane" id="put-object-form">
<fieldset> <form action="{{ request.get_full_path }}" data-method="PUT" enctype="multipart/form-data" class="form-horizontal" novalidate>
{% include "rest_framework/raw_data_form.html" %} <fieldset>
<div class="form-actions"> {{ put_form }}
{% if raw_data_put_form %} <div class="form-actions">
<button class="btn btn-primary js-tooltip" title="Make a PUT request on the {{ name }} resource">PUT</button> <button class="btn btn-primary js-tooltip" title="Make a PUT request on the {{ name }} resource">PUT</button>
{% endif %} </div>
{% if raw_data_patch_form %} </fieldset>
<button data-method="PATCH" class="btn btn-primary js-tooltip" title="Make a PATCH request on the {{ name }} resource">PATCH</button> </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 }}" data-method="PUT" class="form-horizontal">
<fieldset>
{% include "rest_framework/raw_data_form.html" %}
<div class="form-actions">
{% if raw_data_put_form %}
<button class="btn btn-primary js-tooltip" title="Make a PUT request on the {{ name }} resource">PUT</button>
{% endif %} {% endif %}
</div> {% if raw_data_patch_form %}
</fieldset> <button data-method="PATCH" class="btn btn-primary js-tooltip" title="Make a PATCH request on the {{ name }} resource">PATCH</button>
</form> {% endif %}
{% endwith %} </div>
</fieldset>
</form>
{% endwith %}
</div>
</div> </div>
</div> </div>
</div> {% endif %}
{% endif %} {% endif %}
{% endif %}
{% endblock edit_forms %} {% endblock edit_forms %}
{% endblock content %} {% endblock content %}
</div><!-- /.content --> </div><!-- /.content -->