{% load i18n pybb_tags %}

<div class='category'>
    <h1>{{ category.name }} {% if category.hidden %}[{% trans "Hidden" %}]{% endif %}</h1>
    <table class="category-table">
        <tr class="forum-row head-row">
                <th class="forum-name">
                    {% trans "Forum" %}
                </th>
                <th class="forum-topic-count">
                    {% trans "Topics" %}
                </th>
                <th class="forum-post-count">
                    {% trans "Posts" %}
                </th>
                <th class="forum-last-post">
                    {% trans "Last posts" %}
                </th>
        </tr>
        {% for forum in category.forums_accessed|pybb_forum_unread:user %}
            <tr class="forum-row">
                <td class="forum-name {% if forum.unread %} unread {% endif %}">
                    <div class='state-indicator'></div>
                    <a href='{{ forum.get_absolute_url }}'>{{ forum.name }}</a> {% if forum.hidden %}[{% trans "Hidden" %}]{% endif %}
                    <div class='forum-description'>
                        {{ forum.description|safe }}
                    </div>
                </td>
                <td class="forum-topic-count">
                    {{ forum.topic_count }}
                </td>
                <td class="forum-post-count">
                    {{ forum.post_count }}
                </td>
                <td class="forum-last-post">
                    {% if forum.updated %}
                        {{ forum.updated|date:"d.m.Y H:i" }}
                    {% endif %}
                </td>
            </tr>
        {% empty %}
            <h3>{% trans "No forums created" %}</h3>
            <a href="{% url admin:pybb_forum_add %}">{% trans "Add forum now" %}</a>
        {% endfor %}
    </table>
</div>