{% load djadmin_form djadmin_inline_form djadmin i18n %}

{% admin_related_field_urls bound_field as bound_field_urls %}

<div class="related-widget-wrapper">
{% render bound_field widget=field.widget.widget %}
    {% part field label %}
    <label for="{{ bound_field.id_for_label }}" class="related-widget-label">
        <span style="margin-right:5px">{{ bound_field.label }}</span>
        {% if bound_field_urls.can_change_related %}
        <a class="related-widget-wrapper-link change-related tooltip"
           data-href-template="{{ bound_field_urls.change_related_template_url }}?{{ bound_field_urls.url_params }}"
           id="change_id_{{ bound_field.html_name }}"
           title="{% blocktrans %}Change selected {{ bound_field_urls.model }}{% endblocktrans %}">
            <i class="mdi-content-create" style="line-height:20px;font-size:20px"></i>
        </a>
        {% endif %}
        {% if bound_field_urls.can_add_related %}
        <a class="related-widget-wrapper-link add-related tooltip"
           href="{{ bound_field_urls.add_related_url }}?{{ bound_field_urls.url_params }}"
           id="add_id_{{ bound_field.html_name }}"
           title="{% blocktrans %}Add another {{ bound_field_urls.model }}{% endblocktrans %}">
            <i class="mdi-content-add-box" style="line-height:20px;font-size:20px"></i>
        </a>
        {% endif %}
        {% if bound_field_urls.can_delete_related %}
        <a class="related-widget-wrapper-link delete-related tooltip"
           data-href-template="{{ bound_field_urls.delete_related_template_url }}?{{ bound_field_urls.url_params }}"
           id="add_id_{{ bound_field.html_name }}"
           title="{% blocktrans %}Delete selected {{ bound_field_urls.model }}{% endblocktrans %}">
            <i class="mdi-action-delete" style="line-height:20px;font-size:20px"></i>
        </a>
        {% endif %}
    </label>
    {% endpart %}
    {% part field help_text %}{% endpart%}
{% endrender %}
</div>
