diff options
| author | Tom Christie | 2012-09-20 17:44:34 +0100 |
|---|---|---|
| committer | Tom Christie | 2012-09-20 17:44:34 +0100 |
| commit | d9cba6398e2323b8d8cd34f791442528517e01b4 (patch) | |
| tree | 4a8d378584e10c669acee2574fbd47f38f35785f /rest_framework/templates | |
| parent | f4670c89969503919cd597529f19174e67acd388 (diff) | |
| download | django-rest-framework-d9cba6398e2323b8d8cd34f791442528517e01b4.tar.bz2 | |
Clean up bits of templates etc
Diffstat (limited to 'rest_framework/templates')
| -rw-r--r-- | rest_framework/templates/rest_framework/api.txt | 8 | ||||
| -rw-r--r-- | rest_framework/templates/rest_framework/base.html | 64 |
2 files changed, 28 insertions, 44 deletions
diff --git a/rest_framework/templates/rest_framework/api.txt b/rest_framework/templates/rest_framework/api.txt deleted file mode 100644 index c87a154c..00000000 --- a/rest_framework/templates/rest_framework/api.txt +++ /dev/null @@ -1,8 +0,0 @@ -{% autoescape off %}{{ name }} - -{{ description }} - -HTTP {{ response.status_code }} {{ response.status_text }} -{% for key, val in response.headers.items %}{{ key }}: {{ val }} -{% endfor %} -{{ content }}{% endautoescape %} diff --git a/rest_framework/templates/rest_framework/base.html b/rest_framework/templates/rest_framework/base.html index 71fc5222..4b42778f 100644 --- a/rest_framework/templates/rest_framework/base.html +++ b/rest_framework/templates/rest_framework/base.html @@ -4,26 +4,28 @@ <!DOCTYPE html> <html> <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> + {% block head %} - {% block bootstrap_theme %} - <link rel="stylesheet" type="text/css" href="{% get_static_prefix %}rest_framework/css/bootstrap.min.css"/> - <link rel="stylesheet" type="text/css" href="{% get_static_prefix %}rest_framework/css/bootstrap-tweaks.css"/> + {% block meta %} + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> + <meta name="robots" content="NONE,NOARCHIVE" /> {% endblock %} - <link rel="stylesheet" type="text/css" href='{% get_static_prefix %}rest_framework/css/prettify.css'/> - <link rel="stylesheet" type="text/css" href='{% get_static_prefix %}rest_framework/css/style.css'/> - {% block extrastyle %}{% endblock %} - <title>{% block title %}Django REST framework - {{ name }}{% endblock %}</title> + <title>{% block title %}Django REST framework{% endblock %}</title> - {% block extrahead %}{% endblock %} - - {% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %} + {% block style %} + <link rel="stylesheet" type="text/css" href="{% get_static_prefix %}rest_framework/css/bootstrap.min.css"/> + <link rel="stylesheet" type="text/css" href="{% get_static_prefix %}rest_framework/css/bootstrap-tweaks.css"/> + <link rel="stylesheet" type="text/css" href='{% get_static_prefix %}rest_framework/css/prettify.css'/> + <link rel="stylesheet" type="text/css" href='{% get_static_prefix %}rest_framework/css/default.css'/> + {% endblock %} + {% endblock %} </head> <body class="{% block bodyclass %}{% endblock %} container"> + {% block navbar %} <div class="navbar navbar-fixed-top {% block bootstrap_navbar_variant %}navbar-inverse{% endblock %}"> <div class="navbar-inner"> <div class="container"> @@ -32,31 +34,28 @@ </span> <ul class="nav pull-right"> {% block userlinks %} - {% if user.is_active %} + {% if user.is_authenticated %} <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> Welcome, {{ user }} <b class="caret"></b> </a> <ul class="dropdown-menu"> - <li>{% optional_logout %}</li> + <li>{% optional_logout request %}</li> </ul> </li> {% else %} - <li>{% optional_login %}</li> + <li>{% optional_login request %}</li> {% endif %} {% endblock %} </ul> </div> </div> </div> - - {% block global_heading %}{% endblock %} - + {% endblock %} {% block breadcrumbs %} <ul class="breadcrumb"> - {% for breadcrumb_name, breadcrumb_url in breadcrumblist %} <li> <a href="{{ breadcrumb_url }}" {% if forloop.last %}class="active"{% endif %}>{{ breadcrumb_name }}</a> {% if not forloop.last %}<span class="divider">›</span>{% endif %} @@ -79,11 +78,9 @@ </button> <ul class="dropdown-menu"> {% for format in available_formats %} - {% with FORMAT_PARAM|add:"="|add:format as param %} - <li> - <a class="js-tooltip format-option" href='{{ request.get_full_path|add_query_param:param }}' rel="nofollow" title="Do a GET request on the {{ name }} resource with the format set to `{{ format }}`">{{ format }}</a> - </li> - {% endwith %} + <li> + <a class="js-tooltip format-option" href='{% add_query_param request api_settings.URL_FORMAT_OVERRIDE format %}' rel="nofollow" title="Do a GET request on the {{ name }} resource with the format set to `{{ format }}`">{{ format }}</a> + </li> {% endfor %} </ul> </div> @@ -188,24 +185,19 @@ </div> <!-- END Content --> + {% block footer %} <div id="footer"> - {% block footer %} - <a class="powered-by" href='http://django-rest-framework.org'>Django REST framework</a> <span class="version">{{ version }}</span> - {% endblock %} + <a class="powered-by" href='http://django-rest-framework.org'>Django REST framework</a> <span class="version">{{ version }}</span> </div> + {% endblock %} + </div> + + {% block script %} <script src="{% get_static_prefix %}rest_framework/js/jquery-1.8.1-min.js"></script> <script src="{% get_static_prefix %}rest_framework/js/bootstrap.min.js"></script> <script src="{% get_static_prefix %}rest_framework/js/prettify-min.js"></script> - <script> - prettyPrint(); - - $('.js-tooltip').tooltip({ - delay: 1000 - }); - </script> - - {% block extrabody %}{% endblock %} - + <script src="{% get_static_prefix %}rest_framework/js/default.js"></script> + {% endblock %} </body> </html> |
