From b7365e6722b48a30a22e5e0593a036b39b0bdd67 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 9 May 2023 11:49:31 -0400 Subject: [PATCH] Refactor IP address templates to use a base template --- netbox/ipam/views.py | 2 +- netbox/templates/ipam/ipaddress.html | 7 ------- netbox/templates/ipam/ipaddress/base.html | 8 ++++++++ .../ipaddress/{ipaddresses.html => ip_addresses.html} | 5 ++--- 4 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 netbox/templates/ipam/ipaddress/base.html rename netbox/templates/ipam/ipaddress/{ipaddresses.html => ip_addresses.html} (87%) diff --git a/netbox/ipam/views.py b/netbox/ipam/views.py index 8bb0f0221..6b19b502d 100644 --- a/netbox/ipam/views.py +++ b/netbox/ipam/views.py @@ -868,7 +868,7 @@ class IPAddressRelatedIPsView(generic.ObjectChildrenView): child_model = IPAddress table = tables.IPAddressTable filterset = filtersets.IPAddressFilterSet - template_name = 'ipam/ipaddress/ipaddresses.html' + template_name = 'ipam/ipaddress/ip_addresses.html' tab = ViewTab( label=_('Related IPs'), badge=lambda x: x.get_related_ips().count(), diff --git a/netbox/templates/ipam/ipaddress.html b/netbox/templates/ipam/ipaddress.html index ce26849de..e58ac736f 100644 --- a/netbox/templates/ipam/ipaddress.html +++ b/netbox/templates/ipam/ipaddress.html @@ -3,13 +3,6 @@ {% load plugins %} {% load render_table from django_tables2 %} -{% block breadcrumbs %} - {{ block.super }} - {% if object.vrf %} - - {% endif %} -{% endblock %} - {% block content %}
diff --git a/netbox/templates/ipam/ipaddress/base.html b/netbox/templates/ipam/ipaddress/base.html new file mode 100644 index 000000000..24cfc3748 --- /dev/null +++ b/netbox/templates/ipam/ipaddress/base.html @@ -0,0 +1,8 @@ +{% extends 'generic/object.html' %} + +{% block breadcrumbs %} + {{ block.super }} + {% if object.vrf %} + + {% endif %} +{% endblock %} diff --git a/netbox/templates/ipam/ipaddress/ipaddresses.html b/netbox/templates/ipam/ipaddress/ip_addresses.html similarity index 87% rename from netbox/templates/ipam/ipaddress/ipaddresses.html rename to netbox/templates/ipam/ipaddress/ip_addresses.html index bfa110ffc..7034329aa 100644 --- a/netbox/templates/ipam/ipaddress/ipaddresses.html +++ b/netbox/templates/ipam/ipaddress/ip_addresses.html @@ -1,5 +1,4 @@ -{% extends 'generic/object.html' %} - +{% extends 'ipam/ipaddress/base.html' %} {% load helpers %} {% block content %} @@ -17,4 +16,4 @@ {% block modals %} {{ block.super }} {% table_config_form table %} -{% endblock modals %} \ No newline at end of file +{% endblock modals %}