{% load i18n admin_urls adminlte_helpers static admin_list %}
{% block extrahead %}
<link rel="stylesheet" type="text/css" href="{% static 'admin-lte/plugins/datatables-bs4/css/dataTables.bootstrap4.css' %}">
{% endblock %}

{% if result_hidden_fields %}
<div class="hiddenfields">{# DIV for HTML validation #}
  {% for item in result_hidden_fields %}{{ item }}{% endfor %}
</div>
{% endif %}
{% if results %}
<div class="row">
  <div class="col-12">
    <div class="card">
      <div class="card-body table-responsive">
        <table id="result_list" class="table table-hover table-striped  table-head-fixed">
          <thead>
            <tr>
              {% for header in result_headers %}
              <th >
                  <span>{{ header.text|capfirst }}</span>
              </th>{% endfor %}
            </tr>
          </thead>
          <tbody>
            {% for result in results %}
            {% if result.form.non_field_errors %}
            <tr>
              <td colspan="{{ result|length }}">{{ result.form.non_field_errors }}</td>
            </tr>
            {% endif %}
            <tr class="{% cycle 'row1' 'row2' %}">{% for item in result %}{{ item }}{% endfor %}</tr>
            {% endfor %}
          </tbody>
          <tfoot>
              <tr>
                {% for header in result_headers %}
                <th>
                    <span>{{ header.text|capfirst }}</span>
                </th>{% endfor %}
              </tr>
          </tfoot>
        </table>
      </div>
    </div>
  </div>
</div>

{% endif %}

