{% extends 'ra/admin/base.html' %}

{% load ra_tags i18n %}

{% block content %}
    <style>
        td[class*='_id'], th[data-id*='_id'] {
            display: none;
        }
    </style>
    <div class="row">
        <div class="col-sm-12">
            <h5 class="text-center no-margin text-bold reportTitle">
                {{ response.report_title }}
            </h5>
            <h5 class="text-center no-margin-top text-semibold reportSubTitle" style="margin-bottom: 25px">
                {{ response.report_sub_title }}
            </h5>
        </div>
    </div>
    <div class="tableContainer">
    </div>
    {% block post_table_container %}
        <div class="postTableContainer">
        </div>
    {% endblock %}
{% endblock %}


{% block extra_js %}
    <script src="{{ STATIC_URL }}ra/js/vendor/underscore-min.js"></script>

    <script type="text/javascript" charset="utf8"
            src="{{ STATIC_URL }}ra/js/ra.table.js"></script>

    <script>
        $(document).ready(function () {
            var tableCssClass = 'table table-xxs datatable-basic table-bordered table-striped table-hover ';
            var data = {{ response|jsonify }};
            var datatable_container = $('.tableContainer');
            var print_settings = data['print_settings'];
            if (typeof (print_settings) === 'undefined') {
                print_settings = data.form_settings.print_settings;
                if (typeof (print_settings) === 'undefined') {
                    print_settings = {};
                }
            }
            datatable_container.html(
                constructFullTable('print', tableCssClass, data['columns'], data['column_names'],
                    data.data, print_settings, "{% trans 'Total' %}"));
            window.print();

        })
    </script>
{% endblock %}
