Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.3.X] Fixed #16031 -- Corrected comments template examples. Thanks,…

… teraom.

Backport from trunk (r16412).

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.3.X@16421 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 7880d999005170745040d1725ab0d8899235a794 1 parent 25ee9b4
Jannis Leidel authored June 16, 2011
17  docs/ref/contrib/comments/example.txt
@@ -103,13 +103,16 @@ But let's look at a simple example::
103 103
   <!-- A context variable called form is created with the necessary hidden
104 104
   fields, timestamps and security hashes -->
105 105
   <table>
106  
-  <form action="{% comment_form_target %}" method="post">
107  
-    {{ form }}
108  
-    <tr>
109  
-      <td></td>
110  
-      <td><input type="submit" name="preview" class="submit-post" value="Preview"></td>
111  
-    </tr>
112  
-  </form>
  106
+    <form action="{% comment_form_target %}" method="post">
  107
+      {% csrf_token %}
  108
+      {{ form }}
  109
+      <tr>
  110
+        <td colspan="2">
  111
+          <input type="submit" name="submit" value="Post">
  112
+          <input type="submit" name="preview" value="Preview">
  113
+        </td>
  114
+      </tr>
  115
+    </form>
113 116
   </table>
114 117
 
115 118
 Flagging
19  docs/ref/contrib/comments/index.txt
@@ -218,13 +218,18 @@ you can use in the template::
218 218
 A complete form might look like::
219 219
 
220 220
     {% get_comment_form for event as form %}
221  
-    <form action="{% comment_form_target %}" method="post">
222  
-      {{ form }}
223  
-      <tr>
224  
-        <td></td>
225  
-        <td><input type="submit" name="preview" class="submit-post" value="Preview"></td>
226  
-      </tr>
227  
-    </form>
  221
+    <table>
  222
+      <form action="{% comment_form_target %}" method="post">
  223
+        {% csrf_token %}
  224
+        {{ form }}
  225
+        <tr>
  226
+          <td colspan="2">
  227
+            <input type="submit" name="submit" value="Post">
  228
+            <input type="submit" name="preview" value="Preview">
  229
+          </td>
  230
+        </tr>
  231
+      </form>
  232
+    </table>
228 233
 
229 234
 Be sure to read the `notes on the comment form`_, below, for some special
230 235
 considerations you'll need to make if you're using this approach.

0 notes on commit 7880d99

Please sign in to comment.
Something went wrong with that request. Please try again.