search_form.html 1.4 KB

12345678910111213141516171819202122232425262728
  1. {% load i18n admin_static admin_list %}
  2. {% if cl.search_fields or cl.has_filters %}
  3. <form id="changelist-search" action="" method="get">
  4. {% if cl.search_fields %}
  5. <input type="text" size="40" name="{{ search_var }}" value="{{ cl.query }}" placeholder="{% trans 'Search' %}" id="searchbar" />
  6. <script type="text/javascript">document.getElementById("searchbar").focus();</script>
  7. {% endif %}
  8. {% block filters %}
  9. {% if cl.has_filters %}
  10. {% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
  11. {% endif %}
  12. {% endblock %}
  13. <div class="changelist-filter-submit-block">
  14. <input type="submit" value="{% trans 'Search' %}" />
  15. {% if show_result_count %}
  16. <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>
  17. {% endif %}
  18. </div>
  19. {% for pair in cl.params.items %}
  20. {% ifnotequal pair.0 search_var %}<input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}"/>{% endifnotequal %}
  21. {% endfor %}
  22. </form>
  23. {% endif %}