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

{% block title %}VRF {{ object }}{% endblock %}

{% block content %}
<div class="row">
	<div class="col col-md-6">
      <div class="card">
          <h5 class="card-header">
              VRF
          </h5>
          <div class="card-body">
              <table class="table table-hover attr-table">
                  <tr>
                      <th scope="row">Route Distinguisher</th>
                      <td>{{ object.rd|placeholder }}</td>
                  </tr>
                  <tr>
                      <th scope="row">Tenant</th>
                      <td>
                          {% if object.tenant %}
                              <a href="{{ object.tenant.get_absolute_url }}">{{ object.tenant }}</a>
                          {% else %}
                              <span class="text-muted">None</span>
                          {% endif %}
                      </td>
                  </tr>
                  <tr>
                      <th scope="row">Unique IP Space</th>
                      <td>{% checkmark object.enforce_unique %}</td>
                  </tr>
                  <tr>
                      <th scope="row">Description</th>
                      <td>{{ object.description|placeholder }}</td>
                  </tr>
                  <tr>
                      <th scope="row">Prefixes</th>
                      <td>
                          <a href="{% url 'ipam:prefix_list' %}?vrf_id={{ object.pk }}">{{ prefix_count }}</a>
                      </td>
                  </tr>
                  <tr>
                      <th scope="row">IP Addresses</th>
                      <td>
                          <a href="{% url 'ipam:ipaddress_list' %}?vrf_id={{ object.pk }}">{{ ipaddress_count }}</a>
                      </td>
                  </tr>
              </table>
          </div>
      </div>
      {% plugin_left_page object %}
  </div>
  <div class="col col-md-6">
    {% include 'inc/panels/tags.html' %}
    {% include 'inc/panels/custom_fields.html' %}
    {% plugin_right_page object %}
	</div>
</div>
<div class="row">
	<div class="col col-md-6">
    {% include 'inc/panel_table.html' with table=import_targets_table heading="Import Route Targets" %}
  </div>
	<div class="col col-md-6">
    {% include 'inc/panel_table.html' with table=export_targets_table heading="Export Route Targets" %}
  </div>
</div>
<div class="row">
  <div class="col col-md-12">
    {% plugin_full_width_page object %}
  </div>
</div>
{% endblock %}
