{% extends 'dashboard/reports/index.html' %}
{% load currency_filters %}

{% block report %}
<table class="table table-striped table-bordered">
    <tr>
        <th>Email</th>
        <th>Name</th>
        <th>Date registered</th>
        <th>Product views</th>
        <th>Basket additions</th>
        <th>Orders</th>
        <th>Order lines</th>
        <th>Order items</th>
        <th>Total spent</th>
        <th>Date of last order</th>
    </tr>
    {% for user in objects %}
    <tr>
        <td>{{ user.user.email }}</td>
        <td>{{ user.user.get_full_name|default:"-" }}</td>
        <td>{{ user.user.date_joined }}</td>
        <td>{{ user.num_product_views }}</td>
        <td>{{ user.num_basket_additions }}</td>
        <td>{{ user.num_orders }}</td>
        <td>{{ user.num_order_lines }}</td>
        <td>{{ user.num_order_items }}</td>
        <td>{{ user.total_spent|currency }}</td>
        <td>{{ user.date_last_order|default:"-" }}</td>
    </tr>
    {% endfor %}
</table>
    {% if page_obj %}
        {% include "catalogue/partials/pagination.html" %}
    {% endif %}
{% endblock %}
