{% load admin_list unfold_list %}

<div class="result-list-wrapper {% if not tab %}mt-6{% endif %}" x-data="{action: '', selectAcross: '0'}" {% if tab %}x-show="activeTab == 'dataset-{{ dataset.model_name }}'"{% else %}x-show="activeTab == 'general'"{% endif %}>
    {% if not tab %}
        {% include "unfold/helpers/inline_heading.html" with title=dataset.model_verbose_name %}
    {% endif %}

    {% if cl.search_fields or action_form %}
        <div class="flex flex-col gap-4 justify-between mb-4  sm:flex-row empty:hidden lg:border lg:border-base-200 lg:dark:border-base-800 lg:-mb-8 lg:p-3 lg:pb-11 lg:rounded-t-default">
            {% if cl.search_fields %}
                {% unfold_search_form cl %}
            {% endif %}

            {% if action_form %}
                {% unfold_admin_actions %}
            {% endif %}
        </div>
    {% endif %}

    <form id="dataset-{{ dataset.model_name }}-group" class="group" method="post"{% if cl.formset and cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %} novalidate>
        {% csrf_token %}

        <input type="hidden" name="dataset" value="{{ id }}">
        <input type="hidden" name="action" x-model="action">
        <input type="hidden" name="select_across" x-model="selectAcross">

        {% if cl.formset %}
            {{ cl.formset.management_form }}
        {% endif %}

        {% unfold_result_list cl %}
    </form>

    {% pagination cl %}
</div>
