{% extends 'lara_django_base/lara_base.html' %}

{% load django_tables2 %}
{% load crispy_forms_tags %}


{% block toolbar_old %}
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
    <h1 class="h2"> {{ section_title }} </h1>
    <div class="btn-toolbar mb-2 mb-md-0">
        <div class="btn-group me-2">
            <a href="{% url create_link %}" class="btn btn-warning btn-sm btn-outline-secondary" role="button">Add</a>
            <button type="button" class="btn btn-sm btn-outline-secondary">Export</button>
        </div>
        <button type="button" class="btn btn-sm btn-outline-secondary dropdown-toggle">
            <span data-feather="sync"></span>
            Sync
        </button>
    </div>
</div>
{% endblock toolbar_old %}
{% block toolbar %}
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
    <h1 class="h2"> {{ section_title }} </h1>
    {% if filter %}
    <form action="" method="get" class="form form-inline d-flex flex-wrap mb-2 mb-md-0 col-sm-1  align-items-center flex-md-nowrap ">
        {% csrf_token %}

        <!-- bootstrap_form filter.form layout='inline' %}
        {% bootstrap_button 'filter' layout='inline'  -->
    </form>
    {% endif %}
    <div class="btn-toolbar mb-2 mb-md-0">
        <div class="btn-group me-2">
            <a href="{% url create_link %}" class="btn btn-warning btn-sm btn-outline-secondary" role="button">Add</a>
            {% if view.export_formats %}
            {% for format in view.export_formats %}
            <button type="button" class="btn btn-sm btn-outline-secondary">
                <a href="{% export_url format %}" >
                    download  <code>.{{ format }}</code>
                </a>
            </button>
            {% endfor %}
            {% endif %}
        </div>
        <button type="button" class="btn btn-sm btn-outline-secondary dropdown-toggle">
            <span data-feather="sync"></span>
            Sync
        </button>
    </div>
</div>
{% endblock %}

{% load render_table from django_tables2 %}

{% block content %}
 
<a href="{% url create_link %}" class="btn bg-green-500 text-white float-right">Add</a>
       
    <div class="flex lg:justify-center lg:py-8 ">
        <div class="overflow-x-auto">
            {% render_table table %}
        </div>
        </div>
    </div>
{% endblock %}