<div class="panel category-panel">
    <div class="panel-heading category-head">
        <a href="{{ category.url }}">{{ category.title }}</a>
    </div>

    <div class="panel-body category-body">
        <div class="category-meta">
            <div class="col-md-5 col-sm-5 col-xs-8 forum-name">{% trans %}Forum{% endtrans %}</div>
            <div class="col-md-2 col-sm-2 hidden-xs forum-stats">{% trans %}Topics{% endtrans %}</div>
            <div class="col-md-2 col-sm-2 hidden-xs forum-stats">{% trans %}Posts{% endtrans %}</div>
            <div class="col-md-3 col-sm-3 col-xs-4 forum-last-post">{% trans %}Last Post{% endtrans %}</div>
        </div>
        {% for forum, forumsread in forums %}
        <div class="row category-row hover">

            {% if forum.external %}
            <div class="col-md-5 col-sm-5 col-xs-8 forum-info">
                <div class="row">
                    <!-- Icon -->
                    <div class="col-md-1 col-sm-2 col-xs-2 forum-status">
                        <span class="fa fa-external-link fa-fw forum-external"></span>
                    </div>

                    <div class="col-md-11 col-sm-10 col-xs-10">
                        <!-- Forum Name -->
                        <div class="forum-name">
                            <span class="forum-link">{% trans %}Link to{% endtrans %}:</span> <a href="{{ forum.url }}">{{ forum.title }}</a>
                        </div>

                        <!-- Forum Description -->
                        <div class="forum-description">
                            {{ forum.description|markup }}
                        </div>
                    </div>
                </div>
            </div> <!-- end forum-info -->

            <!-- Post Count -->
            <div class="col-md-2 col-sm-2 hidden-xs forum-posts">
                -
            </div>

            <!-- Topic Count -->
            <div class="col-md-2 col-sm-2 hidden-xs forum-topics">
                -
            </div>

            <!-- Last Post -->
            <div class="col-md-3 col-sm-3 col-xs-4 forum-last-post">
                ---
            </div>
            {% else %}
            <div class="col-md-5 col-sm-5 col-xs-8 forum-info">
                <div class="row">
                    <!-- Icon -->
                    <div class="col-md-1 col-sm-2 col-xs-2 forum-status">
                        {% if forum.locked %}
                            <span class="fa fa-lock fa-fw forum-locked"></span>
                        {% elif forum|forum_is_unread(forumsread, current_user) %}
                            <span class="fa fa-comments fa-fw forum-unread"></span>
                        {% else %}
                            <span class="fa fa-comments-o fa-fw forum-read"></span>
                        {% endif %}
                    </div>

                    <div class="col-md-11 col-sm-10 col-xs-10">
                        <!-- Forum Name -->
                        <div class="forum-name">
                            <a href="{{ forum.url }}">{{ forum.title }}</a>
                        </div>

                        <!-- Forum Description -->
                        <div class="forum-description">
                            {{ forum.description|markup }}
                        </div>

                        <!-- Forum Moderators -->
                        {% if forum.show_moderators %}
                        <div class="forum-moderators">
                            {% trans %}Moderators{% endtrans %}:
                            {% for moderator in forum.moderators %}
                            <a href="{{ url_for('user.profile', username=moderator.username) }}">{{ moderator.username }}</a>{% if not loop.last %}, {% endif %}
                            {% endfor %}
                        </div>
                        {% endif %}
                    </div>
                </div>
            </div> <!-- end forum-info -->

            <!-- Post Count -->
            <div class="col-md-2 col-sm-2 hidden-xs forum-topics">
            {{ forum.topic_count }}
            </div>

            <!-- Topic Count -->
            <div class="col-md-2 col-sm-2 hidden-xs forum-posts">
            {{ forum.post_count }}
            </div>

            <!-- Last Post -->
            <div class="col-md-3 col-sm-3 col-xs-4 forum-last-post">
                {% if forum.last_post_id %}
                <div class="last-post-title">
                    <a href="{{ forum.last_post_url }}" title="{{ forum.last_post_title }}">
                        {{ forum.last_post_title|crop_title }}
                    </a>
                </div>

                <div class="last-post-time">
                    {{ forum.last_post_created|time_since }}
                </div>

                <div class="last-post-author">
                    {% trans %}by{% endtrans %}
                    {% if forum.last_post_user_id %}
                    <a href="{{ url_for('user.profile', username=forum.last_post_username) }}">{{ forum.last_post_username }}</a>
                    {% else %}
                    {{ forum.last_post_username }}
                    {% endif %}
                </div>

                {% else %}
                {% trans %}No posts.{% endtrans %}
                {% endif %} {# endif forum.last_post_id #}
            </div>

        {% endif %} {# endif forum.external #}
        </div> <!-- end category-content -->

        {% endfor %}
    </div>
</div>
