{% if created %}
<p class="success">{% trans 'Your comment succesfully posted' %}</p>
{% else %}
{% get_comment_form for object as comment_form %}
<form class="form form-group" action="{% comment_form_target %}" method="POST">
    {% csrf_token %}
    <fieldset>
        <legend>{% trans "Leave your comment" %}</legend>  
        <div class="control-group">
            <p class="control-label">
                <img src="{{ user.avatar }}" width="16" height="16" alt="{{ user }}" />
                <a href="{% url 'accounts_profile_detail' user.username %}">{% firstof user.real_name user.username %}</a>
            </p>
            <div class="controls">
                {{ comment_form.content_type }}
                {{ comment_form.object_pk }}
                {{ comment_form.timestamp }}
                {{ comment_form.security_hash }}
                {{ comment_form.comment }}
                {% for error in comment_form.comment.errors %}
                    <span class="help-inline">{{ error }}</span>
                {% endfor %}
                {% if comment_form.comment.help_text %}
                    <span class="help-block">{{ comment_form.comment.help_text|safe }}</span>
                {% endif %}
            </div>
        </div>        
    </fieldset>
    <div>
        <button type="submit" name="commit" class="btn btn-primary">{% trans 'Post comment' %}</button>
    </div>
</form>
{% endif %}
