{% extends 'dashboard/layout.html' %}
{% load i18n %}

{% block title %}
{% trans "Approval event log" %} | {{ block.super }}
{% endblock %}

{% block breadcrumbs %}
<ul class="breadcrumb">
    <li>
    <a href="{% url dashboard:index %}">{% trans "Dashboard" %}</a>
        <span class="divider">/</span>
    </li>
    <li class="active"><a href=".">{% trans "Approval event log" %}</a></li>
</ul>
{% endblock %}

{% block header %}
<div class="page-header">
    <h1>{% trans "Approval event log" %}</h1>
</div>
{% endblock header %}

{% block dashboard_content %}
    {% if object_list %}
    <table class="table table-striped table-bordered">
        <tr>
            <th>{% trans "Order number" %}</th>
            <th>{% trans "Product" %}</th>
            <th>{% trans "Customer" %}</th>
            <th>{% trans "Approver" %}</th>
            <th>{% trans "Event" %}</th>
            <th>{% trans "Date" %}</th>
        </tr>
        {% for object in object_list %}
        <tr>
            <td>{{ object.line.order.number }}</td>
            <td>{{ object.line.product.title }}</td>
            <td>{{ object.line.order.user.first_name }} {{ object.line.order.user.last_name }}</td>
            <td>{{ object.user.first_name }} {{ object.user.last_name }}</td>
            <td>{{ object.event_type }}</td>
            <td>{{ object.event_date }}</td>
        </tr>
        {% endfor %}
    </table>

    {% if page_obj %}
        {% include "catalogue/partials/pagination.html" %}
    {% endif %}

    {% else %}

    <p>{% trans "There are currently no approval event logs." %}</p>

    {% endif %}

{% endblock dashboard_content %}
