{% extends host_template %}

{% load i18n cyclope_utils %}

{% block content %}

{% include 'collections/hierarchycal_navigation_block.html' %}
  <h1 class="title">{{ category }}</h1>
  <div class='forum'>
  <div class='link-create-topic'>
    <a href="{% url category-create_topic category.slug %}">{% trans 'Create a new topic' %}</a>
  </div>
<div class="clear"></div>
  <table >
      <tr>
        <th class="name">{% trans 'Subject' %}</th>
        <th class="comments">{% trans 'Replies'%}</th>
        <th class="created">{% trans 'Created' %}</th>
        <th class="last_comment">{% trans 'Last comment' %}</th>
      </tr>
      {% for categorization in categorizations %}
       {% alias categorization.content_object as 'obj' %}
     <tr>
       <td><h2 class="topic"><a href="{{ obj.url }}">{{ obj.name }}</a></h2></td>
       <td class="comment">{{ obj.comments_count }}</td>
       <td>{{ obj.creation_date|date:'DATETIME_FORMAT' }}
           {% if obj.author %} {% trans 'by' %} {{ obj.author }} {% endif %}
       </td>
       <td>{% if obj.last_comment_date %}{{ obj.last_comment_date|date:'DATETIME_FORMAT' }}  {% trans 'by' %} {{ obj.last_comment_author }} {% endif %}
       </td>
      </tr>  
      {% endfor %}
  </table>
  </div>
  {% if page %}
    {% include 'cyclope/pagination_block.html' %}
  {% endif %}

{% endblock %}
