{% extends '_base.html' %}
{% load helpers %}
{% load render_table from django_tables2 %}

{% block title %}{{ devicetype }}{% endblock %}

{% block content %}
<div class="row">
    <div class="col-md-12">
        <ol class="breadcrumb">
            <li><a href="{% url 'dcim:devicetype_list' %}">Device Types</a></li>
            <li><a href="{% url 'dcim:devicetype_list' %}?manufacturer={{ devicetype.manufacturer.slug }}">{{ devicetype.manufacturer }}</a></li>
            <li>{{ devicetype.model }}</li>
        </ol>
    </div>
</div>
{% if perms.dcim.change_devicetype %}
    <div class="pull-right">
		<a href="{% url 'dcim:devicetype_edit' pk=devicetype.pk %}" class="btn btn-warning">
			<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
			Edit this device type
		</a>
    {% endif %}
    {% if perms.dcim.delete_devicetype %}
		<a href="{% url 'dcim:devicetype_delete' pk=devicetype.pk %}" class="btn btn-danger">
			<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
			Delete this device type
		</a>
    </div>
{% endif %}
<h1>{{ devicetype }}</h1>
<div class="row">
	<div class="col-md-6">
        <div class="panel panel-default">
            <div class="panel-heading">
                <strong>Chassis</strong>
            </div>
            <table class="table table-hover panel-body">
                <tr>
                    <td>Manufacturer</td>
                    <td>{{ devicetype.manufacturer }}</td>
                </tr>
                <tr>
                    <td>Model Name</td>
                    <td>{{ devicetype.model }}</td>
                </tr>
                <tr>
                    <td>Height (U)</td>
                    <td>{{ devicetype.u_height }}</td>
                </tr>
                <tr>
                    <td>Full Depth</td>
                    <td>{{ devicetype.is_full_depth|yesno|capfirst }}</td>
                </tr>
            </table>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                <strong>Function</strong>
            </div>
            <table class="table table-hover panel-body">
                <tr>
                    <td>Is a Console Server</td>
                    <td>{{ devicetype.is_console_server|yesno|capfirst }}</td>
                </tr>
                <tr>
                    <td>Is a PDU</td>
                    <td>{{ devicetype.is_pdu|yesno|capfirst }}</td>
                </tr>
                <tr>
                    <td>Is a Network Device</td>
                    <td>{{ devicetype.is_network_device|yesno|capfirst }}</td>
                </tr>
            </table>
        </div>
        {% include 'dcim/inc/devicetype_component_table.html' with table=consoleport_table title='Console Ports' add_url='dcim:devicetype_add_consoleport' delete_url='dcim:devicetype_delete_consoleport' %}
        {% include 'dcim/inc/devicetype_component_table.html' with table=powerport_table title='Power Ports' add_url='dcim:devicetype_add_powerport' delete_url='dcim:devicetype_delete_powerport' %}
    </div>
	<div class="col-md-6">
        {% include 'dcim/inc/devicetype_component_table.html' with table=interface_table title='Interfaces' add_url='dcim:devicetype_add_interface' delete_url='dcim:devicetype_delete_interface' %}
        {% include 'dcim/inc/devicetype_component_table.html' with table=consoleserverport_table title='Console Server Ports' add_url='dcim:devicetype_add_consoleserverport' delete_url='dcim:devicetype_delete_consoleserverport' %}
        {% include 'dcim/inc/devicetype_component_table.html' with table=poweroutlet_table title='Power Outlets' add_url='dcim:devicetype_add_poweroutlet' delete_url='dcim:devicetype_delete_poweroutlet' %}
    </div>
</div>
{% endblock %}
