{% load aa_forum_template_variables %}
{% load i18n %}
{% load static %}

<div class="aa-forum-topic-row row">
    <div class="aa-forum-topic">
        <div class="aa-forum-topic-image">
            <img src="{% static 'aa_forum/images/new_none.png' %}" alt="Topic">
        </div>

        <div class="aa-forum-topic-name">
            <p>
                <a href="{% url 'aa_forum:forum_topic' topic.board.category.slug topic.board.slug topic.slug %}">
                    {{ topic.subject }}
                </a>
                {% if topic.is_locked %}
                    <i class="fas fa-unlock"></i>
                {% endif %}

                {% if topic.is_sticky %}
                    <i class="fas fa-thumbtack"></i>
                {% endif %}
                <br>
                <span class="small">
                    {% translate "Started by" %} {{ topic.user_started|main_character_name }}
                </span>
            </p>
        </div>

        <div class="aa-forum-topic-stats hidden-sm hidden-xs">
            <span class="small">
                {% if topic.num_posts > 0 %}
                    {% if topic.num_posts == 2 %}
                        1 {% translate "Reply" %}
                    {% else %}
                        {{ topic.num_posts|add:"-1" }} {% translate "Replies" %}
                    {% endif %}
                {% else %}
                    0 {% translate "Replies" %}
                {% endif %}
            </span>
        </div>

        <div class="aa-forum-topic-last-post hidden-xs">
            <span class="small">
                {% translate "Last post" %} {{ topic.time_modified|date }}, {{ topic.time_modified|time:"G:i:s" }}
                <a href="{% url 'aa_forum:forum_message_entry_point_in_topic' topic.last_message.pk %}" title="{% translate 'Go to last message' %}">
                    <i class="fas fa-sign-in-alt"></i>
                </a>
                <br>
                by {{ topic.user_updated|main_character_name }}
            </span>
        </div>

        <div class="aa-forum-topic-actions hidden-xs">
{#            {% if topic.user_started == request.user or perms.aa_forum.manage_forum %}#}
{#                {% if topic.is_locked %}#}
{#                    <button class="btn btn-aa-forum-topic-moderation btn-xs" title="{% translate 'Unlock/Re-Open Topic' %}">#}
{#                        <i class="fas fa-unlock"></i>#}
{#                    </button>#}
{#                {% else %}#}
{#                    <button class="btn btn-aa-forum-topic-moderation btn-xs" title="{% translate 'Lock/Close Topic' %}">#}
{#                        <i class="fas fa-lock"></i>#}
{#                    </button>#}
{#                {% endif %}#}
{#            {% endif %}#}

{#            {% if perms.aa_forum.manage_forum %}#}
{#                <button class="btn btn-aa-forum-topic-moderation btn-xs"><i class="fas fa-thumbtack"></i></button>#}
{#            {% endif %}#}
        </div>
    </div>
</div>
