diff templates/comments/form.html @ 196:134f726fd62c

Removed extrawhitespaces and moved comments template files to templates folder
author Ahsan Ali Shahid <ahsan.ali.shahid@gmail.com>
date Thu, 04 Jul 2013 15:45:50 +0500
parents comments/form.html@50ba20441122
children 1341435d4d33
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/comments/form.html	Thu Jul 04 15:45:50 2013 +0500
@@ -0,0 +1,31 @@
+{% load comments i18n %}
+
+
+<form action="{% comment_form_target %}" method="post">
+  {% csrf_token %}
+    {{ form.object_pk }}
+    {{ form.content_type }}
+    {{ form.timestamp }}
+    {{ form.security_hash }}
+    {# if it is has a parent #}
+
+    {% if node.id %}
+        <input type="hidden" name="parent" id="parent_id" value="{{ node.id }}" />
+        <input type = 'button' value = "Reply" onClick= "$(this).ShowCommentForm({{ node.id }})" id = "{{ node.id }}-button"
+        class = "reply-button"/>
+
+    {% endif %}
+        <!-- I have used node id over here so that I can show/hide comment field -->
+        <div class = "comment-box" style="{% if node.id %}display:none {% else %} display:block {%endif%}" id = "{{ node.id }}"   >
+        <h4>
+        {%if node.id%}
+        Reply:
+        {%else%} Comment:
+        {%endif%}
+        </h4>
+        {{form.comment}}
+
+        <br/>
+        <input type="submit" value = "Submit" class = 'reply-button' >
+        </div>
+    </form>
\ No newline at end of file