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 %}