[pirate-politics] r604 committed - Created wiki page through web user interface.

3 views
Skip to first unread message

pirate-...@googlecode.com

unread,
Feb 9, 2011, 8:35:23 AM2/9/11
to pirate-poli...@googlegroups.com
Revision: 604
Author: fragro
Date: Wed Feb 9 05:07:12 2011
Log: Created wiki page through web user interface.
http://code.google.com/p/pirate-politics/source/detail?r=604

Added:
/wiki/pp_comment_form.wiki

=======================================
--- /dev/null
+++ /wiki/pp_comment_form.wiki Wed Feb 9 05:07:12 2011
@@ -0,0 +1,39 @@
+#summary To load this tag include {% load commenttags %} at the top of the
html file.
+#sidebar TableOfContents
+
+= Custom Tag: `pp_comment_form` =
+====_Module: pirate_messges_====
+
+This template tag populates the namespace `pp_comment` with a form to
create a comment. This is only really used at the root level, comment
replies are handled by the dynamically generated HTML within commenttags.py
+
+==_Arguments and Parameters_==
+
+ * POST: `request.POST` contains modified form object if available
+ * reply_to: comment being replied to, shouldn't use this argument since
replies are handled dynamically
+ * user: user creating the comment, `request.user` most of the time
+ * edit: supply a comment to the form for editting
+
+==_Return value_==
+
+ * `pp_comment.form`: An HTML form containing the necessary fields for
creating a comment.
+
+==_Usage Notes_==
+ * *Assumptions*: This function assumes the user is authenticated.
+
+ * *Errors*: None
+
+==_Examples_==
+====Basic form====
+The following code will display the reputation integer.
+{{{
+{% pp_comment_form POST=request.POST path=request.path user=request.user
object=request.object%}
+ <div class="errors">{{ pp_comment.form.errors }}</div>
+ <form method="post" action="">
+ {{ pp_comment.form.text}}
+ {{ pp_comment.form.parent}}
+ {{pp_comment.form.form_id}}
+ {% csrf_token %}
+ <input type="submit" class='button green' value="Submit Comment">
+ </form>
+{% endpp_comment_form %}
+}}}

Reply all
Reply to author
Forward
0 new messages