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

{% block content_left_page %}
        <div class="panel panel-default">
            <div class="panel-heading">
                <strong>Platform</strong>
            </div>
            <table class="table table-hover panel-body attr-table">
                <tr>
                    <td>Description</td>
                    <td>{{ object.description|placeholder }}</td>
                </tr>
                <tr>
                    <td>Manufacturer</td>
                    <td>{{ object.manufacturer|hyperlinked_object }}</td>
                </tr>
                <tr>
                    <td>NAPALM driver</td>
                    <td>{{ object.napalm_driver|placeholder }}</td>
                </tr>
                <tr>
                    <td>NAPALM arguments</td>
                    <td>
                        <pre>{% if object.napalm_args %}{{ object.napalm_args|render_json }}{% endif %}</pre>
                    </td>
                </tr>
                <tr>
                    <td>Network driver</td>
                    <td>{{ object.network_driver|placeholder }}</td>
                </tr>
                <tr>
                    <td>Devices</td>
                    <td>
                        <a href="{% url 'dcim:device_list' %}?platform={{ object.name }}">{{ device_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>Network Driver Mappings</strong>
    </div>
    <table class="table table-hover panel-body attr-table">
        {% for key in network_driver_tool_names %}
        <tr>
            <td>{{ key }}</td>
            <td>{{ object.network_driver_mappings|get_item:key|placeholder }}</td>
        </tr>
        {% endfor %}
    </table>
</div>
{% endblock content_right_page %}

{% block content_full_width_page %}
        <div class="panel panel-default">
            <div class="panel-heading">
                <strong>Devices</strong>
            </div>
            {% include 'inc/table.html' with table=device_table %}
            {% if perms.dcim.add_device %}
                <div class="panel-footer text-right noprint">
                    <a href="{% url 'dcim:device_add' %}?platform={{ object.pk }}" class="btn btn-xs btn-primary">
                        <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add device
                    </a>
                </div>
            {% endif %}
        </div>
        {% include 'inc/paginator.html' with paginator=device_table.paginator page=device_table.page %}
        <div class="row"></div>
{% endblock content_full_width_page %}
