{% load l10n djadmin_form djadmin_inline_form %}

{% render bound_field template='fields/django_select.html' %}
    {% attr field 'widget' multiple %}True{% endattr %}
    {% attr field 'widget' class append %}material-ignore{% endattr %}
    {% attr field 'group' class append %}multiselect{% endattr %}
    {% part field options %}
        {% for group, items in bound_field|select_options %}
            {% for choice, value, selected in items %}
            <option value="{{ value|unlocalize }}"{% if selected %} selected="selected"{% endif %}>{{ choice }}</option>
           {% endfor %}
       {% endfor %}
    {% endpart %}
{% endrender %}

<script type="text/javascript">
    var color_name = "{{ request.ADMIN_COLOR_THEME }}";
if(! /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
    addEvent(window, "load", function(e) {
        SelectFilter.init("id_{{ bound_field.html_name }}", "{{ bound_field.html_name }}", 0, "/static/admin/");
    });
}
</script>
