<tr class="poweroutlet{% if po.cable.status %} success{% elif po.cable %} info{% endif %}">

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

    {# Name #}
    <td>
        <i class="fa fa-fw fa-bolt"></i> {{ po }}
    </td>

    {# Cable #}
    <td>
        {% if po.cable %}
            <a href="{{ po.cable.get_absolute_url }}">{{ po.cable }}</a>
        {% else %}
            &mdash;
        {% endif %}
    </td>

    {# Connection #}
    {% if po.connected_endpoint %}
        <td>
            <a href="{% url 'dcim:device' pk=po.connected_endpoint.device.pk %}">{{ po.connected_endpoint.device }}</a>
        </td>
        <td>
            {{ po.connected_endpoint }}
        </td>
    {% else %}
        <td colspan="2">
            <span class="text-muted">Not connected</span>
        </td>
    {% endif %}

    {# Actions #}
    <td class="text-right">
        {% if po.cable %}
            {% include 'dcim/inc/cable_toggle_buttons.html' with cable=po.cable %}
        {% elif perms.dcim.add_cable %}
            <a href="{% url 'dcim:poweroutlet_connect' termination_a_id=po.pk %}?return_url={{ device.get_absolute_url }}" title="Connect" class="btn btn-success btn-xs">
                <i class="glyphicon glyphicon-resize-small" aria-hidden="true"></i>
            </a>
        {% endif %}
        {% if perms.dcim.change_poweroutlet %}
            <a href="{% url 'dcim:poweroutlet_edit' pk=po.pk %}" title="Edit outlet" class="btn btn-info btn-xs">
                <i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
            </a>
        {% endif %}
        {% if perms.dcim.delete_poweroutlet %}
            {% if po.connected_endpoint %}
                <button class="btn btn-danger btn-xs" disabled="disabled">
                    <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
                </button>
            {% else %}
                <a href="{% url 'dcim:poweroutlet_delete' pk=po.pk %}?return_url={{ device.get_absolute_url }}" title="Delete outlet" class="btn btn-danger btn-xs">
                    <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
                </a>
            {% endif %}
        {% endif %}
    </td>
</tr>
