Parcourir la source

Hide LLDP Neighbors tab if device is marked offline

Jeremy Stretch il y a 9 ans
Parent
commit
e5efb7ddbd
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      netbox/templates/dcim/inc/_device_header.html

+ 3 - 1
netbox/templates/dcim/inc/_device_header.html

@@ -40,5 +40,7 @@
 <ul class="nav nav-tabs" style="margin-bottom: 20px">
     <li role="presentation"{% if active_tab == 'info' %} class="active"{% endif %}><a href="{% url 'dcim:device' pk=device.pk %}">Info</a></li>
     <li role="presentation"{% if active_tab == 'inventory' %} class="active"{% endif %}><a href="{% url 'dcim:device_inventory' pk=device.pk %}">Inventory</a></li>
-    <li role="presentation"{% if active_tab == 'lldp-neighbors' %} class="active"{% endif %}><a href="{% url 'dcim:device_lldp_neighbors' pk=device.pk %}">LLDP Neighbors</a></li>
+    {% if device.status %}
+        <li role="presentation"{% if active_tab == 'lldp-neighbors' %} class="active"{% endif %}><a href="{% url 'dcim:device_lldp_neighbors' pk=device.pk %}">LLDP Neighbors</a></li>
+    {% endif %}
 </ul>