From 7c14b8d97b78c757700028ea7442321f33a74304 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 22 Mar 2022 15:29:05 -0400 Subject: [PATCH] Clean up display of tenant groups --- netbox/templates/circuits/circuit.html | 10 +++------- netbox/templates/dcim/cable.html | 10 +++------- netbox/templates/dcim/device.html | 10 +++------- netbox/templates/dcim/location.html | 18 +++++++----------- netbox/templates/dcim/rack.html | 10 +++------- netbox/templates/dcim/rackreservation.html | 10 +++------- netbox/templates/dcim/site.html | 10 +++------- netbox/templates/ipam/aggregate.html | 10 +++------- netbox/templates/ipam/asn.html | 10 +++------- netbox/templates/ipam/ipaddress.html | 10 +++------- netbox/templates/ipam/iprange.html | 10 +++------- netbox/templates/ipam/prefix.html | 10 +++------- netbox/templates/ipam/vlan.html | 10 +++------- netbox/templates/ipam/vrf.html | 7 ++++++- netbox/templates/virtualization/cluster.html | 7 ++++++- .../virtualization/virtualmachine.html | 10 +++------- 16 files changed, 58 insertions(+), 104 deletions(-) diff --git a/netbox/templates/circuits/circuit.html b/netbox/templates/circuits/circuit.html index 4f60feb47..881b6cca6 100644 --- a/netbox/templates/circuits/circuit.html +++ b/netbox/templates/circuits/circuit.html @@ -35,14 +35,10 @@ Tenant - {% if object.tenant %} - {% if object.tenant.group %} - {{ object.tenant.group|linkify }} / - {% endif %} - {{ object.tenant|linkify }} - {% else %} - None + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / {% endif %} + {{ object.tenant|linkify|placeholder }} diff --git a/netbox/templates/dcim/cable.html b/netbox/templates/dcim/cable.html index cf12ba930..f1cf986e6 100644 --- a/netbox/templates/dcim/cable.html +++ b/netbox/templates/dcim/cable.html @@ -24,14 +24,10 @@ Tenant - {% if object.tenant %} - {% if object.tenant.group %} - {{ object.tenant.group|linkify }} / - {% endif %} - {{ object.tenant|linkify }} - {% else %} - None + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / {% endif %} + {{ object.tenant|linkify|placeholder }} diff --git a/netbox/templates/dcim/device.html b/netbox/templates/dcim/device.html index dde8adee0..d075a801d 100644 --- a/netbox/templates/dcim/device.html +++ b/netbox/templates/dcim/device.html @@ -76,14 +76,10 @@ Tenant - {% if object.tenant %} - {% if object.tenant.group %} - {{ object.tenant.group|linkify }} / - {% endif %} - {{ object.tenant|linkify }} - {% else %} - None + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / {% endif %} + {{ object.tenant|linkify|placeholder }} diff --git a/netbox/templates/dcim/location.html b/netbox/templates/dcim/location.html index ca48797d0..b2b2bc4cd 100644 --- a/netbox/templates/dcim/location.html +++ b/netbox/templates/dcim/location.html @@ -44,17 +44,13 @@ {{ object.parent|linkify|placeholder }} - Tenant - - {% if object.tenant %} - {% if object.tenant.group %} - {{ object.tenant.group|linkify }} / - {% endif %} - {{ object.tenant|linkify }} - {% else %} - None - {% endif %} - + Tenant + + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / + {% endif %} + {{ object.tenant|linkify|placeholder }} + Racks diff --git a/netbox/templates/dcim/rack.html b/netbox/templates/dcim/rack.html index 2f1efad75..6574e9b74 100644 --- a/netbox/templates/dcim/rack.html +++ b/netbox/templates/dcim/rack.html @@ -64,14 +64,10 @@ Tenant - {% if object.tenant %} - {% if object.tenant.group %} - {{ object.tenant.group|linkify }} / - {% endif %} - {{ object|linkify }} - {% else %} - None + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / {% endif %} + {{ object.tenant|linkify|placeholder }} diff --git a/netbox/templates/dcim/rackreservation.html b/netbox/templates/dcim/rackreservation.html index 1464cc00c..ebdd1d845 100644 --- a/netbox/templates/dcim/rackreservation.html +++ b/netbox/templates/dcim/rackreservation.html @@ -54,14 +54,10 @@ Tenant - {% if object.tenant %} - {% if object.tenant.group %} - {{ object.tenant.group|linkify }} / - {% endif %} - {{ object.tenant|linkify }} - {% else %} - None + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / {% endif %} + {{ object.tenant|linkify|placeholder }} diff --git a/netbox/templates/dcim/site.html b/netbox/templates/dcim/site.html index acd4756d1..fe0a558eb 100644 --- a/netbox/templates/dcim/site.html +++ b/netbox/templates/dcim/site.html @@ -58,14 +58,10 @@ Tenant - {% if object.tenant %} - {% if object.tenant.group %} - {{ object.tenant.group|linkify }} / - {% endif %} - {{ object.tenant|linkify }} - {% else %} - None + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / {% endif %} + {{ object.tenant|linkify|placeholder }} diff --git a/netbox/templates/ipam/aggregate.html b/netbox/templates/ipam/aggregate.html index 2ec12284e..f3eff9df1 100644 --- a/netbox/templates/ipam/aggregate.html +++ b/netbox/templates/ipam/aggregate.html @@ -29,14 +29,10 @@ Tenant - {% if object.tenant %} - {% if prefix.object.group %} - {{ object.tenant.group|linkify }} / - {% endif %} - {{ object.tenant|linkify }} - {% else %} - None + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / {% endif %} + {{ object.tenant|linkify|placeholder }} diff --git a/netbox/templates/ipam/asn.html b/netbox/templates/ipam/asn.html index 35cfa5e64..6c092f598 100644 --- a/netbox/templates/ipam/asn.html +++ b/netbox/templates/ipam/asn.html @@ -29,14 +29,10 @@ Tenant - {% if object.tenant %} - {% if object.tenant.group %} - {{ object.tenant.group|linkify }} / - {% endif %} - {{ object.tenant|linkify }} - {% else %} - None + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / {% endif %} + {{ object.tenant|linkify|placeholder }} diff --git a/netbox/templates/ipam/ipaddress.html b/netbox/templates/ipam/ipaddress.html index 05ce7b22d..7867e829b 100644 --- a/netbox/templates/ipam/ipaddress.html +++ b/netbox/templates/ipam/ipaddress.html @@ -36,14 +36,10 @@ Tenant - {% if object.tenant %} - {% if object.tenant.group %} - {{ object.tenant.group|linkify }} / - {% endif %} - {{ object.tenant|linkify }} - {% else %} - None + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / {% endif %} + {{ object.tenant|linkify|placeholder }} diff --git a/netbox/templates/ipam/iprange.html b/netbox/templates/ipam/iprange.html index 6e27227e5..c78b5a132 100644 --- a/netbox/templates/ipam/iprange.html +++ b/netbox/templates/ipam/iprange.html @@ -54,14 +54,10 @@ Tenant - {% if object.tenant %} - {% if object.tenant.group %} - {{ object.tenant.group|linkify }} / - {% endif %} - {{ object.tenant|linkify }} - {% else %} - None + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / {% endif %} + {{ object.tenant|linkify|placeholder }} diff --git a/netbox/templates/ipam/prefix.html b/netbox/templates/ipam/prefix.html index 0c86fa196..e2ba76a82 100644 --- a/netbox/templates/ipam/prefix.html +++ b/netbox/templates/ipam/prefix.html @@ -26,16 +26,12 @@ Tenant - - {% if object.tenant %} + {% if object.tenant.group %} {{ object.tenant.group|linkify }} / {% endif %} - {{ object.tenant|linkify }} - {% else %} - None - {% endif %} - + {{ object.tenant|linkify|placeholder }} + Aggregate diff --git a/netbox/templates/ipam/vlan.html b/netbox/templates/ipam/vlan.html index ceb291cfe..f74149ad6 100644 --- a/netbox/templates/ipam/vlan.html +++ b/netbox/templates/ipam/vlan.html @@ -40,14 +40,10 @@ Tenant - {% if object.tenant %} - {% if object.tenant.group %} - {{ object.tenant.group|linkify }} / - {% endif %} - {{ object.tenant|linkify }} - {% else %} - None + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / {% endif %} + {{ object.tenant|linkify|placeholder }} diff --git a/netbox/templates/ipam/vrf.html b/netbox/templates/ipam/vrf.html index 07cf74cbb..831338600 100644 --- a/netbox/templates/ipam/vrf.html +++ b/netbox/templates/ipam/vrf.html @@ -20,7 +20,12 @@ Tenant - {{ object.tenant|linkify|placeholder }} + + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / + {% endif %} + {{ object.tenant|linkify|placeholder }} + Unique IP Space diff --git a/netbox/templates/virtualization/cluster.html b/netbox/templates/virtualization/cluster.html index 8384d352f..8acbb61f4 100644 --- a/netbox/templates/virtualization/cluster.html +++ b/netbox/templates/virtualization/cluster.html @@ -25,7 +25,12 @@ Tenant - {{ object.tenant|linkify }} + + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / + {% endif %} + {{ object.tenant|linkify|placeholder }} + Site diff --git a/netbox/templates/virtualization/virtualmachine.html b/netbox/templates/virtualization/virtualmachine.html index ccb769167..0dec4968c 100644 --- a/netbox/templates/virtualization/virtualmachine.html +++ b/netbox/templates/virtualization/virtualmachine.html @@ -32,14 +32,10 @@ Tenant - {% if object.tenant %} - {% if object.tenant.group %} - {{ object.tenant.group|linkify }} / - {% endif %} - {{ object.tenant|linkify }} - {% else %} - None + {% if object.tenant.group %} + {{ object.tenant.group|linkify }} / {% endif %} + {{ object.tenant|linkify|placeholder }}