Ticket #16031: custom_comment_form-16031-2.diff
File custom_comment_form-16031-2.diff, 1.9 KB (added by , 13 years ago) |
---|
-
docs/ref/contrib/comments/index.txt
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. -
docs/ref/contrib/comments/example.txt
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