{% extends 'slick_reporting/base.html' %}
{% load crispy_forms_tags i18n slick_reporting_tags %}

{% block content %}
    <div class="col-12">
        {% if form %}
            <form id="reportForm" class="card">
                <div class="card-header">
                    <h3 class="card-title">{% trans "Filters" %}</h3>
                </div>
                <div class="card-body">
                    {% crispy form crispy_helper %}
                </div>
                <div class="card-footer text-end">
                    <input type="submit" value="{% trans "Filter" %}"
                           class="btn btn-primary  refreshReport" data-get-results-button>


                    {% for export_action in report.get_export_actions %}
                        <button class="btn {{ export_action.css_class }}" data-export-btn
                                data-export-parameter="{{ export_action.parameter }}" data-form-selector="#reportForm">
                            {% if export_action.icon %}<i class="{{ export_action.icon }}"></i> {% endif %}
                            {{ export_action.title }} </button>
                    {% endfor %}
                </div>
            </form>
        {% endif %}

        <div class="card" id="{{ report.report_slug }}">
            <div class="card-header">
                <h5 class="card-title">{% trans "Results" %}</h5>
            </div>
            <div class="card-body">
                <div data-report-widget
                     data-report-url="{{ request.path }}"
                     data-extra-params=""
                     data-form-selector="#reportForm"
                        {% if not auto_load %} data-no-auto-load{% endif %}
                     data-display-chart-selector="True">
                    <div data-report-chart>
                    </div>
                    <div data-report-table>
                    </div>
                </div>
            </div>
        </div>
    </div>

{% endblock %}

{% block extrajs %}
    {{ block.super }}
    {% get_charts_media report.get_chart_settings %}
{% endblock %}