{% extends 'kfet/base.html' %}

{% block title %}Categories d'articles{% endblock %}
{% block content-header-title %}Categories d'articles{% endblock %}

{% block content %}

<div class="row">
  <div class="col-sm-4 col-md-3 col-content-left">
    <div class="content-left">
      <div class="content-left-top">
        <div class="line line-big">{{ categories|length }}</div>
        <div class="line line-bigsub">catégorie{{ categories|length|pluralize }}</div>
      </div>
    </div>
  </div>
  <div class="col-sm-8 col-md-9 col-content-right">
    {% include 'kfet/base_messages.html' %}
    <div class="content-right">
      <div class="content-right-block">
        <h2>Liste des catégories</h2>
        <div class="table-responsive">
          <table class="table table-condensed">
            <thead>
              <tr>
                <td></td>
                <td>Nom</td>
                <td class="text-right">Nombre d'articles</td>
                <td class="text-right">Peut être majorée</td>
              </tr>
            </thead>
            <tbody>
              {% for category in categories %}
                <tr>
                  <td class="text-center">
                    <a href="{% url 'kfet.category.update' category.pk %}">
                      <span class="glyphicon glyphicon-cog"></span>
                    </a>
                  </td>
                  <td>{{ category.name }}</td>
                  <td class="text-right">{{ category.articles.all|length }}</td>
                  <td class="text-right">{{ category.has_addcost | yesno:"Oui,Non"}}</td>
                </tr>
              {% endfor %}
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
</div>

{% endblock %}
