{% extends "georgeforge/base.html" %}
{% load i18n %}
{% load humanize %}
{% load static %}
{% load django_bootstrap5 %}
{% block details %}
    <h4>In Progress Orders</h4>
    <table class="table">
        <thead>
            <tr>
                <th scope="col">{% translate "Order ID" %}</th>
                <th scope="col">{% translate "Item" %}</th>
                <th scope="col">{% translate "Delivery System" %}</th>
                <th scope="col">{% translate "Paid" %}</th>
                <th scope="col">{% translate "Status" %}</th>
            </tr>
        </thead>
        <tbody>
            {% for entry in my_orders %}
                <tr>
                    <th scope="row">{{ entry.id }}</th>
                    <td>
                        {{ entry.quantity }} x
                        <img height="24"
                             width="24"
                             src="{{ entry.eve_type.icon_url }}"
                             alt="{% translate 'Item Icon' %}" />
                        {% translate entry.eve_type.name %}
                    </td>
                    <td>{% translate entry.deliverysystem.name %}</td>
                    <td>
                        {{ entry.paid|intcomma }}/{{ entry.totalcost|intcomma }} ISK
                        {% if entry.deposit > entry.paid and entry.status == 20 %}
                            <br />
                            <b>Deposit due: {{ entry.deposit|intcomma }} ISK</b>
                        {% endif %}
                    </td>
                    <td>{% translate entry.get_status_display %}</td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
    <h4>Completed Orders</h4>
    <table class="table">
        <thead>
            <tr>
                <th scope="col">{% translate "Order ID" %}</th>
                <th scope="col">{% translate "Item" %}</th>
                <th scope="col">{% translate "Delivery System" %}</th>
                <th scope="col">{% translate "Paid" %}</th>
                <th scope="col">{% translate "Status" %}</th>
            </tr>
        </thead>
        <tbody>
            {% for entry in done_orders %}
                <tr>
                    <th scope="row">{{ entry.id }}</th>
                    <td>
                        {{ entry.quantity }} x
                        <img height="24"
                             width="24"
                             src="{{ entry.eve_type.icon_url }}"
                             alt="{% translate 'Item Icon' %}" />
                        {% translate entry.eve_type.name %}
                    </td>
                    <td>{% translate entry.deliverysystem.name %}</td>
                    <td>
                        {{ entry.paid|intcomma }}/{{ entry.totalcost|intcomma }} ISK
                        {% if entry.deposit > entry.paid and entry.status == 20 %}
                            <br />
                            <b>Deposit due: {{ entry.deposit|intcomma }} ISK</b>
                        {% endif %}
                    </td>
                    <td>{% translate entry.get_status_display %}</td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
{% endblock details %}
{% block extra_javascript %}
{% endblock extra_javascript %}
{% block extra_css %}
{% endblock extra_css %}
{% block extra_script %}
{% endblock extra_script %}
