{% load crispy_forms_tags %}

<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
  <div class="modal-content text-start">
    <div class="modal-header">
      <div class="modal-title fs-5">{{ title }}</div>
      <button type="button"
              class="btn-close"
              data-bs-dismiss="modal"
              aria-label="Close"></button>
    </div>

    <div class="modal-body">{% crispy form %}</div>

    <div class="modal-footer d-flex flex-row-reverse justify-content-between">
      <button type="submit"
              form="{{ form_id }}"
              formaction="{% url 'media_save' %}?next={{ return_url }}"
              class="btn btn-primary">Save</button>
      <button type="submit"
              form="{{ form_id }}"
              formaction="{% url 'media_delete' %}?next={{ return_url }}"
              class="btn btn-danger"
              {% if not media %}disabled{% endif %}>Delete</button>
    </div>
  </div>
</div>
