view comments/form.html @ 195:baf8776dc44d

added code for the integration of comment system into bundles and snippets. database sync must be run so that necessary tables is created for the comments to work properly.
author ahsanalishahid <ahsan.ali.shahid@gmail.com>
date Tue, 02 Jul 2013 02:09:21 +0500
parents 50ba20441122
children
line wrap: on
line source

{% 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>