Commit 5392be4d by José Padilla Committed by Tom Christie

Spring cleaning template styles (#4124)

parent 1328982d
{% load staticfiles %} {% load staticfiles %}
{% load i18n %} {% load i18n %}
{% load rest_framework %} {% load rest_framework %}
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
{% block head %} {% block head %}
{% block meta %}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="robots" content="NONE,NOARCHIVE" />
{% endblock %}
<title>{% block title %}Django REST framework{% endblock %}</title> {% block meta %}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="robots" content="NONE,NOARCHIVE" />
{% endblock %}
{% block style %} <title>{% block title %}Django REST framework{% endblock %}</title>
{% block bootstrap_theme %}
<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 %}
{% block style %}
{% block bootstrap_theme %}
<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 %} {% endblock %}
</head> <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 %}
{% block body %} {% endblock %}
<body class="{% block bodyclass %}{% endblock %}"> </head>
<div class="wrapper"> {% block body %}
<body class="{% block bodyclass %}{% endblock %}">
{% block navbar %} <div class="wrapper">
<div class="navbar navbar-static-top {% block bootstrap_navbar_variant %}navbar-inverse{% endblock %}"> {% block navbar %}
<div class="container"> <div class="navbar navbar-static-top {% block bootstrap_navbar_variant %}navbar-inverse{% endblock %}">
<span> <div class="container">
{% block branding %} <span>
<a class='navbar-brand' rel="nofollow" href='http://www.django-rest-framework.org'> {% block branding %}
Django REST framework <a class='navbar-brand' rel="nofollow" href='http://www.django-rest-framework.org'>
</a> Django REST framework
{% endblock %} </a>
</span> {% endblock %}
<ul class="nav navbar-nav pull-right"> </span>
{% block userlinks %} <ul class="nav navbar-nav pull-right">
{% if user.is_authenticated %} {% block userlinks %}
{% optional_logout request user %} {% if user.is_authenticated %}
{% else %} {% optional_logout request user %}
{% optional_login request %} {% else %}
{% endif %} {% optional_login request %}
{% endblock %} {% endif %}
</ul> {% endblock %}
</div> </ul>
</div> </div>
{% endblock %} </div>
{% endblock %}
<div class="container"> <div class="container">
{% block breadcrumbs %} {% block breadcrumbs %}
<ul class="breadcrumb"> <ul class="breadcrumb">
{% for breadcrumb_name, breadcrumb_url in breadcrumblist %} {% for breadcrumb_name, breadcrumb_url in breadcrumblist %}
{% if forloop.last %} {% if forloop.last %}
<li class="active"><a href="{{ breadcrumb_url }}">{{ breadcrumb_name }}</a></li> <li class="active"><a href="{{ breadcrumb_url }}">{{ breadcrumb_name }}</a></li>
{% else %} {% else %}
<li><a href="{{ breadcrumb_url }}">{{ breadcrumb_name }}</a></li> <li><a href="{{ breadcrumb_url }}">{{ breadcrumb_name }}</a></li>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</ul> </ul>
{% endblock %} {% endblock %}
<!-- Content --> <!-- Content -->
<div id="content"> <div id="content">
{% 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> <div class="btn-group format-selection">
<div class="btn-group format-selection"> <button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> Format <span class="caret"></span>
Format <span class="caret"></span>
</button>
<ul class="dropdown-menu">
{% for format in available_formats %}
<li>
<a class="format-option"
href='{% add_query_param request api_settings.URL_FORMAT_OVERRIDE format %}'
rel="nofollow">
{{ format }}
</a>
</li>
{% endfor %}
</ul>
</div>
</fieldset>
</form>
{% endif %}
{% if post_form %}
<button type="button" class="button-form btn btn-primary" data-toggle="modal" data-target="#createModal">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Create
</button>
{% endif %}
{% if put_form %}
<button type="button" class="button-form btn btn-primary" data-toggle="modal" data-target="#editModal">
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> Edit
</button>
{% endif %}
{% if delete_form %}
<form class="button-form" action="{{ request.get_full_path }}" data-method="DELETE">
<button class="btn btn-danger">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete
</button>
</form>
{% endif %}
{% if filter_form %}
<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>
{% trans "Filters" %}
</button> </button>
<ul class="dropdown-menu">
{% for format in available_formats %}
<li>
<a class="format-option"
href='{% add_query_param request api_settings.URL_FORMAT_OVERRIDE format %}'
rel="nofollow">
{{ format }}
</a>
</li>
{% endfor %}
</ul>
</div>
</fieldset>
</form>
{% endif %}
{% if post_form %}
<button type="button" class="button-form btn btn-primary" data-toggle="modal" data-target="#createModal">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Create
</button>
{% endif %}
{% if put_form %}
<button type="button" class="button-form btn btn-primary" data-toggle="modal" data-target="#editModal">
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> Edit
</button>
{% endif %}
{% if delete_form %}
<form class="button-form" action="{{ request.get_full_path }}" data-method="DELETE">
<button class="btn btn-danger">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete
</button>
</form>
{% endif %}
{% if filter_form %}
<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>
{% trans "Filters" %}
</button>
{% endif %}
<div class="content-main">
<div class="page-header">
<h1>{{ name }}</h1>
</div>
<div style="float:left">
{% block description %}
{{ description }}
{% endblock %}
</div>
{% if paginator %}
<nav style="float: right">
{% get_pagination_html paginator %}
</nav>
{% endif %}
<div class="request-info" style="clear: both" >
{% if style == 'list' %}
{% include "rest_framework/admin/list.html" %}
{% else %}
{% include "rest_framework/admin/detail.html" %}
{% endif %} {% endif %}
</div>
<div class="content-main"> {% if paginator %}
<div class="page-header"> <nav style="float: right">
<h1>{{ name }}</h1> {% get_pagination_html paginator %}
</div> </nav>
<div style="float:left"> {% endif %}
{% block description %}
{{ description }}
{% endblock %}
</div>
{% if paginator %}
<nav style="float: right">
{% get_pagination_html paginator %}
</nav>
{% endif %}
<div class="request-info" style="clear: both" >
{% if style == 'list' %}
{% include "rest_framework/admin/list.html" %}
{% else %}
{% include "rest_framework/admin/detail.html" %}
{% endif %}
</div>
{% if paginator %}
<nav style="float: right">
{% get_pagination_html paginator %}
</nav>
{% endif %}
</div>
</div> </div>
<!-- END Content --> </div>
</div><!-- /.container --> <!-- END Content -->
</div><!-- ./wrapper --> </div><!-- /.container -->
</div><!-- ./wrapper -->
<!-- Create Modal -->
<div class="modal fade" id="createModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <!-- Create Modal -->
<div class="modal-dialog"> <div class="modal fade" id="createModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-content"> <div class="modal-dialog">
<div class="modal-header"> <div class="modal-content">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <div class="modal-header">
<h4 class="modal-title" id="myModalLabel">Create</h4> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div> <h4 class="modal-title" id="myModalLabel">Create</h4>
<form action="{{ request.get_full_path }}" method="POST" enctype="multipart/form-data" class="form-horizontal" novalidate> </div>
<div class="modal-body"> <form action="{{ request.get_full_path }}" method="POST" enctype="multipart/form-data" class="form-horizontal" novalidate>
<fieldset> <div class="modal-body">
{% csrf_token %} <fieldset>
{{ post_form }} {% csrf_token %}
</fieldset> {{ post_form }}
</div> </fieldset>
<div class="modal-footer"> </div>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <div class="modal-footer">
<button type="submit" class="btn btn-primary">Save</button> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div> </div>
</form>
</div>
</div>
</div>
<!-- Edit Modal -->
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">Edit</h4>
</div> </div>
<form action="{{ request.get_full_path }}" data-method="PUT" enctype="multipart/form-data" class="form-horizontal" novalidate>
<div class="modal-body"> <!-- Edit Modal -->
<fieldset> <div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
{{ put_form }} <div class="modal-dialog">
</fieldset> <div class="modal-content">
</div> <div class="modal-header">
<div class="modal-footer"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <h4 class="modal-title" id="myModalLabel">Edit</h4>
<button type="submit" class="btn btn-primary">Save</button> </div>
<form action="{{ request.get_full_path }}" data-method="PUT" enctype="multipart/form-data" class="form-horizontal" novalidate>
<div class="modal-body">
<fieldset>
{{ put_form }}
</fieldset>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div> </div>
</form>
</div>
</div>
</div>
{% if error_form %}
<!-- Errors Modal -->
<div class="modal" id="errorModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">{{ error_title }}</h4>
</div> </div>
<form action="{{ request.get_full_path }}" data-method="{{ request.method }}" enctype="multipart/form-data" class="form-horizontal" novalidate>
<div class="modal-body"> {% if error_form %}
<fieldset> <!-- Errors Modal -->
{{ error_form }} <div class="modal" id="errorModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
</fieldset> <div class="modal-dialog">
</div> <div class="modal-content">
<div class="modal-footer"> <div class="modal-header">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<button type="submit" class="btn btn-primary">Save</button> <h4 class="modal-title" id="myModalLabel">{{ error_title }}</h4>
</div>
<form action="{{ request.get_full_path }}" data-method="{{ request.method }}" enctype="multipart/form-data" class="form-horizontal" novalidate>
<div class="modal-body">
<fieldset>
{{ error_form }}
</fieldset>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div>
</div> </div>
</form> {% endif %}
</div>
</div> {% if filter_form %}
</div> {{ filter_form }}
{% endif %} {% endif %}
{% if filter_form %}{{ filter_form }}{% endif %} {% block script %}
<script>
{% block script %} window.drf = {
<script> csrfCookieName: "{{ csrf_cookie_name|default:'csrftoken' }}"
window.drf = { };
csrfCookieName: "{{ csrf_cookie_name|default:'csrftoken' }}" </script>
}; <script src="{% static "rest_framework/js/jquery-1.11.3.min.js" %}"></script>
</script> <script src="{% static "rest_framework/js/ajax-form.js" %}"></script>
<script src="{% static "rest_framework/js/jquery-1.11.3.min.js" %}"></script> <script src="{% static "rest_framework/js/csrf.js" %}"></script>
<script src="{% static "rest_framework/js/ajax-form.js" %}"></script> <script src="{% static "rest_framework/js/bootstrap.min.js" %}"></script>
<script src="{% static "rest_framework/js/csrf.js" %}"></script> <script src="{% static "rest_framework/js/prettify-min.js" %}"></script>
<script src="{% static "rest_framework/js/bootstrap.min.js" %}"></script> <script src="{% static "rest_framework/js/default.js" %}"></script>
<script src="{% static "rest_framework/js/prettify-min.js" %}"></script> <script>
<script src="{% static "rest_framework/js/default.js" %}"></script> $(document).ready(function() {
<script> $('form').ajaxForm();
$(document).ready(function() { });
$('form').ajaxForm(); </script>
}); {% endblock %}
</script>
{% endblock %}
</body> </body>
{% endblock %} {% endblock %}
</html> </html>
{% load rest_framework %} {% load rest_framework %}
<table class="table table-striped"> <table class="table table-striped">
<tbody> <tbody>
{% for key, value in results.items %} {% for key, value in results.items %}
{% if key in details %} {% if key in details %}
<tr><th>{{ key|capfirst }}</th><td {{ value|add_nested_class }}>{{ value|format_value }}</td></tr> <tr><th>{{ key|capfirst }}</th><td {{ value|add_nested_class }}>{{ value|format_value }}</td></tr>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
{% load rest_framework %} {% load rest_framework %}
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr>{% for column in columns%}<th>{{ column|capfirst }}</th>{% endfor %}<th></th></tr> <tr>{% for column in columns%}<th>{{ column|capfirst }}</th>{% endfor %}<th></th></tr>
</thead> </thead>
<tbody> <tbody>
{% for row in results %} {% for row in results %}
<tr> <tr>
{% for key, value in row.items %} {% for key, value in row.items %}
{% if key in columns %} {% if key in columns %}
<td {{ value|add_nested_class }} > <td {{ value|add_nested_class }} >
{{ value|format_value }} {{ value|format_value }}
</td>
{% endif %}
{% endfor %}
<td>
<a href="{{ row.url }}"><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></a>
</td> </td>
</tr> {% endif %}
{% endfor %} {% endfor %}
</tbody> <td>
<a href="{{ row.url }}"><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></a>
</td>
</tr>
{% endfor %}
</tbody>
</table> </table>
{% load rest_framework %} {% load rest_framework %}
<table class="table table-striped"> <table class="table table-striped">
<tbody> <tbody>
{% for item in value %} {% for item in value %}
<tr> <tr>
<th>{{ forloop.counter0 }}</th> <th>{{ forloop.counter0 }}</th>
<td>{{ item|format_value }}</td> <td>{{ item|format_value }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
{% load staticfiles %} {% load staticfiles %}
{% load rest_framework %}
{% load i18n %} {% load i18n %}
{% load rest_framework %}
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
{% block head %} {% block head %}
{% block meta %} {% block meta %}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="robots" content="NONE,NOARCHIVE" /> <meta name="robots" content="NONE,NOARCHIVE" />
{% endblock %} {% endblock %}
<title>{% block title %}{% if name %}{{ name }} – {% endif %}Django REST framework{% endblock %}</title>
<title>{% block title %}{% if name %}{{ name }} – {% endif %}Django REST framework{% endblock %}</title> {% block style %}
{% block bootstrap_theme %}
<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 %}
{% block style %} <link rel="stylesheet" type="text/css" href="{% static "rest_framework/css/prettify.css" %}"/>
{% block bootstrap_theme %} <link rel="stylesheet" type="text/css" href="{% static "rest_framework/css/default.css" %}"/>
<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 %} {% 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>
{% endblock %} {% block body %}
</head> <body class="{% block bodyclass %}{% endblock %}">
{% block body %} <div class="wrapper">
<body class="{% block bodyclass %}{% endblock %}"> {% block navbar %}
<div class="navbar navbar-static-top {% block bootstrap_navbar_variant %}navbar-inverse{% endblock %}">
<div class="container">
<span>
{% block branding %}
<a class='navbar-brand' rel="nofollow" href='http://www.django-rest-framework.org'>
Django REST framework
</a>
{% endblock %}
</span>
<ul class="nav navbar-nav pull-right">
{% block userlinks %}
{% if user.is_authenticated %}
{% optional_logout request user %}
{% else %}
{% optional_login request %}
{% endif %}
{% endblock %}
</ul>
</div>
</div>
{% endblock %}
<div class="wrapper"> <div class="container">
{% block navbar %} {% block breadcrumbs %}
<div class="navbar navbar-static-top {% block bootstrap_navbar_variant %}navbar-inverse{% endblock %}"> <ul class="breadcrumb">
<div class="container"> {% for breadcrumb_name, breadcrumb_url in breadcrumblist %}
<span> {% if forloop.last %}
{% block branding %} <li class="active"><a href="{{ breadcrumb_url }}">{{ breadcrumb_name }}</a></li>
<a class='navbar-brand' rel="nofollow" href='http://www.django-rest-framework.org'>
Django REST framework
</a>
{% endblock %}
</span>
<ul class="nav navbar-nav pull-right">
{% block userlinks %}
{% if user.is_authenticated %}
{% optional_logout request user %}
{% else %} {% else %}
{% optional_login request %} <li><a href="{{ breadcrumb_url }}">{{ breadcrumb_name }}</a></li>
{% endif %} {% endif %}
{% endblock %} {% endfor %}
</ul> </ul>
</div> {% endblock %}
</div>
{% endblock %}
<div class="container"> <!-- Content -->
{% block breadcrumbs %} <div id="content">
<ul class="breadcrumb">
{% for breadcrumb_name, breadcrumb_url in breadcrumblist %}
{% if forloop.last %}
<li class="active"><a href="{{ breadcrumb_url }}">{{ breadcrumb_name }}</a></li>
{% else %}
<li><a href="{{ breadcrumb_url }}">{{ breadcrumb_name }}</a></li>
{% endif %}
{% endfor %}
</ul>
{% endblock %}
<!-- Content --> {% if 'GET' in allowed_methods %}
<div id="content"> <form id="get-form" class="pull-right">
<fieldset>
{% if api_settings.URL_FORMAT_OVERRIDE %}
<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>
{% if 'GET' in allowed_methods %} <button class="btn btn-primary dropdown-toggle js-tooltip" data-toggle="dropdown" title="Specify a format for the GET request">
<form id="get-form" class="pull-right"> <span class="caret"></span>
<fieldset> </button>
{% if api_settings.URL_FORMAT_OVERRIDE %} <ul class="dropdown-menu">
<div class="btn-group format-selection"> {% 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>
</li>
{% endfor %}
</ul>
</div>
{% 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 %}
</fieldset>
</form>
{% endif %}
<button class="btn btn-primary dropdown-toggle js-tooltip" data-toggle="dropdown" title="Specify a format for the GET request"> {% if options_form %}
<span class="caret"></span> <form class="button-form" action="{{ request.get_full_path }}" data-method="OPTIONS">
</button> <button class="btn btn-primary js-tooltip" title="Make an OPTIONS request on the {{ name }} resource">OPTIONS</button>
<ul class="dropdown-menu"> </form>
{% for format in available_formats %} {% endif %}
<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>
</li>
{% endfor %}
</ul>
</div>
{% 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>
{% endif %}
</fieldset>
</form>
{% endif %}
{% if options_form %}
<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>
</form>
{% 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>
</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 %}
<div class="content-main"> <div class="content-main">
<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" > <div class="request-info" style="clear: both" >
<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"> <div class="response-info">
<pre class="prettyprint"><span class="meta nocode"><b>HTTP {{ response.status_code }} {{ response.status_text }}</b>{% autoescape off %} <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> {% for key, val in response_headers.items %}<b>{{ key }}:</b> <span class="lit">{{ val|break_long_headers|urlize_quoted_links }}</span>
{% endfor %} {% endfor %}
</span>{{ content|urlize_quoted_links }}</pre>{% endautoescape %} </span>{{ content|urlize_quoted_links }}</pre>{% endautoescape %}
</div>
</div> </div>
</div>
{% if display_edit_forms %} {% if display_edit_forms %}
{% if post_form or raw_data_post_form %}
<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 %}
{% if post_form or raw_data_post_form %} <div class="well tab-content">
<div {% if post_form %}class="tabbable"{% endif %}> {% 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> <fieldset>
</li> {% csrf_token %}
<li> {{ post_form }}
<a name='raw-tab' href="#post-generic-content-form" data-toggle="tab">Raw data</a> <div class="form-actions">
</li> <button class="btn btn-primary" title="Make a POST request on the {{ name }} resource">POST</button>
</ul> </div>
{% endif %} </fieldset>
</form>
{% endwith %}
</div>
{% endif %}
<div class="well tab-content"> <div {% if post_form %}class="tab-pane"{% endif %} id="post-generic-content-form">
{% if post_form %} {% with form=raw_data_post_form %}
<div class="tab-pane" id="post-object-form"> <form action="{{ request.get_full_path }}" method="POST" class="form-horizontal">
{% with form=post_form %}
<form action="{{ request.get_full_path }}" method="POST" enctype="multipart/form-data" class="form-horizontal" novalidate>
<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>
...@@ -187,99 +200,85 @@ ...@@ -187,99 +200,85 @@
</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 %}
<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 or raw_data_put_form or raw_data_patch_form %}
<div {% if put_form %}class="tabbable"{% endif %}>
{% 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 %} </div><!-- /.content -->
</div><!-- /.content --> </div><!-- /.container -->
</div><!-- /.container --> </div><!-- ./wrapper -->
</div><!-- ./wrapper -->
{% block script %} {% if filter_form %}
<script> {{ filter_form }}
window.drf = { {% endif %}
csrfCookieName: "{{ csrf_cookie_name|default:'csrftoken' }}"
}; {% block script %}
</script> <script>
<script src="{% static "rest_framework/js/jquery-1.11.3.min.js" %}"></script> window.drf = {
<script src="{% static "rest_framework/js/ajax-form.js" %}"></script> csrfCookieName: "{{ csrf_cookie_name|default:'csrftoken' }}"
<script src="{% static "rest_framework/js/csrf.js" %}"></script> };
<script src="{% static "rest_framework/js/bootstrap.min.js" %}"></script> </script>
<script src="{% static "rest_framework/js/prettify-min.js" %}"></script> <script src="{% static "rest_framework/js/jquery-1.11.3.min.js" %}"></script>
<script src="{% static "rest_framework/js/default.js" %}"></script> <script src="{% static "rest_framework/js/ajax-form.js" %}"></script>
<script> <script src="{% static "rest_framework/js/csrf.js" %}"></script>
<script src="{% static "rest_framework/js/bootstrap.min.js" %}"></script>
<script src="{% static "rest_framework/js/prettify-min.js" %}"></script>
<script src="{% static "rest_framework/js/default.js" %}"></script>
<script>
$(document).ready(function() { $(document).ready(function() {
$('form').ajaxForm(); $('form').ajaxForm();
}); });
</script> </script>
{% endblock %} {% endblock %}
{% if filter_form %}
{{ filter_form }}
{% endif %}
</body> </body>
{% endblock %} {% endblock %}
</html> </html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment