{% load static %} {% block head %} {% if use_svg %} {% else %} {% endif %} {% endblock %} {% block content %}

Deviceview {% if object.virtual_chassis %}{{ object.virtual_chassis.name }}{% else %}{{ object.name }}{% endif %}

{% spaceless %} {% if use_svg %} {# ── SVG rendering path ── #} {# svg_panels is [(pos, svg_markup)] pre-built in template_content.py with #} {# fallback for patch panels whose ports_chassis keys don't match svg_views #} {% for panel_pos, svg_markup in svg_panels %}

Device {{ panel_pos }}

{% autoescape off %}{{ svg_markup }}{% endautoescape %}
{% endfor %} {% else %} {# ── CSS Grid rendering path (unchanged) ── #} {% for switch, interfaces in ports_chassis.items %} Device {{switch}}
{% for int in interfaces %} 0 or int.is_port and int.link_peers|length > 0 %} bg-success {% elif int.enabled %} bg-secondary {% else %} bg-danger {% endif %}" data-bs-title="{{ int.name }}{% if int.connected_endpoints|length > 0 %}
{% for ce in int.connected_endpoints %}{{ ce.device }} | {{ ce.name }}{% if not forloop.last %}
{% endif %}{% endfor %}{% elif int.link_peers|length > 0 %}
{% for lp in int.link_peers %}{% if lp.device %}{{ lp.device }} | {{ lp.name }}{% elif lp.circuit %}{{ lp }}{% endif %}{% if not forloop.last %}
{% endif %}{% endfor %}{% endif %}" data-bs-content="
Trace" style="grid-area: {{ int.stylename }}{% if cable_colors == 'on' and int.cable.color != '' %}; background-color: #{{ int.cable.color }}{% endif %}" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="top" data-bs-html="true" data-bs-container="body" data-bs-delay='{"show":200,"hide":300}' data-bs-custom-class="device-view-tooltip" > {% if int.enabled and int.connected_endpoints|length > 0 or int.is_port and int.link_peers|length > 0 %} {% elif int.enabled %} {% else %} {% endif %} {% endfor %}
{% endfor %} {% endif %} {% endspaceless %}
{% if use_svg %} {# ── SVG interactivity script ── #} {% endif %} {% if not use_svg %} {% endif %} {% endblock %}