{% 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 %}

{% trans "L3Out Logical Nodes" %}

{% for ln, node_routes in logical_node_static_routes %} {% endfor %}
{{ ln|linkify }}
{% trans "L3Out" %}: {{ ln.aci_logical_node_profile.aci_l3out|linkify }} {% if ln.router_id %} · {% trans "Router ID" %}: {{ ln.router_id }} {% endif %}
{% if node_routes %} {% for route in node_routes %} {% endfor %}
{% trans "Prefix" %} {% trans "Preference" %}
{{ route|linkify }} {{ route.preference }}
{% else %} {% trans "No static routes." %} {% endif %}
{% elif logical_nodes %} {# Logical nodes attached but the routes-by-node dict wasn't populated, #} {# so just list them flat. #}

{% trans "L3Out Logical Nodes" %}

{% for ln in logical_nodes %} {% endfor %}
{{ ln|linkify }} {% trans "L3Out" %}: {{ ln.aci_logical_node_profile.aci_l3out|linkify }} {% if ln.router_id %} · {% trans "Router ID" %}: {{ ln.router_id }} {% endif %}
{% endif %}