{% load i18n static %}
<div class="related-widget-wrapper">
    {{ widget }}
    {% block links %}
        {% spaceless %}
        {% if can_change_related or can_view_related %}
        <a class="related-widget-wrapper-link {% if can_change_related %}change-related{% else %}view-related{% endif %}"
            id="change_id_{{ name }}"
            data-href-template="{{ change_related_template_url }}?{{ url_params }}"
            {% if can_change_related %}
            title="{% blocktrans %}Change selected {{ model }}{% endblocktrans %}">
            <img src="{% static 'admin/img/icon-changelink.svg' %}" alt="{% trans 'Change' %}">
            {% else %}
            title="{% blocktrans %}View selected {{ model }}{% endblocktrans %}">
            <img src="{% static 'admin/img/icon-viewlink.svg' %}" alt="{% trans 'View' %}">
            {% endif %}
        </a>
        {% endif %}
        {% if can_add_related %}
        <a class="related-widget-wrapper-link add-related" id="add_id_{{ name }}"
            href="{{ add_related_url }}?{{ url_params }}"
            title="{% blocktrans %}Add another {{ model }}{% endblocktrans %}">
            <img src="{% static 'admin/img/icon-addlink.svg' %}" alt="{% trans 'Add' %}">
        </a>
        {% endif %}
        {% if can_delete_related %}
        <a class="related-widget-wrapper-link delete-related" id="delete_id_{{ name }}"
            data-href-template="{{ delete_related_template_url }}?{{ url_params }}"
            title="{% blocktrans %}Delete selected {{ model }}{% endblocktrans %}">
            <img src="{% static 'admin/img/icon-deletelink.svg' %}" alt="{% trans 'Delete' %}">
        </a>
        {% endif %}
        {% endspaceless %}
    {% endblock %}
</div>
