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

{% block extra_css %}
    {{ block.super }}
    {{ media.css }}
{% endblock %}

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

{% block main_header %}
    {% include "wagtailadmin/shared/header.html" with title=page_title subtitle=page_subtitle icon=header_icon merged=1 only %}
{% endblock %}

{% block content %}
    {% block header %}
        {{ block.super }}
    {% endblock %}

    <form action="{{ view.get_add_url }}" enctype="multipart/form-data" method="POST" novalidate>
        {% csrf_token %}

        <div class="nice-padding w-form-width">
            {% block form %}{{ edit_handler.render_form_content }}{% endblock %}

            {% trans "Assign your workflow to pages" as heading %}
            {% panel id="workflow-pages" icon="doc-empty-inverse" heading=heading %}
                {% include "wagtailadmin/workflows/includes/workflow_pages_formset.html" with formset=pages_formset %}
            {% endpanel %}

            {% if has_workflow_enabled_models %}
                {% trans "Assign your workflow to snippets" as heading %}
                {% panel id="workflow-content-types" icon="snippet" heading=heading %}
                    {% include "wagtailadmin/shared/field.html" with field=content_type_form.content_types sr_only_label=True only %}
                {% endpanel %}
            {% endif %}
        </div>

        {% block footer %}
            <footer class="footer" role="contentinfo">
                <ul>
                    <li class="actions footer__container">
                        {% block form_actions %}
                            <div class="dropdown dropup dropdown-button match-width">
                                <button
                                    type="submit"
                                    class="button action-save button-longrunning"
                                    data-controller="w-progress"
                                    data-action="w-progress#activate"
                                    data-w-progress-active-value="{% trans 'Creating…' %}"
                                >
                                    {% icon name="spinner" %}
                                    <em data-w-progress-target="label">{% trans 'Create' %}</em>
                                </button>
                            </div>
                        {% endblock %}
                    </li>
                </ul>
            </footer>
        {% endblock %}
    </form>
{% endblock %}
