{% extends "admin/base.html" %}

{% load i18n admin_tags %}

{% block title %}{% trans "Logs" %}{% endblock %}

{% block breadcrumb %}
    <div class="col-sm-12 pl-0">
      <a href="{{ action_url }}">{{ title }}</a>
    </div><!-- /.col -->
{% endblock %}


{% block content %}
    <form id="changelist_form" action="{{ action_url }}" method="post">
      {% csrf_token %}

      {% block main_buttons %}
          <div class="col-12 p-3">
              <a href="{{ new_object_url }}" class="btn btn-success btn-flat" role="button">
                <i class='fa fa-plus'></i>
                {% trans "New" %}
              </a>
          </div>
      {% endblock main_buttons %}

      {% include "admin/_pagination.html" %}

        <div class="col-12">
          {% if object_list|length > 0 %}
            <table class="table table-striped">
              <thead>
                <tr class="text-uppercase">
                  {% for item in table_header_row %}
                    <th class="border-top-0">
                      {% if forloop.first %}
                        <div id="checkbox_view">
                          <span class="mr-2"><input type="checkbox" id="action_toggle"></span>{{ item }}
                        </div>
                      {% else %}
                        {{ item }}
                      {% endif %}
                    </th>
                  {% endfor %}
                </tr>
              </thead>
              <tbody>
                {% block tbody %}
                  {% for log in object_list %}
                  {% endfor %}
                {% endblock tbody %}
              </tbody>
            </table>
          {% else %}
            {{ empty_list_msg }}
          {% endif %}
      </div>
    </form>
{% endblock %}

{% block widgetsbar %}
  <div class="card">
    <div class="card-body">
      <ul class="collection">
        <li class="collection-item">
            <select form="changelist_form" name="action" class="custom-select" required="">
              <option value="" selected="">---------</option>
              <option value="delete_selected">{{delete_selected_msg}}</option>
            </select>
          
        </li>
        <li class="collection-item d-flex flex-row-reverse mt-3">
            <button  form="changelist_form" form="changelist_form" class="btn btn-primary btn-flat mx-1" type="submit">
              <i class="fa fa-check"></i>
              {% trans "Apply" %}
            </button>
        </li>
      </ul>
    </div>
  </div>
{% endblock %}