{% load form_helpers %}
{% load helpers %}
{% load i18n %}

<form action="." method="get">
  <div class="card">
    <div class="card-body overflow-visible d-flex flex-wrap justify-content-between py-3">
      {% for field in filter_form.hidden_fields %}
        {{ field }}
      {% endfor %}
      {# List filters by group #}
      {% for fieldset in filter_form.fieldsets %}
        <div class="col col-12">
          {% render_fieldset filter_form fieldset %}
        </div>
      {% empty %}
        {# List all non-customfield filters as declared in the form class #}
        {% for field in filter_form.visible_fields %}
          {% if not filter_form.custom_fields or field.name not in filter_form.custom_fields %}
            <div class="col col-12">
              {% render_field field %}
            </div>
          {% endif %}
        {% endfor %}
      {% endfor %}
      {% if filter_form.custom_fields %}
        {# List all custom field filters #}
        <div class="col col-12">
          <div class="hr-text">
            <span>{% trans "Custom Fields" %}</span>
          </div>
          {% render_custom_fields filter_form %}
        </div>
      {% endif %}
    </div>
  </div>
  <div class="sticky-actions sticky-actions-footer d-print-none" data-sticky-position="full" data-sticky-when="always">
    <div class="btn-list">
      <button type="button" class="btn btn-outline-danger" data-reset-select>
        <i class="mdi mdi-backspace" aria-hidden="true"></i> {% trans "Reset" %}
      </button>
      <button type="submit" class="btn btn-primary">
        <i class="mdi mdi-magnify" aria-hidden="true"></i> {% trans "Search" %}
      </button>
    </div>
  </div>
</form>
