{% comment %} ACI Context panel injected into the dcim.Device detail view. Layout follows NetBox's stock "Device Type" card pattern: * Outer ``
`` wrapper. * ```` rendering a two- column definition list (label | value) for the summary attributes. The ``attr-table`` class is what gives the screenshot's compact "Device Type" look. ``|linkify`` auto-renders FKs as anchor tags and ``|placeholder`` renders an em-dash when a value is blank. * Subordinate sections (bindings table, L3Out logical nodes) render as their own cards so they stack cleanly underneath the summary. If the device has no ACI link at all the view returns "" upstream, so nothing renders. {% endcomment %} {% load helpers %} {% load i18n %}

{% trans "Cisco ACI Context" %}

{% if aci_node and aci_node.node_id %} {% endif %} {% if aci_node and aci_node.role %} {% endif %} {% if logical_nodes %} {% endif %}
{% trans "Fabric" %} {{ aci_fabric|linkify|placeholder }}
{% trans "Pod" %} {{ aci_pod|linkify|placeholder }}
{% trans "ACI Node" %} {{ aci_node|linkify|placeholder }}
{% trans "Node ID" %} {{ aci_node.node_id }}
{% trans "Role" %} {{ aci_node.get_role_display }}
{% trans "EPGs" %} {{ epg_count }}
{% trans "Bridge Domains" %} {{ bd_count }}
{% trans "VRFs" %} {{ vrf_count }}
{% trans "Static Port Bindings" %} {{ binding_count }}
{% trans "L3Out Logical Nodes" %} {{ logical_nodes|length }}
{% if static_port_bindings %}

{% trans "Static Port Bindings" %} {{ binding_count }}

{% for b in static_port_bindings %} {% endfor %}
{% trans "Interface" %} {% trans "EPG" %} {% trans "Bridge Domain" %} {% trans "VRF" %} {% trans "Encap VLAN" %} {% trans "Mode" %}
{{ b.dcim_interface|linkify }} {{ b.aci_endpoint_group|linkify }} {{ b.aci_endpoint_group.aci_bridge_domain|linkify|placeholder }} {% if b.aci_endpoint_group.aci_bridge_domain %} {{ b.aci_endpoint_group.aci_bridge_domain.aci_vrf|linkify|placeholder }} {% else %}{{ ""|placeholder }}{% endif %} {{ b.encap_vlan }} {{ b.get_mode_display }}
{% endif %} {% if logical_node_static_routes %} {# One card per logical node, each rendered as its own attr-table #} {# (matching the 'Device Type' / 'Cisco ACI Context' layout). Per-node #} {# static routes get their own dedicated row whose value cell either #} {# carries the routes table or the |placeholder em-dash. #}

{% trans "L3Out Logical Nodes" %} {{ logical_node_static_routes|length }}

{% for ln, node_routes in logical_node_static_routes %}
{% trans "Logical Node" %} {{ ln|linkify }}
{% trans "L3Out" %} {{ ln.aci_logical_node_profile.aci_l3out|linkify|placeholder }}
{% trans "Logical Node Profile" %} {{ ln.aci_logical_node_profile|linkify|placeholder }}
{% trans "Router ID" %} {{ ln.router_id|placeholder }}
{% trans "Loopback Address" %} {% if ln.use_router_id_as_loopback %} {% trans "Router ID" %} {% else %} {{ ln.loopback_address|placeholder }} {% endif %}
{% trans "Static Routes" %} {% if node_routes %} {% for route in node_routes %} {% endfor %}
{% trans "Prefix" %} {% trans "Preference" %}
{{ route|linkify }} {{ route.preference }}
{% else %}{{ ""|placeholder }}{% endif %}
{% if not forloop.last %}
{% endif %} {% endfor %}
{% endif %}