{% load buttons %}
{% load i18n %}

<div class=" show {% if request.GET.tab == 'new' or request.GET.tab is None %}active{% endif %}" id="new-device-list" role="tabpanel" aria-labelledby="new-device-list-tab">
   
    <form method="post" class="form form-horizontal">
         <!-- sync button -->
        {# Object table controls #}
        {# Form buttons #}
        <div class="noprint bulk-buttons">
        <div class="bulk-button-group">
            {% block bulk_buttons %}
            <div class="" role="group">
                {% bulk_edit_button model query_params=request.GET %}

                {% if appliance_type == 'both' or appliance_type == 'on-premise'  %}
                  {% if connection_status == 'connected' %}
                    <a name="sync"  class="btn btn-orange btn-sm mx-2" href="{% url 'plugins:slurpit_netbox:import' %}"><i class="mdi mdi-sync" aria-hidden="true"></i> {% trans "Sync" %}</a>
                  {% endif %}
                {% endif %}
                <button type="submit" name="_rename" formaction="{% url 'plugins:slurpit_netbox:onboard' %}?return_url={% url 'plugins:slurpit_netbox:importeddevice_list' %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" class="btn btn-blue btn-sm">
                  <i class="mdi mdi-plus" aria-hidden="true"></i> {% trans "Onboard" %}
                </button>
            </div>
            {% endblock %}
        </div>
        </div>
      {% csrf_token %}
      {# "Select all" form #}
      {% if table.paginator.num_pages > 1 %}
        <div id="select-all-box" class="d-none card noprint">
          <div class="form col-md-12">
            <div class="card-body">
              <div class="float-end">
                {% if 'bulk_edit' in actions %}
                  {% bulk_edit_button model query_params=request.GET %}
                {% endif %}
                {% if 'bulk_delete' in actions %}
                  {% bulk_delete_button model query_params=request.GET %}
                {% endif %}
              </div>
              <div class="form-check">
                <input type="checkbox" id="select-all" name="_all" class="form-check-input" />
                <label for="select-all" class="form-check-label">
                  {% blocktrans trimmed with count=table.rows|length object_type_plural=table.data.verbose_name_plural %}
                    Select <strong>all {{ count }} {{ object_type_plural }}</strong> matching query
                  {% endblocktrans %}
                </label>
              </div>
            </div>
          </div>
        </div>
      {% endif %}

      <div class="form form-horizontal">
        {% csrf_token %}
        <input type="hidden" name="return_url" value="{% if return_url %}{{ return_url }}{% else %}{{ request.path }}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}{% endif %}" />

        {# Object table #}

            {% if prerequisite_model %}
              {% include 'inc/missing_prerequisites.html' %}
            {% endif %}

        <div class="card">
          <div class="card-body htmx-container table-responsive" id="object_list">
            {% include 'htmx/table.html' %}
          </div>
        </div>

        
      </div>
    </form>
  </div>