From ddd10ba8af5f619f485245d08bdcf1b2e82d74be Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 22 Dec 2020 16:14:16 -0500 Subject: [PATCH] Clean up hierarchical table columns --- netbox/dcim/tables/template_code.py | 11 ++++------- netbox/tenancy/tables.py | 11 ++++------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/netbox/dcim/tables/template_code.py b/netbox/dcim/tables/template_code.py index 4a5aedb29..ee1dc091b 100644 --- a/netbox/dcim/tables/template_code.py +++ b/netbox/dcim/tables/template_code.py @@ -57,13 +57,10 @@ INTERFACE_TAGGED_VLANS = """ """ MPTT_LINK = """ -{% if record.get_children %} - -{% else %} - -{% endif %} - {{ record.name }} - +{% for i in record.get_ancestors %} + +{% endfor %} +{{ record.name }} """ POWERFEED_CABLE = """ diff --git a/netbox/tenancy/tables.py b/netbox/tenancy/tables.py index 8abca2bb8..7a3d20e12 100644 --- a/netbox/tenancy/tables.py +++ b/netbox/tenancy/tables.py @@ -4,13 +4,10 @@ from utilities.tables import BaseTable, ButtonsColumn, LinkedCountColumn, TagCol from .models import Tenant, TenantGroup MPTT_LINK = """ -{% if record.get_children %} - -{% else %} - -{% endif %} - {{ record.name }} - +{% for i in record.get_ancestors %} + +{% endfor %} +{{ record.name }} """ COL_TENANT = """