{% extends 'generic/object.html' %}
{% load helpers %}
{% load plugins %}

{% block title %}VLAN {{ object }}{% endblock %}

{% block breadcrumbs %}
<li class="breadcrumb-item">
  <a href="{% url 'ipam:vlan_list' %}">VLANs</a>
</li>
{% if object.site %}
<li class="breadcrumb-item">
  <a href="{% url 'ipam:vlan_list' %}?site_id={{ object.site.pk }}">{{ object.site }}</a>
</li>
{% endif %}
{% if object.group %}
<li class="breadcrumb-item">
  <a href="{% url 'ipam:vlan_list' %}?group_id={{ object.group.pk }}">{{ object.group }}</a>
</li>
{% endif %}
<li class="breadcrumb-item">
  {{ object }}
</li>
{% endblock %}

{% block tabs %}
  <ul class="nav nav-tabs" style="margin-bottom: 20px">
    <li class="nav-item" role="presentation">
      <a class="nav-link{% if not active_tab %} active{% endif %}" href="{% url 'ipam:vlan' pk=object.pk %}">VLAN</a>
    </li>
    <li class="nav-item" role="presentation">
      <a class="nav-link{% if active_tab == 'interfaces' %} active{% endif %}" href="{% url 'ipam:vlan_interfaces' pk=object.pk %}">Device Interfaces <span class="badge bg-primary">{{ object.get_interfaces.count }}</span></a>
    </li>
    <li class="nav-item" role="presentation">
      <a class="nav-link{% if active_tab == 'vminterfaces' %} active{% endif %}" href="{% url 'ipam:vlan_vminterfaces' pk=object.pk %}">VM Interfaces <span class="badge bg-primary">{{ object.get_vminterfaces.count }}</span></a>
    </li>
    {% if perms.extras.view_journalentry %}
      <li class="nav-item" role="presentation">
        <a class="nav-link{% if active_tab == 'journal' %} active{% endif %}" href="{% url 'ipam:vlan_journal' pk=object.pk %}">Journal</a>
      </li>
    {% endif %}
    {% if perms.extras.view_objectchange %}
      <li class="nav-item" role="presentation">
        <a class="nav-link{% if active_tab == 'changelog' %} active{% endif %}" href="{% url 'ipam:vlan_changelog' pk=object.pk %}">Change Log</a>
      </li>
    {% endif %}
  </ul>
{% endblock %}
