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

{% block content %}
  <div class="row mb-3">
    <div class="col col-md-6">
      <div class="card">
        <h5 class="card-header">ACL Interface Assignment</h5>
        <div class="card-body">
          <table class="table table-hover attr-table">
            <caption>Host</caption>
            <tr>
              <th scope="row">Host</th>
              <td>
                {% if object.assigned_object.device %}
                <a href="{{ object.assigned_object.device.get_absolute_url }}">{{ object.assigned_object.device|placeholder }}</a>
                {% else %}
                <a href="{{ object.assigned_object.virtual_machine.get_absolute_url }}">{{ object.assigned_object.virtual_machine|placeholder }}</a>
                {% endif %}
              </td>
            </tr>
            <tr>
              <th scope="row">Interface</th>
              <td>
                <a href="{{ object.assigned_object.get_absolute_url }}">{{ object.assigned_object }}</a>
              </td>
            </tr>
            <tr>
                <th scope="row">Access List</th>
                <td>
                  <a href="{{ object.access_list.get_absolute_url }}">{{ object.access_list }}</a>
                </td>
            </tr>
            <tr>
                <th scope="row">Direction</th>
                <td>{% badge object.get_direction_display bg_color=object.get_direction_color %}</td>
            </tr>
          </table>
        </div>
      </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 %}
