{% extends "modeladmin/edit.html" %}
{% load i18n wagtailadmin_tags %}

{% block header %}
    {% include "modeladmin/includes/header_with_history.html" with title=view.get_page_title subtitle=view.get_page_subtitle icon=view.header_icon tabbed=1 merged=1 latest_log_entry=latest_log_entry history_url=history_url %}
{% endblock %}

{% block form_actions %}
  <div class="dropdown dropup dropdown-button match-width">
    {# TODO: remove data-clicked-text once we drop support for Wagtail 4.x #}
    <button type="submit" class="button action-save button-longrunning" data-clicked-text="{% trans 'Saving…' %}" data-controller="w-progress" data-action="w-progress#activate" data-w-progress-active-value="{% trans 'Saving…' %}">
      {% icon name="spinner" %}<em>{% trans "Save" %}</em>
    </button>

    {% if user_can_delete %}
      <div class="dropdown-toggle">{% icon name="arrow-up" %}</div>
      <ul>
        {% if translation %}
          <li>
            <form method="POST">
              <input type="hidden" name="localize-restart-translation">
              <button class="button">{% trans "Start Synced translation" %}</button>
            </form>
          </li>
        {% endif %}
        <li><a href="{{ view.delete_url }}" class="shortcut">{% trans "Delete" %}</a></li>
      </ul>
    {% endif %}

  </div>
{% endblock %}
