{% load selia_filters %}
{% load selia_tags %}
{% load i18n %}

{% if clear %}
  <div class="col-10 filter-bar">
    {% if search %}
      <a href="{{ request.get_full_path | remove_option:"search" }}" class="badge badge-dark filter-badge badge-pill p-2 mx-2 my-2">
        <i class="fas fa-search"></i> search: {{ search }} &nbsp; &nbsp;  <i class="fas fa-times"></i>
      </a>
    {% endif %}

    {% for field_name, field in form.items %}
      <a href="{{ request.get_full_path | remove_option:field_name }}" class="badge badge-dark filter-badge badge-pill p-2 mx-2 my-2">
        {{ field.label }}: {{ field.data }} &nbsp; &nbsp;  <i class="fas fa-times"></i>
      </a>
    {% endfor %}
  </div>

  <div class="col-2 pr-0">
    <a class="btn btn-link text-light" href="?{% remove_form_fields request.GET forms %}">
      {% trans 'Clean' %} <i class="fas fa-eraser"></i>
    </a>
  </div>
{% endif %}
