{% extends 'oscar/dashboard/reports/index.html' %}
{% load dashboard_tags %}
{% load i18n %}
{% load render_table from django_tables2 %}


{% block dashboard_content %}
    <div class="table-header">
        <h3><i class="fas fa-chart-bar"></i>{% trans "Reporting dashboard" %}</h3>
    </div>
    <div class="card card-body">
        <form id="generate_report_form" method="post" class="form-inline">
            {% csrf_token %}
            {% include "oscar/dashboard/partials/form_fields_inline.html" with form=form %}
            <span class="form-group mr-2">
                <button type="submit" class="btn btn-primary" data-loading-text="{% trans 'Generating...' %}">
                    {% trans "Generate report" %}
                </button>
            </span>
        </form>
    </div>

    {% block report_list %}
        {% if reports.data %}
            {% render_table reports %}
        {% else %}
            <table class="table table-striped table-bordered table-hover">
                <caption>{{ queryset_description }}</caption>
                <tr><td>{% trans "No reports found." %}</td></tr>
            </table>
        {% endif %}
    {% endblock %}

    {% if description %}
        <div class="table-header">
            <h3><i class="fas fa-chart-bar"></i>{{ description }}</h3>
        </div>
    {% endif %}

    {% block report %}
    {% endblock %}
{% endblock dashboard_content %}
