{% extends "site_base.html" %}
{% load thumbnail %}

{% block "metas" %}
    <title>{{ title }} - {{ settings.SITE_TITLE }}</title>
    <meta name="description" content="{{ description }}" />
{% endblock "metas" %}

{% block "breadcrumbs" %}
  <ul class="breadcrumb">
    <li><i class="icon-home"></i> <a href="{% url app_forum-forum-index %}">{{ _('Forum') }}</a> <span class="divider">/</span></li>
  </ul>
{% endblock "breadcrumbs" %}

{% block "content" %}
<section id="forum">

  {% include "rforum/_forum-top.html" %}

  <div class="forum">
    <table class="table table-bordered">
      <thead>
        <tr>
          <th colspan="2">{{ _('Forum') }}</th>
          <th style="text-align: center;">{{ _('Topics') }}</th>
          <th>{{ _('Last Post') }}</th>
        </tr>
      </thead>
      <tbody>
        {% for forum in myforum %}
        <tr class="{% if forloop.counter|divisibleby:2 %}even{% else %}odd{% endif %}">
          <td class="forum-image" style="text-align: center;"><img src="{{ STATIC_URL }}img/rforum/forum.gif" alt="{{ forum.title }}"
          title="{{ forum.title }}" style="margin-top: 8px" /></td>
          <td>
            <a href="{% url app_forum-forum-detail forum.slug %}" class="forum-title">{{ forum.title }}</a>
            <p>{{ forum.description|safe }}</p>
            <p>{{ _('Moderators') }}: {% for moder in forum.moderators.all %} <a href="{% url app_forum-userprofile moder %}">{{ moder }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</p>
          </td>
          <td style="text-align: center;">{{ forum.topics.count }}</td>
          <td>{% if forum.topics.all.0.title %}<p><a href="{% url app_forum-topic-list forum.slug forum.topics.all.0.slug %}">{{ forum.topics.all.0.title }}</a></p><p>{{ forum.topics.all.0.date_modified }}</p>{% else %}---{% endif %}</td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
  </div>

  {% include "rforum/_forum-bottom.html" %}

</section>
{% endblock "content" %}
