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

{% block content %}
    <div class="row">
        <div class="col col-md-6">
            <div class="card">
                <h5 class="card-header">
                    Cable
                </h5>
                <div class="card-body">
                    <table class="table table-hover attr-table">
                        <tr>
                            <th scope="row">Type</th>
                            <td>{{ object.get_type_display|placeholder }}</td>
                        </tr>
                        <tr>
                            <th scope="row">Status</th>
                            <td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
                        </tr>
                        <tr>
                            <th scope="row">Tenant</th>
                            <td>
                                {% if object.tenant %}
                                    {% if object.tenant.group %}
                                        <a href="{{ object.tenant.group.get_absolute_url }}">{{ object.tenant.group }}</a> /
                                    {% endif %}
                                    <a href="{{ object.tenant.get_absolute_url }}">{{ object.tenant }}</a>
                                {% else %}
                                    <span class="text-muted">None</span>
                                {% endif %}
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">Label</th>
                            <td>{{ object.label|placeholder }}</td>
                        </tr>
                        <tr>
                            <th scope="row">Color</th>
                            <td>
                                {% if object.color %}
                                    <span class="color-label" style="background-color: #{{ object.color }}">&nbsp;</span>
                                {% else %}
                                    <span class="text-muted">&mdash;</span>
                                {% endif %}
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">Length</th>
                            <td>
                                {% if object.length %}
                                    {{ object.length|floatformat }} {{ object.get_length_unit_display }}
                                {% else %}
                                    <span class="text-muted">&mdash;</span>
                                {% endif %}
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            {% include 'inc/panels/custom_fields.html' %}
            {% include 'inc/panels/tags.html' %}
            {% plugin_left_page object %}
        </div>
        <div class="col col-md-6">
            <div class="card">
                <h5 class="card-header">
                    Termination A
                </h5>
                <div class="card-body">
                {% include 'dcim/inc/cable_termination.html' with termination=object.termination_a %}
                </div>
            </div>
            <div class="card">
                <h5 class="card-header">
                    Termination B
                </h5>
                <div class="card-body">
                {% include 'dcim/inc/cable_termination.html' with termination=object.termination_b %}
                </div>
            </div>
            {% plugin_right_page object %}
        </div>
    </div>
    <div class="row">
        <div class="col col-md-12">
            {% plugin_full_width_page object %}
        </div>
    </div>
{% endblock %}
