{% load wagtailadmin_tags i18n %}
<div
    class="footer__container footer__container--hidden"
    aria-live="polite"
    data-controller="w-messages"
    data-action="w-unsaved:add@document->w-messages#add w-unsaved:clear@document->w-messages#clear w-autosave:error@document->w-messages#add"
    data-w-messages-clear-delay-value="1024"
    data-w-messages-clear-param="true"
    data-w-messages-hide-class="footer__container--hidden"
>
    <div class="footer__save-warning footer__emphasise-span-tags" data-w-messages-target="container"></div>
    {% block message_templates %}
        {% if autosave_enabled %}
            {% blocktranslate trimmed asvar generic_save_message %}
                Autosave is <span>paused</span>
            {% endblocktranslate %}
            <template data-w-messages-target="template" data-selector="p">
                <div>
                    <b>{{ generic_save_message }}</b>
                    <p></p>
                </div>
            </template>
        {% else %}
            {% trans 'Save your changes before leaving' as generic_save_message %}
            <template data-w-messages-target="template" data-type="edits">
                <div>
                    <b>{% blocktrans trimmed %}You have <span>unsaved edits</span>{% endblocktrans %}</b>
                    <p>{{ generic_save_message }}</p>
                </div>
            </template>
        {% endif %}
    {% endblock %}
</div>
