mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
b8df05cf88
* Fixes #1655 Further field name references were found in `consoleport.html`. These have now been removed, so we rely on proper a proper `__str__` implementation of both `ConsolePort` and `ConsoleServerPort`. * Fixes #1655: Removed explicit field references Cleaned up all (notable) .name references, and removed them so __str__ can do the lifting. Did not remove the references where it was explicitly referenced to .name (eg. in details). Extended the Secret model to also include the name in __str__, since that was weirdly absent. * Adapted PR to comply with comments Re-introduced certain references to make sure explicit references are still used where needed.
54 lines
2.4 KiB
HTML
54 lines
2.4 KiB
HTML
<tr class="powerport{% if pp.power_outlet and not pp.connection_status %} info{% endif %}">
|
|
<td>
|
|
<i class="fa fa-fw fa-bolt"></i> {{ pp }}
|
|
</td>
|
|
{% if pp.power_outlet %}
|
|
<td>
|
|
<a href="{% url 'dcim:device' pk=pp.power_outlet.device.pk %}">{{ pp.power_outlet.device }}</a>
|
|
</td>
|
|
<td>
|
|
{{ pp.power_outlet }}
|
|
</td>
|
|
{% else %}
|
|
<td colspan="2">
|
|
<span class="text-muted">Not connected</span>
|
|
</td>
|
|
{% endif %}
|
|
<td class="text-right">
|
|
{% if perms.dcim.change_powerport %}
|
|
{% if pp.power_outlet %}
|
|
{% if pp.connection_status %}
|
|
<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>
|
|
</a>
|
|
{% else %}
|
|
<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>
|
|
</a>
|
|
{% endif %}
|
|
<a href="{% url 'dcim:powerport_disconnect' pk=pp.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:powerport_connect' pk=pp.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: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.power_outlet %}
|
|
<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 %}" title="Delete port" class="btn btn-danger btn-xs">
|
|
<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
|
|
</a>
|
|
{% endif %}
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|