{% extends 'base/layout.html' %} {% load i18n %} {% load helpers %} {% block title %}{% if page_title %}{{ page_title }}{% else %}{% trans "Assign Link" %}{% endif %}{% endblock %} {% block head %} {{ block.super }} {% endblock head %} {% block content %}

{% if page_title %}{{ page_title }}{% else %}{% trans "Assign Link" %}{% endif %}

{% trans "Back" %}
{# ── Left: assign form ──────────────────────────────────────────────── #}
{% trans "New Link" %}
{% if object_a.get_absolute_url %} {{ object_a }} {% else %} {{ object_a }} {% endif %} ({{ object_a|meta:"verbose_name" }})
{% csrf_token %} {% if form.non_field_errors %} {% endif %} {# object_b_id hidden inputs are added dynamically by JS #}
{# Type selector #}
{% if form.object_b_type.errors %}
{{ form.object_b_type.errors|join:", " }}
{% endif %}
{# Element picker — styled like form-select #}
{# Link type / propagation #} {% if not hide_propagation %}
{{ form.propagation }} {% if form.propagation.help_text %}
{{ form.propagation.help_text }}
{% endif %} {% if form.propagation.errors %}
{{ form.propagation.errors|join:", " }}
{% endif %}
{% endif %} {# Comment #}
{# ── Right: existing links ──────────────────────────────────────────── #}
{% trans "Existing Links" %}
{% if existing_links %} {% if not hide_propagation %}{% endif %} {% for link in existing_links %} {% if enforcement_point_mode %} {% else %} {% endif %} {% if not hide_propagation %} {% endif %} {% endfor %}
{% trans "Typ" %} {% trans "Element" %}{% trans "Link type" %}{% trans "Comment" %}
{% if link.policy_object %} {{ link.policy_object|meta:"verbose_name" }} {% else %} – {% endif %} {% if link.policy_object %} {% if link.policy_object.get_absolute_url %} {{ link.policy_object }} {% else %} {{ link.policy_object }} {% endif %} {% else %} {% endif %} {{ link.object_b_type }} {% if link.object_b %} {% if link.object_b.get_absolute_url %} {{ link.object_b }} {% else %} {{ link.object_b }} {% endif %} {% else %} {% endif %} {{ link.get_propagation_display }}{{ link.comment|default:"–" }}
{% csrf_token %}
{% else %}
{% trans "No links found." %}
{% endif %}
{% endblock %}