diff --git a/netbox/dcim/tables/devices.py b/netbox/dcim/tables/devices.py index a6c0c0ecc..c1515a15f 100644 --- a/netbox/dcim/tables/devices.py +++ b/netbox/dcim/tables/devices.py @@ -274,17 +274,17 @@ class CableTerminationTable(NetBoxTable): verbose_name='Cable Color' ) link_peer = columns.TemplateColumn( - accessor='_link_peer', + accessor='link_peers', template_code=LINKTERMINATION, orderable=False, - verbose_name='Link Peer' + verbose_name='Link Peers' ) mark_connected = columns.BooleanColumn() class PathEndpointTable(CableTerminationTable): connection = columns.TemplateColumn( - accessor='_path__last_node', + accessor='_path__destinations', template_code=LINKTERMINATION, verbose_name='Connection', orderable=False diff --git a/netbox/dcim/tables/template_code.py b/netbox/dcim/tables/template_code.py index a07186973..90befe0a4 100644 --- a/netbox/dcim/tables/template_code.py +++ b/netbox/dcim/tables/template_code.py @@ -1,11 +1,9 @@ LINKTERMINATION = """ -{% if value %} - {% if value.parent_object %} - {{ value.parent_object }} - - {% endif %} - {{ value }} -{% endif %} +{% for termination in value %} + {{ termination }}{% if not forloop.last %},{% endif %} +{% empty %} + {{ ''|placeholder }} +{% endfor %} """ CABLE_LENGTH = """ @@ -13,18 +11,6 @@ CABLE_LENGTH = """ {% if record.length %}{{ record.length|simplify_decimal }} {{ record.length_unit }}{% endif %} """ -# CABLE_TERMINATION_PARENT = """ -# {% with value.0 as termination %} -# {% if termination.device %} -# {{ termination.device }} -# {% elif termination.circuit %} -# {{ termination.circuit }} -# {% elif termination.power_panel %} -# {{ termination.power_panel }} -# {% endif %} -# {% endwith %} -# """ - DEVICE_LINK = """ {{ record.name|default:'Unnamed device' }} diff --git a/netbox/templates/dcim/cable_trace.html b/netbox/templates/dcim/cable_trace.html index ac0481925..abe13b236 100644 --- a/netbox/templates/dcim/cable_trace.html +++ b/netbox/templates/dcim/cable_trace.html @@ -10,10 +10,12 @@ {% if path %} - + + Download SVG + {% with traced_path=path.origin.trace %} @@ -80,18 +82,16 @@ {% for cablepath in related_paths %} - - {{ cablepath.origin.parent_object }} / {{ cablepath.origin }} - + {{ cablepath.origins|join:", " }} - {% if cablepath.destination %} - {{ cablepath.destination }} ({{ cablepath.destination.parent_object }}) + {% if cablepath.destinations %} + {{ cablepath.destinations|join:", " }} {% else %} Incomplete {% endif %} - + {{ cablepath.segment_count }}