{% load i18n admin_static suit_list admin_list %}
{% if cl.search_fields or cl.has_filters or cl.date_hierarchy %}
  <div id="toolbar">
    <form id="changelist-search" action="" method="get" class="form-inline">
      <div><!-- DIV needed for valid HTML -->

        {% if cl.search_fields %}
          <input type="text" size="40" name="{{ search_var }}" value="{{ cl.query }}" id="searchbar" placeholder="{% trans 'keyword'|capfirst %}"/>
          &nbsp;
        {% endif %}

        {% if cl.has_filters %}
          {% block filters %}
            {% if cl.has_filters %}
              <span class="search-filters">
              {% for spec in cl.filter_specs %}
                {% suit_list_filter_select cl spec %}
                &nbsp;
              {% endfor %}
              </span>
            {% endif %}
          {% endblock %}
        {% endif %}

        <input type="submit" value="{% trans 'Search' %}" class="btn btn-info"/>
        &nbsp;
        {% if show_result_count %}
          <span class="small quiet">{% blocktrans count counter=cl.result_count %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktrans %}
            &nbsp; <a href="?{% if cl.is_popup %}pop=1{% endif %}">
              {% blocktrans with full_result_count=cl.full_result_count %} {{ full_result_count }} total{% endblocktrans %}</a></span>
        {% endif %}
      </div>

      {% block date_hierarchy %}
        {% if cl.date_hierarchy %}
          {% date_hierarchy cl %}
        {% endif %}
      {% endblock %}
      {% if cl.is_popup %}
        <input type="hidden" name="pop" value="1">
      {% endif %}

    </form>
  </div>
  <script type="text/javascript">document.getElementById("searchbar").focus();</script>
{% endif %}
