{% extends "forum/base.html" %}
{% load i18n cache %}

{% block forum_content %}
{% cache 30 forum_breadcrumbs_thread %}
    {% include "forum/parent_tree.html" %}
{% endcache %}

<section class="thread">
    {% if thread.image %}
    <div class="image">
        <img src="{{ thread.image.url }}" alt="thread image" />
    </div>
    {% endif %}

    {% if thread.attach %}
    <div class="attach">
        <strong>{% trans "File" %}:</strong> <a href="{{ thread.attach.url }}">{{ thread.get_attach_basename }}</a> <span>{{ thread.attach.size|filesizeformat }}</span>
    </div>
    {% endif %}
</section>

{% for user_reply in object_list %}
{% with user_reply.author as author %}
<article class="thread_reply">
    <header>
        {{ user_reply.created|date }} <strong><a href="{{ thread.get_absolute_url }}">{{ thread.title }}</a></strong>
    </header>
    <aside class="avatar">
        <img src="{{ author.get_avatar_url }}" alt="user avatar" />
    </aside>
    <section>
        <header>
            <a href="{{ author_profile.get_absolute_url }}">{{ author|capfirst }}</a> {% trans "says:" %}
        </header>
        <div class="content">
            {{ user_reply.html|safe }}
        </div>
    </section>
</article>
{% endwith %}
{% endfor %}{# END replies #}

<div class="actions">
    <a href='{% url forum:reply forum.id thread.id %}'>{% trans "Reply" %}</a>
</div>

{% include "forum/paginate.html" %}

{% endblock %}
