Refactor IP address templates to use a base template

This commit is contained in:
jeremystretch 2023-05-09 11:49:31 -04:00
parent 235342eed9
commit b7365e6722
4 changed files with 11 additions and 11 deletions

View File

@ -868,7 +868,7 @@ class IPAddressRelatedIPsView(generic.ObjectChildrenView):
child_model = IPAddress child_model = IPAddress
table = tables.IPAddressTable table = tables.IPAddressTable
filterset = filtersets.IPAddressFilterSet filterset = filtersets.IPAddressFilterSet
template_name = 'ipam/ipaddress/ipaddresses.html' template_name = 'ipam/ipaddress/ip_addresses.html'
tab = ViewTab( tab = ViewTab(
label=_('Related IPs'), label=_('Related IPs'),
badge=lambda x: x.get_related_ips().count(), badge=lambda x: x.get_related_ips().count(),

View File

@ -3,13 +3,6 @@
{% load plugins %} {% load plugins %}
{% load render_table from django_tables2 %} {% load render_table from django_tables2 %}
{% block breadcrumbs %}
{{ block.super }}
{% if object.vrf %}
<li class="breadcrumb-item"><a href="{% url 'ipam:ipaddress_list' %}?vrf_id={{ object.vrf.pk }}">{{ object.vrf }}</a></li>
{% endif %}
{% endblock %}
{% block content %} {% block content %}
<div class="row"> <div class="row">
<div class="col col-md-4"> <div class="col col-md-4">

View File

@ -0,0 +1,8 @@
{% extends 'generic/object.html' %}
{% block breadcrumbs %}
{{ block.super }}
{% if object.vrf %}
<li class="breadcrumb-item"><a href="{% url 'ipam:ipaddress_list' %}?vrf_id={{ object.vrf.pk }}">{{ object.vrf }}</a></li>
{% endif %}
{% endblock %}

View File

@ -1,5 +1,4 @@
{% extends 'generic/object.html' %} {% extends 'ipam/ipaddress/base.html' %}
{% load helpers %} {% load helpers %}
{% block content %} {% block content %}
@ -17,4 +16,4 @@
{% block modals %} {% block modals %}
{{ block.super }} {{ block.super }}
{% table_config_form table %} {% table_config_form table %}
{% endblock modals %} {% endblock modals %}