{% comment %} One device's cabling, as seen from that device. The rack-wide list answers "what is wired in here"; this answers "what is this thing wired to", which is the question you have the moment you click something. Each row names the local port first whichever end of the cable this device is on, so the list reads outward from the device rather than in whatever direction the cable happened to be recorded. {% endcomment %} {% for run in runs %} {% if run.local_device.pk == device.pk %}
{{ run.local_name }} {{ run.peer_name }} {% if run.peer_rack %}{{ run.peer_rack }}{% endif %}
{% else %} {% comment %} This device is the far end of the run, so the two halves are swapped to keep the local port on the left. The trace still starts from the recorded end, which is the only one with a termination on file here. {% endcomment %}
{{ run.peer_port_name }} {{ run.local_device }} · {{ run.local_name }}
{% endif %} {% empty %}

Nothing on this device has a cable recorded.

{% endfor %}