From 4f9379a5e22783815cf7ed7c502f86ac90b26065 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 20 Sep 2017 14:44:51 -0400 Subject: [PATCH] Cleaned up device interfaces/IPs table --- netbox/project-static/css/base.css | 13 ++-- netbox/templates/dcim/inc/interface.html | 88 ++++++++++++++---------- 2 files changed, 58 insertions(+), 43 deletions(-) diff --git a/netbox/project-static/css/base.css b/netbox/project-static/css/base.css index 0f6b24077..b013aab97 100644 --- a/netbox/project-static/css/base.css +++ b/netbox/project-static/css/base.css @@ -329,13 +329,14 @@ li.occupied + li.available { } /* Devices */ -table.component-list tr.ipaddress td { - background-color: #eeffff; - padding-bottom: 4px; - padding-top: 4px; +table.component-list td.subtable { + padding: 0; + padding-left: 16px; } -table.component-list tr.ipaddress:hover td { - background-color: #e6f7f7; +table.component-list td.subtable td { + border: none; + padding-bottom: 6px; + padding-top: 6px; } /* AJAX loader */ diff --git a/netbox/templates/dcim/inc/interface.html b/netbox/templates/dcim/inc/interface.html index 75d0f027d..3845c8759 100644 --- a/netbox/templates/dcim/inc/interface.html +++ b/netbox/templates/dcim/inc/interface.html @@ -1,4 +1,4 @@ - + {% if selectable and perms.dcim.change_interface or perms.dcim.delete_interface %} @@ -113,41 +113,55 @@ {% endif %} -{% for ip in iface.ip_addresses.all %} - - {% if selectable and perms.dcim.change_interface or perms.dcim.delete_interface %} - - {% endif %} - - {{ ip }} - {% if ip.description %} - - {% endif %} - {% if device.primary_ip4 == ip or device.primary_ip6 == ip %} - Primary - {% endif %} - - - {% if ip.vrf %} - {{ ip.vrf }} +{% with iface.ip_addresses.all as ipaddresses %} + {% if ipaddresses %} + + {% if selectable and perms.dcim.change_interface or perms.dcim.delete_interface %} + + {% else %} - Global + {% endif %} - - - {{ ip.get_status_display }} - - - {% if perms.ipam.change_ipaddress %} - - - - {% endif %} - {% if perms.ipam.delete_ipaddress %} - - - - {% endif %} - - -{% endfor %} + + {% for ip in ipaddresses %} + + + + + + + + {% endfor %} +
+ {{ ip }} + {% if ip.description %} + + {% endif %} + + {% if device.primary_ip4 == ip or device.primary_ip6 == ip %} + Primary + {% endif %} + + {% if ip.vrf %} + {{ ip.vrf }} + {% else %} + Global table + {% endif %} + + {{ ip.get_status_display }} + + {% if perms.ipam.change_ipaddress %} + + + + {% endif %} + {% if perms.ipam.delete_ipaddress %} + + + + {% endif %} +
+ + + {% endif %} +{% endwith %}