{% extends 'oscar/dashboard/reports/index.html' %}

{% load currency_filters %}
{% load i18n %}

{% block report %}
<table class="table table-striped table-bordered table-hover">
    {% if objects %}
        <tr>
            <th>{% trans "Product" %}</th>
            <th>{% trans "Partner" %}</th>
            <th>{% trans "Low stock threshold" %}</th>
            <th>{% trans "Current available stock" %}</th>
            <th>{% trans "Date alert raised" %}</th>
        </tr>
        {% for alert in objects %}
        <tr>
            <td>
                <a href="{{ alert.stockrecord.product.get_absolute_url }}">
                    {{ alert.stockrecord.product.get_title }}
                </a>
            </td>
            <td>{{ alert.stockrecord.partner.display_name }}</td>
            <td>{{ alert.stockrecord.low_stock_threshold }}</td>
            <td>{{ alert.stockrecord.net_stock_level }}</td>
            <td>{{ alert.date_created }}</td>
        </tr>
        {% endfor %}
    {% else %}
        <tr>
            <td>
                {% trans "No stock alerts were created in this period" %}
            </td>
        </tr>
    {% endif %}
</table>
{% include "oscar/dashboard/partials/pagination.html" %}
{% endblock %}
