{% extends "lbforum/base_site.html" %}

{% load i18n %}
{% load lbforum_filters %}
{% load lbforum_tags %}
{% load lbutils %}
{% load lbforum_widget_tags %}
{% load el_pagination_tags %}

{% block title %}
  {{ forum }} - {% get_setting "LBFORUM_TITLE" %}
{% endblock %}

{% block content_right_bar %}

  {% if forum.description %}
    <div class="box">
      <div class="cell">
        <span class="fade">{% trans "Forum Description" %}</span>
      </div>
      <div class="inner">
        {{forum.description|bbcode|safe}}
      </div>
    </div>
    <div class="sep20"></div>
  {% endif %}

  {% if forum.admins.all.count %}
    <div class="box">
      <div class="cell">
        <span class="fade">{% trans "Forum Admin" %}</span>
      </div>
      <div class="inner">
        {% for o in forum.admins.all %}
          <a class="item_node" href="{% url 'lbforum_profile' o.pk %}">
            <span> {{ o.lbforum_profile }} </span>
          </a>
        {% endfor %}
      </div>
    </div>
    <div class="sep20"></div>
  {% endif %}

    {% lbf_categories_and_forums %}
    <div class="sep20"></div>

    {% if forum.topictype_set.all.count %}
      <div class="box">
        <div class="cell">
          <span class="fade">{% trans "Topic Type" %}</span>
        </div>
        <div class="inner">
          <a class="item_node {% if not topic_type2 %}selected{% endif %}" 
              href="{% forum_url forum topic_type "" %}">
            <span> {% trans "All" %} </span>
          </a>
          {% for tp in forum.topictype_set.all %}
            <a class="item_node {% if topic_type2 == tp.slug %}selected{% endif %}" 
                href="{% forum_url forum topic_type tp.slug %}">
              <span> {{ tp }} </span>
            </a>
          {% endfor %}
        </div>
      </div>
    {% endif %}
{% endblock %}

{% block content_content %}
  {% paginate topics %}
  {% get_pages %}
  <div class="box">
    <div class="cell" style="padding-bottom: 0px;">
      <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr>
          <td width="auto" valign="top">
            <div class="fr" align="right">
              <span class="snow">
                {% trans "Topics" %}
                <strong>
                  [ {% page_range_info pages %} ]
                </strong>
              </span>
            </div>
            <span class="bigger">
              <a href="{% url 'lbforum_index' %}">{% trans "Home" %}</a>
              <span class="chevron">&raquo;</span>
              {{ forum }}
            </span>
            <div class="sep10"></div>
            <div class="sep10"></div>
            <div align="left">
              <a href="{% url 'lbforum_new_topic' forum_id=forum.pk %}" class="super normal button">{% trans "Post new topic" %}</a>
            </div>
            <div class="sep5"></div>
            <div class="sep10"></div>
            <div>
              <div class="tp-btn {% if topic_type != "good" %}selected{% endif %}">
                <a href="{% forum_url forum "" topic_type2 %}">{% trans "All" %}</a>
              </div>
              <div class="tp-btn {% if topic_type == "good" %}selected{% endif %}">
                <a href="{% forum_url forum "good" topic_type2 %}">{% trans "Distillate District" %}</a>
              </div>
            </div>
          </td>
        </tr>
      </table>
    </div>
    {% include 'lbforum/inc_topic_list.html' %}
    <div class="inner">
      {% show_pages %}
    </div>
  </div>
{% endblock %}
