From 4d26fc7e7ca5763f35760f8c1aea57076e932298 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 17 Feb 2017 15:10:08 -0500 Subject: [PATCH] Fixes #903: Only alert on missing criticial connections if present in the parent device type --- netbox/templates/dcim/device.html | 54 +++++++++++++++++-------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/netbox/templates/dcim/device.html b/netbox/templates/dcim/device.html index cde8ce439..653575f2b 100644 --- a/netbox/templates/dcim/device.html +++ b/netbox/templates/dcim/device.html @@ -240,38 +240,44 @@ {% for iface in mgmt_interfaces %} {% include 'dcim/inc/interface.html' with icon='wrench' %} {% empty %} - - - No management interfaces defined - {% if perms.dcim.add_interface %} - - {% endif %} - - + {% if device.device_type.interface_templates.exists %} + + + No management interfaces defined + {% if perms.dcim.add_interface %} + + {% endif %} + + + {% endif %} {% endfor %} {% for cp in console_ports %} {% include 'dcim/inc/consoleport.html' %} {% empty %} - - - No console ports defined - {% if perms.dcim.add_consoleport %} - - {% endif %} - - + {% if device.device_type.console_port_templates.exists %} + + + No console ports defined + {% if perms.dcim.add_consoleport %} + + {% endif %} + + + {% endif %} {% endfor %} {% for pp in power_ports %} {% include 'dcim/inc/powerport.html' %} {% empty %} - - - No power ports defined - {% if perms.dcim.add_powerport %} - - {% endif %} - - + {% if device.device_type.power_port_templates.exists %} + + + No power ports defined + {% if perms.dcim.add_powerport %} + + {% endif %} + + + {% endif %} {% endfor %} {% if perms.dcim.add_interface or perms.dcim.add_consoleport or perms.dcim.add_powerport %}