{% extends 'netbox_dns/zone_base.html' %}
{% load helpers %}
{% load render_table from django_tables2 %}
{% load perms %}

{% block controls %}
{% endblock controls %}

{% block content-wrapper %}
  <div class="tab-content">

    {# Object list #}
    <div class="tab-pane show active" id="object-list" role="tabpanel" aria-labelledby="object-list-tab">

      <div class="row mb-3 justify-content-between">
        <div class="table-controls noprint col col-md-12 mb-0">
          {% if request.user.is_authenticated %}
            <div class="table-configure input-group input-group-sm">
              <button
                type="button"
                data-bs-toggle="modal"
                title="Configure Table"
                data-bs-target="#ZoneManagedRecordTable_config"
                class="btn btn-sm btn-outline-dark"
              >
                <i class="mdi mdi-cog"></i> Configure Table
              </button>
            </div>
          {% endif %}
        </div>
      </div>

      <form method="post" 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 #}
        <div class="card">
          <div class="card-body">
            <div class="table-responsive">
              {% render_table table %}
            </div>
          </div>
        </div>

      </form>

      {# Paginator #}
      {% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}
    </div>
  </div>

  {# Table config form #}
  {% table_config_form table table_name="ZoneManagedRecordTable" %}

{% endblock %}
