From 9ded9d232cd5b8380422ff51f698318cd0529c1e Mon Sep 17 00:00:00 2001 From: Alec Perkins Date: Fri, 7 Sep 2012 17:10:13 -0400 Subject: [PATCH] Add tooltips to other methods --- .../templates/djangorestframework/base.html | 132 +++++++++--------- 1 file changed, 64 insertions(+), 68 deletions(-) diff --git a/djangorestframework/templates/djangorestframework/base.html b/djangorestframework/templates/djangorestframework/base.html index 957bfcdad..bed1a6c64 100644 --- a/djangorestframework/templates/djangorestframework/base.html +++ b/djangorestframework/templates/djangorestframework/base.html @@ -72,19 +72,19 @@ {% endif %} -
- -

{{ description }}

-
-
HTTP {{ response.status_code }} {{ response.status_text }}{% autoescape off %}
+        
+ +

{{ description }}

+
+
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 %} + {% if 'GET' in allowed_methods %}
-
+

GET: {{ name }}

@@ -98,71 +98,67 @@
- {% endif %} - - {% comment %} - DROP POST/PUT/DELETE until the forms are working with REST framework 2 - - {# Only display the POST/PUT/DELETE forms if method tunneling via POST forms is enabled and the user has permissions on this view. #} - {% 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 }} -
- {% 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 %} - - + {% 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 }} +
+ {% 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 %} - {% if 'DELETE' in allowed_methods and api_settings.FORM_METHOD_OVERRIDE %} -
-
-

DELETE: {{ name }}

- {% csrf_token %} - - -
-
- {% endif %} - - {% endif %} - {% endcomment %} -
- +
+