diff --git a/djangorestframework/static/djangorestframework/css/style.css b/djangorestframework/static/djangorestframework/css/style.css index b299cb3c9..8ab895105 100644 --- a/djangorestframework/static/djangorestframework/css/style.css +++ b/djangorestframework/static/djangorestframework/css/style.css @@ -1,8 +1,33 @@ body { padding-top: 1em; + padding-bottom: 1em; } -h2 { +h1 { + font-weight: 500; +} + +h2, h3 { font-weight: 300; } +.resource-description, .response-info { + margin-bottom: 2em; +} + +#footer { + border-top: 1px solid #eee; + margin-top: 2em; + padding-top: 1em; + text-align: right; +} + +.version:before { + content: "v"; + opacity: 0.6; + padding-right: 0.25em; +} + +.format-option { + font-family: Menlo, Consolas, "Andale Mono", "Lucida Console", monospace; +} \ No newline at end of file diff --git a/djangorestframework/templates/djangorestframework/base.html b/djangorestframework/templates/djangorestframework/base.html index bed1a6c64..8f99ae5c9 100644 --- a/djangorestframework/templates/djangorestframework/base.html +++ b/djangorestframework/templates/djangorestframework/base.html @@ -25,29 +25,29 @@ - {% block nav-global %}{% endblock %} + {% block nav-global %}{% endblock %} {% block breadcrumbs %} @@ -62,7 +62,7 @@ {% endblock %} -
+
{% if 'OPTIONS' in allowed_methods and api_settings.FORM_METHOD_OVERRIDE %}
@@ -74,88 +74,95 @@
-

{{ description }}

-
+

{{ description }}

+ +

Request / Response

+
+
{{ request.method }} {{ request.get_full_path }}
+
+
HTTP {{ response.status_code }} {{ response.status_text }}{% autoescape off %}
 {% for key, val in response.items %}{{ key }}: {{ val|urlize_quoted_links }}
 {% endfor %}
 {{ content|urlize_quoted_links }}
{% endautoescape %}
- {% if 'GET' in allowed_methods %} - -
-

GET: {{ name }}

+

Available Methods & Formats

-
- GET - {% for format in available_formats %} - {% with FORMAT_PARAM|add:"="|add:format as param %} - {{ format }} - {% endwith %} - {% endfor %} -
+ {% if 'GET' in allowed_methods %} + +
+

GET: {{ name }}

-
- - {% endif %} - - {% if response.status_code != 403 %} - - {% if 'POST' in allowed_methods %} -
-
-

POST: {{ name }}

- {% csrf_token %} - {{ post_form.non_field_errors }} - {% for field in post_form %} -
- {{ field.label_tag }} - {{ field }} - {{ field.help_text }} - {{ field.errors }} +
+ GET + {% for format in available_formats %} + {% with FORMAT_PARAM|add:"="|add:format as param %} + {{ format }} + {% endwith %} + {% endfor %}
- {% endfor %} - - -
-
- {% endif %} - - {% if 'PUT' in allowed_methods and api_settings.FORM_METHOD_OVERRIDE %} -
-
-

PUT: {{ name }}

- - {% csrf_token %} - {{ put_form.non_field_errors }} - {% for field in put_form %} -
- {{ field.label_tag }} - {{ field }} - {{ field.help_text }} - {{ field.errors }} -
- {% endfor %} - -
-
+ {% endif %} - {% if 'DELETE' in allowed_methods and api_settings.FORM_METHOD_OVERRIDE %} -
-
-

DELETE: {{ name }}

- {% csrf_token %} - - -
-
- {% endif %} + {% if response.status_code != 403 %} - {% endif %} + {% if 'POST' in allowed_methods %} +
+
+

POST: {{ name }}

+ {% csrf_token %} + {{ post_form.non_field_errors }} + {% for field in post_form %} +
+ {{ field.label_tag }} + {{ field }} + {{ field.help_text }} + {{ field.errors }} +
+ {% endfor %} + + +
+
+ {% endif %} + + {% if 'PUT' in allowed_methods and api_settings.FORM_METHOD_OVERRIDE %} +
+
+

PUT: {{ name }}

+ + {% csrf_token %} + {{ put_form.non_field_errors }} + {% for field in put_form %} +
+ {{ field.label_tag }} + {{ field }} + {{ field.help_text }} + {{ field.errors }} +
+ {% endfor %} + + + +
+
+ {% endif %} + + {% if 'DELETE' in allowed_methods and api_settings.FORM_METHOD_OVERRIDE %} +
+
+

DELETE: {{ name }}

+ {% csrf_token %} + + +
+
+ {% endif %} + + {% endif %}
@@ -163,7 +170,11 @@
- {% block footer %}{% endblock %} +