{% extends 'base.html' %}

{% block form_open %}
<form
  id="main-form"
  action="{{ request.get_full_path() }}"
  method="post"
  enctype="multipart/form-data"
  data-controller="form"
  data-action="submit->form#submit"
  {% block form_ajax %}data-ajax=""{% endblock %}
  {% if form is defined %}
  class="{% if request.method == 'POST' and form.errors or form.non_field_errors %}form-invalid{% endif %}"
  {% endif %}
>
{% endblock %}

{% block content %}
    <div class="form-loading" style="display: none">
        {{ _('Data upload progress') }}
        <br />
        <progress></progress>
    </div>
    {{ render_form(form) }}
{% endblock %}

{% block buttons %}
    {{ render_button(_(view.urlname or 'Submit'), button_type="submit", button_class="btn-primary") }}
{% endblock %}

{% block form_close %}
    <input type="hidden" name="_next" value="{{ request.GET.get('_next', request.POST.get('_next', request.META.get('HTTP_REFERER', '/'))) }}" />
    {% csrf_token %}
</form>
{% endblock %}
