{% load datatable_tags %}
{% load ajax_helpers %}


{% lib_include 'datatable' module='django_datatables.includes' %}
    <link href="/static/report_builder/query_builder/css/query-builder.default.css" rel="stylesheet">
    <script type="text/javascript" src="/static/report_builder/jquery_extendext/js/jQuery.extendext.js"></script>
    <script type="text/javascript" src="/static/report_builder/query_builder/js/query-builder.js"></script>

{% if show_pivot_table %}
<div class="col-12 col-sm-6 col-md-5 col-lg-4 col-xl-2 float-left">
    <div class="card jms-card">
        {% filter_control datatable %}
    </div>
</div>
{% endif %}

<div class="{{ show_pivot_table|yesno:"col-12 col-sm-6 col-md-7 col-lg-8 col-xl-10,col-12" }} float-left">
    <div class="card jms-card">
        <div class="card-header">
            <div class="d-flex align-items-center">
                    <h5 class="mr-auto">{{ table_report.name }}</h5>

                     {% block table_buttons %}{{ menus.button_menu.render }}{% endblock %}
            </div>
        </div>
        <div class="card-body jms-datatable-list">
            {% if not show_pivot_table and show_search_bar %}
            <div class="d-flex">
                <div class="p-2">{% no_of_results datatable %}</div>
                <div class="p-2">{% no_of_rows datatable %}</div>
                <div class="ml-auto p-2">{% table_search datatable %}</div>
            </div>
            {% endif %}
            {{ datatable.render|safe }}
        </div>
    </div>
</div>

