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

{% block content_left_page %}
        <div class="panel panel-default">
            <div class="panel-heading">
                <strong>Tenant Group</strong>
            </div>
            <table class="table table-hover panel-body attr-table">
                <tr>
                    <td>Description</td>
                    <td>{{ object.description|placeholder }}</td>
                </tr>
                <tr>
                    <td>Parent</td>
                    <td>{{ object.parent|hyperlinked_object }}</td>
                </tr>
                <tr>
                    <td>Tenants</td>
                    <td>
                        <a href="{% url 'tenancy:tenant_list' %}?tenant_group={{ object.name }}">{{ tenant_table.rows|length }}</a>
                    </td>
                </tr>
            </table>
        </div>
{% endblock content_left_page %}

{% block content_right_page %}
        <div class="panel panel-default">
            <div class="panel-heading">
                <strong>Tenants</strong>
            </div>
            {% include 'inc/table.html' with table=tenant_table %}
            {% if perms.teanancy.add_tenant %}
                <div class="panel-footer text-right noprint">
                    <a href="{% url 'tenancy:tenant_add' %}?group={{ object.pk }}" class="btn btn-xs btn-primary">
                        <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add tenant
                    </a>
                </div>
            {% endif %}
        </div>
        {% include 'inc/paginator.html' with paginator=tenant_table.paginator page=tenant_table.page %}
        <div class="row"></div>
{% endblock content_right_page %}
