{% extends 'unfold/layouts/skeleton.html' %}

{% load i18n unfold %}

{% block base %}
    <div id="page" class="flex min-h-screen">
        {% if not is_popup and is_nav_sidebar_enabled %}
            {% block nav-sidebar %}
                {% include "admin/nav_sidebar.html" %}
            {% endblock %}
        {% endif %}

        <div id="main" class="flex-grow">
            {% if not is_popup %}
                {% block header %}
                    <div class="border-b border-gray-200 mb-6 px-4 lg:px-12 dark:border-gray-800">
                        <div class="container flex items-center h-16 mx-auto py-4">
                            <div id="header-inner" class="flex items-center w-full">
                                <div class="flex items-center w-full">
                                    {% block usertools %}
                                        {% if has_permission %}
                                            {% block welcome-msg %}
                                                {% include 'unfold/helpers/welcomemsg.html' %}
                                            {% endblock %}

                                            {% block userlinks %}
                                                {% include 'unfold/helpers/userlinks.html' %}
                                            {% endblock %}
                                        {% endif %}
                                    {% endblock %}
                                </div>
                            </div>
                        </div>
                    </div>
                {% endblock %}
            {% endif %}

            {% if not is_popup %}
                {% spaceless %}
                    {% block breadcrumbs %}
                        <div class="px-4 lg:px-12">
                            <div class="container mb-12 mx-auto -my-3">
                                <ul class="flex">
                                    {% url 'admin:index' as link %}
                                    {% trans 'Home' as name %}
                                    {% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %}
                                    {% block custom_breadcrumbs %}{% endblock %}
                                </ul>
                            </div>
                        </div>
                    {% endblock %}
                {% endspaceless %}
            {% endif %}

            {% block messages %}
                <div class="px-4 lg:px-12">
                    <div class="container mx-auto">
                        {% include "unfold/helpers/messages.html" %}
                    </div>
                </div>
            {% endblock messages %}

            <div class="px-4 pb-12 lg:px-12">
                <div id="content" class="container mx-auto {% block coltype %}colM{% endblock %}">
                    {% if cl %}
                        {% tab_list cl.opts %}
                    {% elif opts %}
                        <div class="mb-8">
                            {% tab_list opts %}
                        </div>
                    {% endif %}

                    {% block content %}
                        {% block object-tools %}{% endblock %}

                        {{ content }}
                    {% endblock %}

                    {% block sidebar %}{% endblock %}
                </div>
            </div>

            {% block footer %}{% endblock %}
        </div>
    </div>
{% endblock %}
