{% extends 'generic/object_detail.html' %}
{% load helpers %}

{% block content_left_page %}
        <div class="panel panel-default">
            <div class="panel-heading">
                <strong>Virtual Chassis</strong>
            </div>
            <table class="table table-hover panel-body attr-table">
                <tr>
                    <td>Domain</td>
                    <td>{{ object.domain|placeholder }}</td>
                </tr>
                <tr>
                    <td>Master</td>
                    <td>{{ object.master|hyperlinked_object }}</td>
                </tr>
            </table>
        </div>
{% endblock content_left_page %}

{% block content_right_page %}
        <div class="panel panel-default">
            <div class="panel-heading">
                <strong>Members</strong>
            </div>
            <table class="table table-hover panel-body attr-table">
                <tr>
                    <th>Device</th>
                    <th>Position</th>
                    <th>Master</th>
                    <th>Priority</th>
                </tr>
                {% for vc_member in members %}
                    <tr{% if vc_member == device %} class="info"{% endif %}>
                        <td>{{ vc_member|hyperlinked_object }}</td>
                        <td><span class="badge badge-default">{{ vc_member.vc_position }}</span></td>
                        <td>{% if object.master == vc_member %}{{ True | render_boolean }}{% endif %}</td>
                        <td>{{ vc_member.vc_priority|placeholder }}</td>
                    </tr>
                {% endfor %}
            </table>
            {% if perms.dcim.change_virtualchassis %}
                <div class="panel-footer text-right noprint">
                    <a href="{% url 'dcim:virtualchassis_add_member' pk=object.pk %}?location={{ object.master.location.pk }}&rack={{ object.master.rack.pk }}" class="btn btn-primary btn-xs">
                        <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Member
                    </a>
                </div>
            {% endif %}
        </div>
{% endblock content_right_page %}
