{% load i18n admin_static custom %}
 {% admin_color_theme as ADMIN_COLOR_THEME %}
{% if cl.search_fields %}

<div id="toolbar">
<form id="changelist-search" method="get">
    <div class="input-field col l4 s12 m12">
    <div class="search-wrapper card">
            <input id="searchbar" type="text"  value="{{ cl.query }}" name="{{ search_var }}"><i class=" mdi-action-search"></i>
        </div>
    </div>
    <div class="input-field col l2 s12 m12"><button class="btn waves-effect waves-light {{ ADMIN_COLOR_THEME }}" type="submit">{% trans 'Search' %}</button></div>
</form>
{% if show_result_count %}
    <span class="small quiet">{% blocktrans count counter=cl.result_count %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktrans %} (<a href="?{% if cl.is_popup %}_popup=1{% endif %}">{% if cl.show_full_result_count %}{% blocktrans with full_result_count=cl.full_result_count %}{{ full_result_count }} total{% endblocktrans %}{% else %}{% trans "Show all" %}{% endif %}</a>)</span>
{% endif %}
{% for pair in cl.params.items %}
    {% if pair.0 != search_var %}<input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}"/>{% endif %}
{% endfor %}
</div>
<script type="text/javascript">document.getElementById("searchbar").focus();</script>
{% endif %}
