From 0ae5500f34a81005ba0161dacb280a94f768a885 Mon Sep 17 00:00:00 2001 From: Alec Perkins Date: Sun, 9 Sep 2012 12:42:30 -0400 Subject: [PATCH] Compacting, moving GET button up to OPTIONS --- .../static/djangorestframework/css/style.css | 4 ++ .../templates/djangorestframework/base.html | 50 ++++++++++--------- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/djangorestframework/static/djangorestframework/css/style.css b/djangorestframework/static/djangorestframework/css/style.css index 467f65b07..fbc4a008c 100644 --- a/djangorestframework/static/djangorestframework/css/style.css +++ b/djangorestframework/static/djangorestframework/css/style.css @@ -47,4 +47,8 @@ h2, h3 { .response-info .meta { border-bottom: 1px solid #ccc; +} + +#options-form { + margin-right: 1em; } \ No newline at end of file diff --git a/djangorestframework/templates/djangorestframework/base.html b/djangorestframework/templates/djangorestframework/base.html index 558aaaacb..a8ac83a8a 100644 --- a/djangorestframework/templates/djangorestframework/base.html +++ b/djangorestframework/templates/djangorestframework/base.html @@ -66,6 +66,30 @@
+ {% if 'GET' in allowed_methods %} +
+
+
+ GET + + + +
+ +
+
+ {% endif %} + {% if api_settings.FORM_METHOD_OVERRIDE %}
{% csrf_token %} @@ -81,7 +105,6 @@

{{ description }}

-

Request / Response

{{ request.method }} {{ request.get_full_path }}
@@ -93,25 +116,6 @@ {{ content|urlize_quoted_links }}{% endautoescape %}
-

Available Methods & Formats

- - {% if 'GET' in allowed_methods %} - -
-

GET: {{ name }}

- -
- GET - {% for format in available_formats %} - {% with FORMAT_PARAM|add:"="|add:format as param %} - {{ format }} - {% endwith %} - {% endfor %} -
- -
- - {% endif %} {% comment %} {# These are disabled since the forms don't work with 2.0.0 yet #} @@ -121,7 +125,7 @@ {% if 'POST' in allowed_methods %}
-

POST: {{ name }}

+

POST: {{ name }}

{% csrf_token %} {{ post_form.non_field_errors }} {% for field in post_form %} @@ -141,7 +145,7 @@ {% if 'PUT' in allowed_methods and api_settings.FORM_METHOD_OVERRIDE %}
-

PUT: {{ name }}

+

PUT: {{ name }}

{% csrf_token %} {{ put_form.non_field_errors }} @@ -163,7 +167,7 @@ {% if 'DELETE' in allowed_methods and api_settings.FORM_METHOD_OVERRIDE %}
-

DELETE: {{ name }}

+

DELETE: {{ name }}

{% csrf_token %}