{% extends 'generic/object.html' %}
{% load render_table from django_tables2 %}

{% block breadcrumbs %}
  {{ block.super }}
  <li class="breadcrumb-item"><a href="{% url 'plugins:netbox_acls:aclinterfaceassignment_list' %}?access_list_id={{ object.access_list.pk }}">{{ object.access_list }}</a></li>
{% endblock breadcrumbs %}

{% block content %}
  <div class="row mb-3">
    <div class="col col-md-6">
      <div class="card">
        <h2 class="card-header">ACL Interface Assignment</h2>
        <table class="table table-hover attr-table">
          <tr>
            <th scope="row">Host</th>
            <td>
              {% if object.assigned_object.device %}
                {{ object.assigned_object.device|linkify|placeholder }}
              {% else %}
                {{ object.assigned_object.virtual_machine|linkify|placeholder }}
              {% endif %}
            </td>
          </tr>
          <tr>
            <th scope="row">Interface</th>
            <td>{{ object.assigned_object|linkify|placeholder }}</td>
          </tr>
          <tr>
            <th scope="row">Access List</th>
            <td>{{ object.access_list|linkify }}</td>
          </tr>
          <tr>
            <th scope="row">Direction</th>
            <td>{% badge object.get_direction_display bg_color=object.get_direction_color %}</td>
          </tr>
        </table>
      </div>
      {% include 'inc/panels/custom_fields.html' %}
    </div>
    <div class="col col-md-6">
      {% include 'inc/panels/tags.html' %}
      {% include 'inc/panels/comments.html' %}
    </div>
  </div>
{% endblock content %}
