diff --git a/netbox/ipam/tables.py b/netbox/ipam/tables.py index 562713f5b..2283dd5d4 100644 --- a/netbox/ipam/tables.py +++ b/netbox/ipam/tables.py @@ -48,13 +48,23 @@ PREFIX_LINK = """ {% else %} {% endif %} - {{ record.prefix }} + +{% if record.description %} +{{ record.prefix }} - {{ record.description }} +{% else %} +{{ record.prefix }} +{% endif %} """ PREFIX_LINK_BRIEF = """ - {{ record.prefix }} + +{% if record.description %} +{{ record.prefix }} - {{ record.description }} +{% else %} +{{ record.prefix }} +{% endif %} """ @@ -247,7 +257,7 @@ class PrefixTable(BaseTable): class Meta(BaseTable.Meta): model = Prefix - fields = ('pk', 'prefix', 'status', 'vrf', 'tenant', 'site', 'vlan', 'role', 'description') + fields = ('pk', 'prefix', 'status', 'vrf', 'tenant', 'site', 'vlan', 'role') row_attrs = { 'class': lambda record: 'success' if not record.pk else '', } diff --git a/netbox/templates/ipam/inc/prefix_header.html b/netbox/templates/ipam/inc/prefix_header.html index 6deb10e57..87356e6c5 100644 --- a/netbox/templates/ipam/inc/prefix_header.html +++ b/netbox/templates/ipam/inc/prefix_header.html @@ -41,7 +41,11 @@ {% endif %} +{% if prefix.description %} +