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

{% load admin_urls i18n import_export_tags static %}

{% block extrastyle %}
    {{ block.super }}

    <link rel="stylesheet" type="text/css" href="{% static "import_export/import.css" %}" />
{% endblock %}

{% block extrahead %}
    {{ block.super }}

    <script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>

    {% if confirm_form %}
        {{ confirm_form.media }}
    {% else %}
        {{ form.media }}
    {% endif %}
{% endblock %}

{% block breadcrumbs %}
    <div class="px-4 lg:px-8">
        <div class="container mb-6 mx-auto -my-3 lg:mb-12">
            <ul class="flex flex-wrap">
                {% url 'admin:index' as link %}
                {% trans 'Home' as name %}
                {% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %}

                {% url 'admin:app_list' app_label=opts.app_label as link %}
                {% include 'unfold/helpers/breadcrumb_item.html' with link=link name=opts.app_config.verbose_name %}

                {% url opts|admin_urlname:'changelist' as link %}
                {% include 'unfold/helpers/breadcrumb_item.html' with link=link name=opts.verbose_name_plural|capfirst %}

                {% include 'unfold/helpers/breadcrumb_item.html' with link='' name=cl.opts.verbose_name_plural|capfirst %}

                {% trans 'Import' as name %}
                {% include 'unfold/helpers/breadcrumb_item.html' with link='' name=name %}
            </ul>
        </div>
    </div>
{% endblock %}

{% block content %}
    {% if confirm_form %}
        {% include "admin/import_export/import_confirm.html" %}
    {% else %}
        {% include "admin/import_export/import_form.html" %}
    {% endif %}

    {% if result %}
        {% if result.has_errors %}
            {% include "admin/import_export/import_errors.html" %}
        {% elif result.has_validation_errors %}
            {% include "admin/import_export/import_validation.html" %}
        {% else %}
            {% include "admin/import_export/import_preview.html" %}
        {% endif %}
    {% endif %}
{% endblock %}
