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

{% load i18n %}


{% block body %}
    <h1>{% trans "List of orders" %}</h1>

    {% if object_list %}
    {% include "plans/pagination.html" %}

    <table class="table">
        <thead>
            <tr>
                <th>ID</th>
                <th>{% trans 'Name' %}</th>
                <th>{% trans 'Created' context 'order created' %}</th>
                <th>{% trans 'Status' context 'order status' %}</th>
                <th>{% trans 'Completed' context 'order completed' %}</th>
                <th>{% trans 'Total' context 'total amount, value' %}</th>
            </tr>
        </thead>
        <tbody>
            {% for order in object_list %}
            <tr class="{% if order.status == 2 %}success{% elif order.status == 3 %}danger{% elif order.status == 4 %}warning{% elif order.status == 5 %}info{% endif %}">
                <td><a href="{{ order.get_absolute_url }}">{{ order.pk }}</a></td>
                <td><a href="{{ order.get_absolute_url }}">{{ order.name }}</a></td>
                <td class="date">{{ order.created|date }}</td>
                <td class="status">{{ order.get_status_display }}</td>
                <td class="date">{{ order.completed|date|default:"-" }}</td>
                <td class="number">{{ order.total }}&nbsp;{{ CURRENCY }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>

    {% include "plans/pagination.html" %}

    {% else %}
        {% blocktrans %}You do not have any orders so far.{% endblocktrans %}
    {% endif %}
{% endblock %}