2018-10-24 11:00:13 -04:00
|
|
|
<tr class="powerport{% if pp.connected_endpoint %} {% if pp.connection_status %}success{% else %}info{% endif %}{% endif %}">
|
2018-10-26 11:29:03 -04:00
|
|
|
|
|
|
|
{# Name #}
|
2016-03-01 11:23:03 -05:00
|
|
|
<td>
|
2017-11-02 08:51:27 -07:00
|
|
|
<i class="fa fa-fw fa-bolt"></i> {{ pp }}
|
2016-03-01 11:23:03 -05:00
|
|
|
</td>
|
2018-10-26 11:29:03 -04:00
|
|
|
|
2018-10-26 13:21:43 -04:00
|
|
|
{# Cable #}
|
|
|
|
<td>
|
2018-10-29 12:24:16 -04:00
|
|
|
{% if pp.cable %}
|
|
|
|
<a href="{{ pp.cable.get_absolute_url }}">{{ pp.cable }}</a>
|
|
|
|
{% else %}
|
|
|
|
—
|
|
|
|
{% endif %}
|
2018-10-26 13:21:43 -04:00
|
|
|
</td>
|
|
|
|
|
2018-10-26 11:29:03 -04:00
|
|
|
{# Connection #}
|
2018-10-24 11:00:13 -04:00
|
|
|
{% if pp.connected_endpoint %}
|
2016-03-01 11:23:03 -05:00
|
|
|
<td>
|
2018-10-24 11:00:13 -04:00
|
|
|
<a href="{% url 'dcim:device' pk=pp.connected_endpoint.device.pk %}">{{ pp.connected_endpoint.device }}</a>
|
2016-03-01 11:23:03 -05:00
|
|
|
</td>
|
|
|
|
<td>
|
2018-10-24 11:00:13 -04:00
|
|
|
{{ pp.connected_endpoint }}
|
2016-03-01 11:23:03 -05:00
|
|
|
</td>
|
|
|
|
{% else %}
|
2016-07-06 16:01:18 -04:00
|
|
|
<td colspan="2">
|
|
|
|
<span class="text-muted">Not connected</span>
|
|
|
|
</td>
|
2016-03-01 11:23:03 -05:00
|
|
|
{% endif %}
|
2018-10-26 11:29:03 -04:00
|
|
|
|
|
|
|
{# Actions #}
|
2017-06-16 17:13:33 -04:00
|
|
|
<td class="text-right">
|
2016-03-01 11:23:03 -05:00
|
|
|
{% if perms.dcim.change_powerport %}
|
2018-10-24 11:00:13 -04:00
|
|
|
{% if pp.connected_endpoint %}
|
2016-03-01 11:23:03 -05:00
|
|
|
{% if pp.connection_status %}
|
2017-06-16 10:01:47 -04:00
|
|
|
<a href="#" class="btn btn-warning btn-xs powerport-toggle connected" title="Mark planned" data="{{ pp.pk }}">
|
|
|
|
<i class="glyphicon glyphicon-ban-circle" aria-hidden="true"></i>
|
2016-03-01 11:23:03 -05:00
|
|
|
</a>
|
|
|
|
{% else %}
|
2017-06-16 10:01:47 -04:00
|
|
|
<a href="#" class="btn btn-success btn-xs powerport-toggle" title="Mark installed" data="{{ pp.pk }}">
|
|
|
|
<i class="fa fa-plug" aria-hidden="true"></i>
|
2016-03-01 11:23:03 -05:00
|
|
|
</a>
|
|
|
|
{% endif %}
|
2018-10-31 15:54:29 -04:00
|
|
|
<a href="{% url 'dcim:cable_delete' pk=pp.cable.pk %}" title="Remove cable" class="btn btn-danger btn-xs">
|
|
|
|
<i class="glyphicon glyphicon-resize-full" aria-hidden="true"></i>
|
|
|
|
</a>
|
2016-03-01 11:23:03 -05:00
|
|
|
{% else %}
|
2018-10-24 14:38:44 -04:00
|
|
|
<a href="{% url 'dcim:powerport_connect' termination_a_id=pp.pk %}" title="Connect" class="btn btn-success btn-xs">
|
2017-06-16 10:01:47 -04:00
|
|
|
<i class="glyphicon glyphicon-resize-small" aria-hidden="true"></i>
|
2016-03-01 11:23:03 -05:00
|
|
|
</a>
|
|
|
|
{% endif %}
|
2017-06-16 10:01:47 -04:00
|
|
|
<a href="{% url 'dcim:powerport_edit' pk=pp.pk %}" title="Edit port" class="btn btn-info btn-xs">
|
|
|
|
<i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
|
2016-03-01 11:23:03 -05:00
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
{% if perms.dcim.delete_powerport %}
|
2018-10-24 11:00:13 -04:00
|
|
|
{% if pp.connected_endpoint %}
|
2016-03-01 11:23:03 -05:00
|
|
|
<button class="btn btn-danger btn-xs" disabled="disabled">
|
|
|
|
<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
|
|
|
|
</button>
|
|
|
|
{% else %}
|
2018-02-27 14:59:45 -05:00
|
|
|
<a href="{% url 'dcim:powerport_delete' pk=pp.pk %}?return_url={{ device.get_absolute_url }}" title="Delete port" class="btn btn-danger btn-xs">
|
2017-06-16 10:01:47 -04:00
|
|
|
<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
|
2016-03-01 11:23:03 -05:00
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|