{% load i18n %}
  <script>
    var go_from_select = function(opt) { 
      window.location = window.location.pathname + opt 
    };
  </script>

<h3>{{ title }}</h3>
<ul class="admin-filter-{{ title|cut:' ' }}">
  {% if choices|slice:"5:" %}
    <li>
      <select onchange="go_from_select(this.options[this.selectedIndex].value)">
        {% for choice in choices %}
          <option{% if choice.selected %} selected="selected"{% endif %} value="{{ choice.query_string|iriencode }}">
            {{ choice.display }}
          </option>
        {% endfor %}
      </select>
    </li>
  {% else %}
    {% for choice in choices %}
      <li{% if choice.selected %} class="selected"{% endif %}>
        <a href="{{ choice.query_string|iriencode }}">{{ choice.display }}</a>
      </li>
    {% endfor %}
  {% endif %}
</ul>
