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

{% block content %}
<article>
    <h1><img src="{% static 'images/customer.png' %}" alt=""> Customers</h1>
    <section class="object__list">
        <div class="object__item object__item--header" href="customer-detail">
            <span>Name</span>
            <span>Email</span>
            <span>Orders</span>
        </div>
    {% for customer in user_list  %}
        <a class="object__item" href="{% url 'dashboard:customer-detail' customer.pk %}">
            <span>{{customer.get_full_name}}</span>
            <span>{{customer.email}}</span>
            <span>{{customer.num_orders}}</span>
        </a>
    {% empty %}
        <span class="object__item">No customers</span>
    {% endfor %}
    </section>
</article>
{% endblock content %}
