{% extends "wagtailadmin/base.html" %}
{% load i18n wagtailadmin_tags %}
{% block titletag %}{% blocktrans %}Editing {{ setting_type_name}} - {{ instance }}{% endblocktrans %}{% endblock %}
{% block bodyclass %}menu-settings{% endblock %}
{% block content %}
    <header class="nice-padding {% if tabbed %}merged tab-merged{% endif %}">
        <div class="row">
            <div class="left">
                <div class="col">
                    <h1>
                        {% icon name="cogs" class_name="header-title-icon" %}
                        {% trans "Editing" %}
                        <span>{{ setting_type_name|capfirst }}</span>
                    </h1>
                </div>
            </div>
            <div class="right">
                {% if site_switcher %}
                <div class="field choice_field">
                    <form method="get" class="setting-site-switch-form" id="settings-site-switch" novalidate>
                        <label for="{{ site_switcher.site.id_for_label }}">
                            {% trans "Site" %}:
                        </label>
                        <div class="input">
                            {{ site_switcher.site }}
                            <span></span>
                        </div>
                    </form>
                </div>
                {% endif %}
            </div>
        </div>
    </header>

    <form action="{% url 'wagtailsettings:edit' opts.app_label opts.model_name site.pk %}" method="POST" novalidate{% if form.is_multipart %} enctype="multipart/form-data"{% endif %}>
        {% csrf_token %}
        {{ edit_handler.render_form_content }}

        <footer>
            <ul>
                <li class="actions dropdown dropup match-width">
                    <button type="submit" class="button button-longrunning" data-clicked-text="{% trans 'Saving…' %}">{% icon name="spinner" %}<em>{% trans 'Save' %}</em></button>
                </li>
            </ul>
        </footer>
    </form>

{% endblock %}

{% block extra_css %}
    {{ block.super }}
    {% include "wagtailadmin/pages/_editor_css.html" %}
    {{ edit_handler.form.media.css }}
    {{ site_switcher.media.css }}
{% endblock %}
{% block extra_js %}
    {{ block.super }}
    {% include "wagtailadmin/pages/_editor_js.html" %}
    {{ edit_handler.form.media.js }}
    {{ edit_handler.html_declarations }}
    {{ site_switcher.media.js }}
{% endblock %}
