1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
2018-11-15 14:23:23 -05:00

58 lines
2.1 KiB
HTML

<tr class="powerport{% if pp.cable.status %} success{% elif pp.cable %} info{% endif %}">
{# Name #}
<td>
<i class="fa fa-fw fa-bolt"></i> {{ pp }}
</td>
{# Cable #}
<td>
{% if pp.cable %}
<a href="{{ pp.cable.get_absolute_url }}">{{ pp.cable }}</a>
{% else %}
&mdash;
{% endif %}
</td>
{# Connection #}
{% if pp.connected_endpoint %}
<td>
<a href="{% url 'dcim:device' pk=pp.connected_endpoint.device.pk %}">{{ pp.connected_endpoint.device }}</a>
</td>
<td>
{{ pp.connected_endpoint }}
</td>
{% else %}
<td colspan="2">
<span class="text-muted">Not connected</span>
</td>
{% endif %}
{# Actions #}
<td class="text-right">
{% if pp.cable %}
{% include 'dcim/inc/cable_toggle_buttons.html' with cable=pp.cable %}
{% elif perms.dcim.add_cable %}
<a href="{% url 'dcim:powerport_connect' termination_a_id=pp.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_powerport %}
<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>
</a>
{% endif %}
{% if perms.dcim.delete_powerport %}
{% if pp.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:powerport_delete' pk=pp.pk %}?return_url={{ device.get_absolute_url }}" title="Delete port" class="btn btn-danger btn-xs">
<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
</a>
{% endif %}
{% endif %}
</td>
</tr>