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

{% block title %}Liste des caisses{% endblock %}
{% block content-header-title %}Caisses{% 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 text-center">
        <div class="line line-big">{{ checkouts|length }}</div>
        <div class="line line-bigsub">caisse{{ checkouts|length|pluralize }}</div>
      </div>
      <div class="buttons">
        <a class="btn btn-primary btn-lg" href="{% url 'kfet.checkout.create' %}">Créer une caisse</a>
      </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 caisses</h2>
        <div class="table-responsive">
          <table class="table table-condensed">
            <thead>
              <tr>
                <td></td>
                <td>Nom</td>
                <td class="text-right">Balance</td>
                <td class="text-right">Déb. valid.</td>
                <td class="text-right">Fin valid.</td>
                <td class="text-right">Protégée</td>
              </tr>
            </thead>
            <tbody>
              {% for checkout in checkouts %}
                <tr>
                  <td>
                    <a href="{% url 'kfet.checkout.read' checkout.pk %}">
                      <span class="glyphicon glyphicon-cog"></span>
                    </a>
                  </td>
                  <td>{{ checkout.name }}</td>
                  <td class="text-right">{{ checkout.balance}}€</td>
                  <td class="text-right">{{ checkout.valid_from }}</td>
                  <td class="text-right">{{ checkout.valid_to }}</td>
                  <td class="text-right">{{ checkout.is_protected }}</td>
                </tr>
              {% endfor %}
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
</div>

{% endblock %}
