{% extends "wagtailadmin/generic/edit.html" %}
{% load wagtailadmin_tags i18n %}
{% block titletag %}{% blocktrans trimmed with snippet_type_name=model_opts.verbose_name %}Editing {{ snippet_type_name }} - {{ object }}{% endblocktrans %}{% endblock %}
{% block bodyclass %}{% if locked_for_user %}content-locked{% endif %}{% endblock %}

{% block main_content %}
    {% include "wagtailmenus/includes/header_with_site_switcher.html" with title=object icon=header_icon merged=1 %}
    {{ block.super }}
{% endblock %}

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

    <script>
        // Set wagtailConfig.ACTIVE_CONTENT_LOCALE if this is a translated page
        // This value may be used by JS widgets on the form
        {% if locale %}
            window.wagtailConfig = window.wagtailConfig || {};
            window.wagtailConfig.ACTIVE_CONTENT_LOCALE = '{{ locale.language_code|escapejs }}';
        {% endif %}
    </script>

    {% if workflow_enabled %}
        {% include "wagtailadmin/shared/_workflow_init.html" %}
    {% endif %}
{% endblock %}
