{% load helpers %}
{% if perms.dcim.change_devicetype %}
    <form method="post">
        {% csrf_token %}
        <div class="panel panel-default">
            <div class="panel-heading">
                <strong>{{ title }}</strong>
            </div>
            {% include 'responsive_table.html' %}
            <div class="panel-footer noprint">
                {% if table.rows %}
                    <button type="submit" name="_edit" formaction="{% url table.Meta.model|viewname:"bulk_rename" %}?return_url={{ object.get_absolute_url }}" class="btn btn-xs btn-warning">
                        <span class="mdi mdi-pencil" aria-hidden="true"></span> Rename
                    </button>
                    <button type="submit" name="_edit" formaction="{% url table.Meta.model|viewname:"bulk_edit" %}?return_url={{ object.get_absolute_url }}" class="btn btn-xs btn-warning">
                        <span class="mdi mdi-pencil" aria-hidden="true"></span> Edit
                    </button>
                    <button type="submit" name="_delete" formaction="{% url table.Meta.model|viewname:"bulk_delete" %}?return_url={{ object.get_absolute_url }}" class="btn btn-xs btn-danger">
                        <span class="mdi mdi-trash-can-outline" aria-hidden="true"></span> Delete
                    </button>
                {% endif %}
                <div class="pull-right">
                    <a href="{% url table.Meta.model|viewname:"add" %}?device_type={{ object.pk }}&return_url={{ object.get_absolute_url }}%3Ftab={{ tab }}" class="btn btn-primary btn-xs">
                        <span class="mdi mdi-plus-thick" aria-hidden="true"></span>
                        Add {{ title }}
                    </a>
                </div>
                <div class="clearfix"></div>
            </div>
        </div>
    </form>
{% else %}
    <div class="panel panel-default">
        <div class="panel-heading">
            <strong>{{ title }}</strong>
        </div>
        {% include 'responsive_table.html' %}
    </div>
{% endif %}
