2018-10-26 11:29:03 -04:00
|
|
|
{% with cable=frontport.get_connected_cable %}
|
|
|
|
<tr class="frontport{% if cable %} {% if cable.status %}success{% else %}info{% endif %}{% endif %}">
|
|
|
|
|
|
|
|
{# Checkbox #}
|
|
|
|
{% if perms.dcim.change_frontport or perms.dcim.delete_frontport %}
|
|
|
|
<td class="pk">
|
|
|
|
<input name="pk" type="checkbox" value="{{ frontport.pk }}" />
|
|
|
|
</td>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{# Name #}
|
|
|
|
<td>
|
2018-10-26 11:32:04 -04:00
|
|
|
<i class="fa fa-fw fa-square{% if not cable %}-o{% endif %}"></i> {{ frontport }}
|
2018-10-25 12:08:13 -04:00
|
|
|
</td>
|
2018-10-26 11:29:03 -04:00
|
|
|
|
|
|
|
{# Type #}
|
|
|
|
<td>{{ frontport.get_type_display }}</td>
|
|
|
|
|
|
|
|
{# Rear port #}
|
|
|
|
<td>{{ frontport.rear_port }}</td>
|
|
|
|
<td>{{ frontport.rear_port_position }}</td>
|
|
|
|
|
|
|
|
{# Cable #}
|
2018-10-25 15:21:16 -04:00
|
|
|
<td>
|
|
|
|
{% if cable %}
|
2018-10-26 13:21:43 -04:00
|
|
|
<a href="{{ cable.get_absolute_url }}">{{ cable }}</a> to <a href="{{ cable.far_end.device.get_absolute_url }}">{{ cable.far_end.device }}</a> {{ cable.far_end }}
|
2018-10-25 15:21:16 -04:00
|
|
|
{% else %}
|
|
|
|
<span class="text-muted">Not connected</span>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
2018-10-26 11:29:03 -04:00
|
|
|
|
|
|
|
{# Actions #}
|
|
|
|
<td class="text-right">
|
|
|
|
{% if perms.dcim.change_frontport %}
|
|
|
|
<a href="{% url 'dcim:frontport_edit' pk=frontport.pk %}?return_url={{ device.get_absolute_url }}" title="Edit port" class="btn btn-info btn-xs">
|
|
|
|
<i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
{% if perms.dcim.delete_frontport %}
|
|
|
|
<a href="{% url 'dcim:frontport_delete' pk=frontport.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 %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endwith %}
|