{% load helpers %}
<tr>

    {# Checkbox #}
    {% if perms.dcim.change_inventoryitem or perms.dcim.delete_inventoryitem %}
        <td class="pk">
            <input name="pk" type="checkbox" value="{{ item.pk }}" />
        </td>
    {% endif %}

    <td style="padding-left: {{ indent|add:5 }}px">
        <a href="{{ item.get_absolute_url }}">{{ item }}</a>
    </td>
    <td>
        {% if item.manufacturer %}
            <a href="{{ item.manufacturer.get_absolute_url }}">{{ item.manufacturer }}</a>
        {% else %}
            <span class="text-muted">&mdash;</span>
        {% endif %}
    </td>
    <td>{{ item.part_id|placeholder }}</td>
    <td>{{ item.serial|placeholder }}</td>
    <td>{{ item.asset_tag|placeholder }}</td>
    <td>
        {% if item.discovered %}
            <span class="text-success"><i class="fa fa-check"></i></span>
        {% else %}
            <span class="text-muted">&mdash;</span>
        {% endif %}
    </td>
    <td>{{ item.description|placeholder }}</td>
    <td class="text-right noprint">
        {% if perms.dcim.change_inventoryitem %}
            <a href="{% url 'dcim:inventoryitem_edit' pk=item.pk %}" class="btn btn-xs btn-warning"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a>
        {% endif %}
        {% if perms.dcim.delete_inventoryitem %}
            <a href="{% url 'dcim:inventoryitem_delete' pk=item.pk %}?return_url={% url 'dcim:device_inventory' pk=device.pk %}" class="btn btn-xs btn-danger"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a>
        {% endif %}
    </td>
</tr>
{% for item in item.child_items.all %}
    {% with template_name='dcim/inc/inventoryitem.html' indent=indent|add:20 %}
        {% include template_name %}
    {% endwith %}
{% endfor %}
