{% load i18n static %}

{% if cl.search_fields %}
  <form id="changelist-search" method="get" class="align-items-center col-12 col-lg-3 d-flex flex-column flex-lg-row mb-1 mb-lg-0 me-lg-1 py-lg-1">
    {% if show_result_count %}
      <div class="align-items-center col-auto d-flex me-lg-2 mb-1 mb-lg-0">{% blocktranslate count counter=cl.result_count %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktranslate %} (<a href="?{% if cl.is_popup %}_popup=1{% endif %}">{% if cl.show_full_result_count %}{% blocktranslate with full_result_count=cl.full_result_count %}{{ full_result_count }} total{% endblocktranslate %}{% else %}{% translate "Show all" %}{% endif %}</a>)</div>
    {% endif %}
    <input type="search" name="{{ search_var }}" value="{{ cl.query }}" id="searchbar" class="form-control w-100" placeholder="{% translate 'Search ...' %}" aria-label="Search">
    {% for pair in cl.params.items %}
      {% if pair.0 != search_var %}<input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}">{% endif %}
    {% endfor %}
  </form>
{% endif %}
