<!-- INTERNAL TABLE FOR l2_interfaces -->
<div id="accordion">
<div>
<h3>L2 Interfaces - Trunk/Access Ports</h3>
<div class="net_content">
{% if hostvars[network_switch]['ansible_network_resources']['l2_interfaces'] is defined and hostvars[network_switch]['ansible_network_resources']['l2_interfaces']|length > 0 %}
<table id="subtable">
    <thead>
        <tr>
            <th>Name</th>
            <th>Mode</th>
            <th>Access VLAN</th>
            <th>Trunk Native VLAN</th>
            <th>Trunk Allowed VLANs</th>
        </tr>
    </thead>
    <tbody>
{% for l2_interface in hostvars[network_switch]['ansible_network_resources']['l2_interfaces'] %}
        <tr>
            <td>{{l2_interface['name']}}</td>
            <td>{{l2_interface['mode']|default("Not Configured")}}</td>
            <td>{{l2_interface['access']['vlan']|default("Not Configured")}}</td>
            <td>{{l2_interface['trunk']['native_vlan']|default("Not Configured")}}</td>
            <td>{{l2_interface['trunk']['trunk_allowed_vlans']|default("Not Configured")}}</td>
        </tr>
{% endfor %}
    </tbody>
</table>
{% elif hostvars[network_switch]['ansible_network_resources']['l2_interfaces'] is defined and hostvars[network_switch]['ansible_network_resources']['l2_interfaces']|length == 0 %}
L2 information is not configured on this device
{% else %}
No L2 information available
{% endif %}
</div>
</div>
</div>
<!-- END INTERNAL TABLE FOR l2_interfaces -->
