{% extends 'generic/object.html' %}
{% load buttons %}
{% load custom_links %}
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}

{% block breadcrumbs %}
<li class="breadcrumb-item"><a href="{% url 'plugins:netbox_peering_manager:peeringnetwork_list' %}">Networks</a></li>
{% endblock %}


{% block content %}
<div class="row mb-3">
    <div class="col-md-6">
        <div class="card">
            <h5 class="card-header">
                Peering Network
            </h5>
            <div class="card-body">
                <table class="table table-hover attr-table">
                    <tr>
                        <td>Fabric</td>
                        <td><a href="{{ object.fabric.get_absolute_url }}">{{ object.fabric }}</a></td>
                    </tr>
                    <tr>
                        <td>Name</td>
                        <td>{{ object.name }}</td>
                    </tr>
                    <tr>
                        <td>Status</td>
                        <td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
                    </tr>
                    <tr>
                        <td>Prefix</td>
                        <td><a href="{{ object.prefix.get_absolute_url }}">{{ object.prefix }}</a></td>
                    </tr>
                    <tr>
                        <td>VLAN</td>
                        <td>
                            {% if object.vlan %}
                                <a href="{{ object.vlan.get_absolute_url }}">{{ object.vlan }}</a>
                            {% else %}
                                {{ ''|placeholder }}
                            {% endif %}
                        </td>
                    </tr>
                    <tr>
                        <td>Description</td>
                        <td>{{ object.description|placeholder }}</td>
                    </tr>
                </table>
            </div>
        </div>
        {% include 'inc/panels/custom_fields.html' %}
        {% include 'inc/panels/tags.html' %}
        {% include 'inc/panels/comments.html' %}
        {% plugin_left_page object %}
    </div>
    <div class="col-md-6">
        {% plugin_right_page object %}
    </div>
</div>
<div class="row mb-3">
    <div class="col-md-12">
        <div class="card">
            <h5 class="card-header">
                Connections
            </h5>
            <div class="card-body">
                {% render_table connections_table 'inc/table.html' %}
            </div>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-md-12">
        <div class="card">
            <h5 class="card-header">
                Peering Sessions
            </h5>
            <div class="card-body">
                {% render_table sessions_table 'inc/table.html' %}
            </div>
        </div>
        {% plugin_full_width_page object %}
    </div>
</div>
{% endblock %}
