<div class="row">
    <div class="col-sm-8 col-md-9">
    <ol class="breadcrumb">
        <li><a href="{% url 'dcim:site' slug=device.site.slug %}">{{ device.site }}</a></li>
        {% if device.rack %}
            <li><a href="{% url 'dcim:rack_list' %}?site={{ device.site.slug }}">Racks</a></li>
            <li><a href="{% url 'dcim:rack' pk=device.rack.pk %}">{{ device.rack }}</a></li>
        {% endif %}
        {% if device.parent_bay %}
            <li><a href="{% url 'dcim:device' pk=device.parent_bay.device.pk %}">{{ device.parent_bay.device }}</a></li>
            <li>{{ device.parent_bay.name }}</li>
        {% endif %}
        <li>{{ device }}</li>
    </ol>
    </div>
    <div class="col-sm-4 col-md-3">
        <form action="{% url 'dcim:device_list' %}" method="get">
            <div class="input-group">
                <input type="text" name="q" class="form-control" placeholder="Search devices" />
                <span class="input-group-btn">
                    <button type="submit" class="btn btn-primary">
                        <span class="fa fa-search" aria-hidden="true"></span>
                    </button>
                </span>
            </div>
        </form>
    </div>
</div>
<div class="pull-right">
    {% if perms.dcim.change_device %}
		<a href="{% url 'dcim:device_edit' pk=device.pk %}" class="btn btn-warning">
			<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
			Edit this device
		</a>
    {% endif %}
    {% if perms.dcim.delete_device %}
		<a href="{% url 'dcim:device_delete' pk=device.pk %}" class="btn btn-danger">
			<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
			Delete this device
		</a>
{% endif %}
</div>
<h1>{{ device }}</h1>
{% include 'inc/created_updated.html' with obj=device %}
<ul class="nav nav-tabs" style="margin-bottom: 20px">
    <li role="presentation"{% if active_tab == 'info' %} class="active"{% endif %}><a href="{% url 'dcim:device' pk=device.pk %}">Info</a></li>
    <li role="presentation"{% if active_tab == 'inventory' %} class="active"{% endif %}><a href="{% url 'dcim:device_inventory' pk=device.pk %}">Inventory</a></li>
    {% if perms.dcim.napalm_read %}
        {% if device.status == 1 and device.platform.napalm_driver and device.primary_ip %}
            <li role="presentation"{% if active_tab == 'status' %} class="active"{% endif %}><a href="{% url 'dcim:device_status' pk=device.pk %}">Status</a></li>
            <li role="presentation"{% if active_tab == 'lldp-neighbors' %} class="active"{% endif %}><a href="{% url 'dcim:device_lldp_neighbors' pk=device.pk %}">LLDP Neighbors</a></li>
            <li role="presentation"{% if active_tab == 'config' %} class="active"{% endif %}><a href="{% url 'dcim:device_config' pk=device.pk %}">Configuration</a></li>
        {% else %}
            <li role="presentation" class="disabled"><a href="#">Status</a></li>
            <li role="presentation" class="disabled"><a href="#">LLDP Neighbors</a></li>
            <li role="presentation" class="disabled"><a href="#">Configuration</a></li>
        {% endif %}
    {% endif %}
</ul>
