{% load djadmin_form djadmin_inline_form djadmin l10n i18n %}
{% admin_select_related_link bound_field as rel_field_urls %}
{% part bound_field.field %}<div class="row">
    <div{% attrs bound_field 'group' %}
        id="id_{{ bound_field.html_name }}_container"
        class="input-field input-group col s12{% if field.required %} required{% endif %}{% if bound_field.errors %} has-error{% endif %}"
    {% endattrs %}>
        {% part field prefix %}{% endpart %}{% part field control %}
        <input{% attrs bound_field 'widget' default field.widget.attrs %}
            id="id_{{ bound_field.html_name }}"
            name="{{ bound_field.html_name }}"
            type="{{ field.widget.input_type }}"
            class="vManyToManyRawIdAdminField"
            {% if bound_field.errors %}class="invalid"{% endif %}
            {% if bound_field.value %}value="{{ bound_field.value|join:',' }}"{% endif %}
        {% endattrs %}>{% endpart %}
        {% part field label %}
        <label{% attrs bound_field 'label' %}
            for="{{ bound_field.id_for_label }}"
            {% if bound_field.value %}class="active"{% endif %}
        {% endattrs %}>{{ bound_field.label }}</label>
        {% endpart %}
        <span class="suffix">
            <a href="{{ rel_field_urls.related_url }}" class="btn white-text related-lookup" id="lookup_id_{{ bound_field.html_name }}"><i class="mdi-action-search"></i></a>
        </span>
    </div>
    <div class="col s12">
        {% part field help_text %}{% if field.help_text %}
        <small class="help-block" style="display:block">{{ bound_field.help_text }}</small>
        {% endif %}
        {% endpart %}{% part field errors %}
        {% if bound_field.errors %}{% include  'djadmin/field_errors.html' %}{% endif %}
        {% endpart %}{{ hidden_initial }}
    </div>
</div>{% endpart %}
