{% load helpers %}
{% load static %}

<!-- VLAN Sync Header -->
<div class="d-flex justify-content-between align-items-center mb-3">
    <h2>VLAN Sync</h2>
    <div class="btn-list">
        <form method="post">
            {% csrf_token %}
            {% if has_librenms_id %}
                {% with model_name=object|meta:"model_name" %}
                    {% if model_name == "device" %}
                        <button hx-post="{% url 'plugins:netbox_librenms_plugin:device_vlan_sync' pk=object.pk %}"
                                hx-target="#vlan-sync-content"
                                hx-include="[name='interface_name_field']"
                                class="btn btn-outline-primary">
                            Refresh VLANs
                        </button>
                    {% endif %}
                {% endwith %}
            {% endif %}
        </form>
    </div>
</div>
<!-- End VLAN Sync Header -->

<!-- Container for the VLAN sync content -->
<div id="vlan-sync-content">
    {% include 'netbox_librenms_plugin/_vlan_sync_content.html' %}
</div>
