| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <tr class="poweroutlet{% if po.connected_endpoint %} {% if po.connected_endpoint.connection_status %}success{% else %}info{% endif %}{% 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>
- {% with cable=po.get_connected_cable %}
- {% if cable %}
- <a href="{{ cable.get_absolute_url }}">{{ cable }}</a>
- {% if cable.far_end != po.connected_endpoint %}
- to <a href="{{ cable.far_end.device.get_absolute_url }}">{{ cable.far_end.device }}</a> {{ cable.far_end }}
- {% endif %}
- {% endif %}
- {% endwith %}
- </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 perms.dcim.change_poweroutlet %}
- {% if po.connected_endpoint %}
- {% if po.connected_endpoint.connection_status %}
- <a href="#" class="btn btn-warning btn-xs powerport-toggle connected" title="Mark planned" data="{{ po.connected_endpoint.pk }}">
- <i class="glyphicon glyphicon-ban-circle" aria-hidden="true"></i>
- </a>
- {% else %}
- <a href="#" class="btn btn-success btn-xs powerport-toggle" title="Mark installed" data="{{ po.connected_endpoint.pk }}">
- <i class="fa fa-plug" aria-hidden="true"></i>
- </a>
- {% endif %}
- <a href="{% url 'dcim:poweroutlet_disconnect' pk=po.pk %}" title="Delete connection" class="btn btn-danger btn-xs">
- <i class="glyphicon glyphicon-resize-full" aria-hidden="true"></i>
- </a>
- {% else %}
- <a href="{% url 'dcim:poweroutlet_connect' termination_a_id=po.pk %}" title="Connect" class="btn btn-success btn-xs">
- <i class="glyphicon glyphicon-resize-small" aria-hidden="true"></i>
- </a>
- {% endif %}
- <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>
|