Skip to content

Commit

Permalink
Fixes #691: Allow the assignment of power ports to PDUs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Nov 14, 2016
1 parent 9eaf153 commit 955abce
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions netbox/templates/dcim/device.html
Original file line number Diff line number Diff line change
Expand Up @@ -237,16 +237,14 @@
{% for pp in power_ports %}
{% include 'dcim/inc/_powerport.html' %}
{% empty %}
{% if not device.device_type.is_pdu %}
<tr>
<td colspan="5" class="alert-warning">
<i class="fa fa-fw fa-warning"></i> No power ports defined
{% if perms.dcim.add_powerport %}
<a href="{% url 'dcim:powerport_add' pk=device.pk %}" class="btn btn-primary btn-xs pull-right"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a>
{% endif %}
</td>
</tr>
{% endif %}
<tr>
<td colspan="5" class="alert-warning">
<i class="fa fa-fw fa-warning"></i> No power ports defined
{% if perms.dcim.add_powerport %}
<a href="{% url 'dcim:powerport_add' pk=device.pk %}" class="btn btn-primary btn-xs pull-right"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% if perms.dcim.add_interface or perms.dcim.add_consoleport or perms.dcim.add_powerport %}
Expand All @@ -261,7 +259,7 @@
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add console port
</a>
{% endif %}
{% if perms.dcim.add_powerport and not device.device_type.is_pdu %}
{% if perms.dcim.add_powerport %}
<a href="{% url 'dcim:powerport_add' pk=device.pk %}" class="btn btn-xs btn-primary">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add power port
</a>
Expand Down

0 comments on commit 955abce

Please sign in to comment.