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

{% block extra_breadcrumbs %}
                {% if object.tenant_group %}
                    <li><a href="{% url 'tenancy:tenant_list' %}?group={{ object.tenant_group.name }}">{{ object.tenant_group }}</a></li>
                {% endif %}
{% endblock extra_breadcrumbs %}

{% block content_left_page %}
        <div class="panel panel-default">
            <div class="panel-heading">
                <strong>Tenant</strong>
            </div>
            <table class="table table-hover panel-body attr-table">
                <tr>
                    <td>Tenant Group</td>
                    <td>{{ object.tenant_group|hyperlinked_object }}</td>
                </tr>
                <tr>
                    <td>Description</td>
                    <td>{{ object.description|placeholder }}</td>
                </tr>
            </table>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                <strong>Comments</strong>
            </div>
            <div class="panel-body rendered-markdown">
                {% if object.comments %}
                    {{ object.comments|render_markdown }}
                {% else %}
                    <span class="text-muted">None</span>
                {% endif %}
            </div>
        </div>
{% endblock content_left_page %}

{% block content_right_page %}
        <div class="panel panel-default">
            <div class="panel-heading">
                <strong>Stats</strong>
            </div>
            <div class="row panel-body">
                <div class="col-md-4 text-center">
                    <h2><a href="{% url 'dcim:location_list' %}?tenant={{ object.name }}" class="btn {% if stats.location_count %}btn-primary{% else %}btn-default{% endif %} btn-lg">{{ stats.location_count }}</a></h2>
                    <p>Locations</p>
                </div>
                <div class="col-md-4 text-center">
                    <h2><a href="{% url 'dcim:rack_list' %}?tenant={{ object.name }}" class="btn {% if stats.rack_count %}btn-primary{% else %}btn-default{% endif %} btn-lg">{{ stats.rack_count }}</a></h2>
                    <p>Racks</p>
                </div>
                <div class="col-md-4 text-center">
                    <h2><a href="{% url 'dcim:rackreservation_list' %}?tenant={{ object.name }}" class="btn {% if stats.rackreservation_count %}btn-primary{% else %}btn-default{% endif %} btn-lg">{{ stats.rackreservation_count }}</a></h2>
                    <p>Rack reservations</p>
                </div>
                <div class="col-md-4 text-center">
                    <h2><a href="{% url 'dcim:device_list' %}?tenant={{ object.name }}" class="btn {% if stats.device_count %}btn-primary{% else %}btn-default{% endif %} btn-lg">{{ stats.device_count }}</a></h2>
                    <p>Devices</p>
                </div>
                <div class="col-md-4 text-center">
                    <h2><a href="{% url 'ipam:vrf_list' %}?tenant={{ object.name }}" class="btn {% if stats.vrf_count %}btn-primary{% else %}btn-default{% endif %} btn-lg">{{ stats.vrf_count }}</a></h2>
                    <p>VRFs</p>
                </div>
                <div class="col-md-4 text-center">
                    <h2><a href="{% url 'ipam:prefix_list' %}?tenant={{ object.name }}" class="btn {% if stats.prefix_count %}btn-primary{% else %}btn-default{% endif %} btn-lg">{{ stats.prefix_count }}</a></h2>
                    <p>Prefixes</p>
                </div>
                <div class="col-md-4 text-center">
                    <h2><a href="{% url 'ipam:ipaddress_list' %}?tenant={{ object.name }}" class="btn {% if stats.ipaddress_count %}btn-primary{% else %}btn-default{% endif %} btn-lg">{{ stats.ipaddress_count }}</a></h2>
                    <p>IP addresses</p>
                </div>
                <div class="col-md-4 text-center">
                    <h2><a href="{% url 'ipam:vlan_list' %}?tenant={{ object.name }}" class="btn {% if stats.vlan_count %}btn-primary{% else %}btn-default{% endif %} btn-lg">{{ stats.vlan_count }}</a></h2>
                    <p>VLANs</p>
                </div>
                <div class="col-md-4 text-center">
                    <h2><a href="{% url 'circuits:circuit_list' %}?tenant={{ object.name }}" class="btn {% if stats.circuit_count %}btn-primary{% else %}btn-default{% endif %} btn-lg">{{ stats.circuit_count }}</a></h2>
                    <p>Circuits</p>
                </div>
                <div class="col-md-4 text-center">
                    <h2><a href="{% url 'virtualization:virtualmachine_list' %}?tenant={{ object.name }}" class="btn {% if stats.virtualmachine_count %}btn-primary{% else %}btn-default{% endif %} btn-lg">{{ stats.virtualmachine_count }}</a></h2>
                    <p>Virtual machines</p>
                </div>
                <div class="col-md-4 text-center">
                    <h2><a href="{% url 'virtualization:cluster_list' %}?tenant={{ object.name }}" class="btn {% if stats.cluster_count %}btn-primary{% else %}btn-default{% endif %} btn-lg">{{ stats.cluster_count }}</a></h2>
                    <p>Clusters</p>
                </div>
            </div>
        </div>
{% endblock content_right_page %}
