{% load i18n mezzanine_tags comment_tags rating_tags drum_tags future %}

<ul class="unstyled comment-thread">
    {% for comment in comments_for_thread %}
    <li id="comment-{{ comment.id }}">
    {% if not comment.is_removed and comment.is_public %}

        <p class="comment-meta">
            <a href="{% url "profile" comment.user.username %}">{{ comment.user|get_profile }}</a>
            {{ comment.submit_date|short_timesince }} ago
        </p>
        <p class="comment-comment">{{ comment.comment|comment_filter }}</p>

        <div class="comment-links">
            {% rating_for comment %}
            <a href="{{ request.path }}#comment-{{ comment.id }}">link</a> |
            <a href="#reply-{{ comment.id }}" class="reply no-pjax">reply</a>
            <form class="reply-form" method="post" id="reply-{{ comment.id }}"
                action="{{ comment_url }}#reply-{{ comment.id }}"
                {% if replied_to != comment.id %}style="display:none;"{% endif %}>
                {% if replied_to == comment.id %}
                {% fields_for posted_comment_form %}
                {% else %}
                {% fields_for unposted_comment_form %}
                {% endif %}
                <input type="hidden" name="replied_to" value="{{ comment.id }}">
                <input class="btn btn-primary btn-large" type="submit" value="{% trans "Reply" %}">
            </form>
        </div>

    {% else %}

        {% if comment.is_removed %}
        <p>Deleted</p>
        {% endif %}

    {% endif %}
    {% comment_thread comment %}
    </li>
    {% endfor %}
    {% if no_comments %}
    <li>No comments yet</li>
    {% endif %}
</ul>

