{% extends "wagtailadmin/generic/base.html" %}
{% load i18n wagtailadmin_tags %}

{% block content %}
    {% fragment as editing_actions %}
        {% if site_switcher %}
            <form method="get" id="settings-site-switch" novalidate>
                <label for="{{ site_switcher.site.id_for_label }}">
                    {% trans "Site" %}:
                </label>
                {{ site_switcher.site }}
            </form>
        {% endif %}
    {% endfragment %}
    {% include "wagtailadmin/shared/header.html" with title=page_title icon=header_icon subtitle=page_subtitle merged=1 extra_actions=editing_actions only %}

    <form action="{{ action_url }}" method="POST" novalidate{% if form.is_multipart %} enctype="multipart/form-data"{% endif %}>
        {% csrf_token %}

        <div class="nice-padding">
            {{ edit_handler.render_form_content }}
        </div>

        <footer class="footer">
            <div class="actions footer__container w-flex">
                <button
                    type="submit"
                    class="button button-longrunning w-flex-grow"
                    data-controller="w-progress"
                    data-action="w-progress#activate"
                    data-w-progress-active-value="{% trans 'Saving…' %}"
                >
                    {% icon name="spinner" %}
                    <em data-w-progress-target="label">{% trans 'Save' %}</em>
                </button>
            </div>
        </footer>
    </form>

{% endblock %}

{% block extra_css %}
    {{ block.super }}
    {{ media.css }}
{% endblock %}
{% block extra_js %}
    {{ block.super }}
    {% include "wagtailadmin/pages/_editor_js.html" %}
    {{ media.js }}
{% endblock %}
