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

{% block forum_content %}
{% include "forum/includes/breadcrumbs.html" %}

<section class="thread row">
    <div class="title">
        <h3>
            <strong><a href="{{ thread.get_absolute_url }}">{{ thread.title }}</a></strong>
        </h3>
    </div>

    {% if thread.image %}
    <div class="image text-center panel">
        <img src="{{ thread.image.url }}" alt="thread image" />
    </div>
    {% endif %}

    {% if thread.attachment %}
    <div class="attach text-center panel callout">
        <strong>{% trans "File" %}:</strong>
        <a target="_blank" href="{{ thread.attachment.url }}">{{ thread.get_attachment_basename }}</a>
        <span>{{ thread.attachment.size|filesizeformat }}</span>
    </div>
    {% endif %}
</section>

{% for user_reply in object_list %}
{% with user_reply.author as author %}
<article class="reply row">
    <header>
        {{ user_reply.creation_time|date }}
    </header>
    <aside class="avatar column medium-2 large-2 text-center">
        <img src="{{ author.get_avatar_url }}" alt="user avatar" />
        <p><strong class="author">{{ author }}</strong></p>
    </aside>
    <section class="column medium-10 large-10">
        <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="thread_actions row">
    <a href='{% url "forum:reply" forum.id thread.id %}'>{% trans "Reply" %}</a>
</div>

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

{% endblock %}
