{% extends 'generic/object_list.html' %}
{% load buttons %}
{% load i18n %}
{% load helpers %}
{% load static %}

{% block title %}
  Onboard Devices
{% endblock %}

{% block header %}
  <div class="title-container px-3 pb-3">

    {# Title #}
    
    <div id="content-title">
      {% include "slurpit_netbox/logo.html" %}
      {# Center-align title in object-edit views #}
      <h1 class="h2 w-100">Onboard Devices</h1>
      {% block subtitle %}{% endblock %}
    </div>

    {# Controls #}
    {% block controls %}{% endblock controls %}

  </div>
  <style>
    .greenLink a {
      color: #0d6efd !important
    }
  </style>
{% endblock header %}

{% block tabs %}
  <ul class="nav nav-tabs px-3">
        
    <li class="nav-item" role="presentation">
      <a class="nav-tab nav-link {% if request.GET.tab == 'new' or request.GET.tab is None %}active{% endif %}" href="?tab=new">
        New {% badge to_onboard_count %}
      </a>
    </li>
    <li class="nav-item" role="presentation">
      <a class="nav-tab nav-link {% if request.GET.tab == 'migrate' %}active{% endif %}" href="?tab=migrate">
        Migrate {% badge migrate_count %}
      </a>
    </li>
    <li class="nav-item" role="presentation">
      <a class="nav-tab nav-link {% if request.GET.tab == 'conflicted' %}active{% endif %}" href="?tab=conflicted">
        Conflict {% badge conflicted_count %}
      </a>
    </li>
    <li class="nav-item" role="presentation">
      <a class="nav-tab nav-link  {% if request.GET.tab == 'onboarded' %}active{% endif %}" href="?tab=onboarded">
        Onboarded {% badge onboarded_count %}
      </a>
    </li>
    
  </ul>
{% endblock tabs %}

{% block content-wrapper %}
  <div class="tab-content">
    {% if request.GET.tab == 'new' or request.GET.tab is None %}
      {% include "slurpit_netbox/onboard/new_device_list.html" %}
    {% elif request.GET.tab == 'conflicted' %}
      {% include "slurpit_netbox/onboard/conflict_device_list.html" %}
    {% elif request.GET.tab == 'migrate' %}
      {% include "slurpit_netbox/onboard/migrate_device_list.html" %}
    {% elif request.GET.tab == 'onboarded' %}
      {% include "slurpit_netbox/onboard/onboarded_device_list.html" %}
    {% endif %}
  </div> 

{% endblock content-wrapper %}




<footer class="footer container-fluid">
  {% block footer %}
    <div class="row align-items-center justify-content-between mx-0">

      <div class="col-sm-12 col-md-auto fs-4 noprint">
        <nav class="nav justify-content-center justify-content-lg-start">
          {% block footer_links %}
            <a type="button" class="nav-link h6" href="https://slurpit.io" target="_blank">
              https://slurpit.io
            </a>
          {% endblock footer_links %}
        </nav>
      </div>

      <div class="col-sm-12 col-md-auto text-center text-lg-end text-muted"  >
        <span class="d-block d-md-inline">{% annotated_now %} {% now 'T' %}</span>
        <span class="ms-md-3 d-block d-md-inline">{{ settings.HOSTNAME }} (v{{ settings.VERSION }})</span>
        <span class="ms-md-3 d-block d-md-inline">Slurpit(v{{ settings.PLUGINS_CONFIG.slurpit_netbox.version }})</span>
      </div>

    </div>
  {% endblock footer %}
</footer>
   