{% extends "dashboard.html" %}
{% load static %}

{% block content %}
<article>
    <header class="object__header">
        <h1><img src="{% static "images/box.png" %}" alt=""> Orders</h1>
    </header>
    <section class="object__list">
        <div class="object__item object__item--header" href="order-detail">
            <span>Order #</span>
            <span>Date</span>
            <span>Customer</span>
            <span>Status</span>
            <span>Total</span>
        </div>
    {% for order in order_list  %}
        <a class="object__item" href="{% url 'dashboard:order-detail' order.pk %}">
            <span>#{{order.pk}}</span>
            <span>{{order.created_at|date:"D, M j Y"}}</span>
            <span>{{order.customer.get_full_name}}</span>
            <span class="order__status--display">
                <div class="status__dot order__status--{{order.status}}"></div>
                {{order.get_status_display}}</span>
            <span>${{order.total_net_amount}}</span>
        </a>
    {% empty %}
        <span class="object__item">No orders</span>
    {% endfor %}
    </section>
</article>
{% endblock content %}
