mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 09:16:10 -06:00
Refactor IP address templates to use a base template
This commit is contained in:
parent
235342eed9
commit
b7365e6722
@ -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(),
|
||||||
|
@ -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">
|
||||||
|
8
netbox/templates/ipam/ipaddress/base.html
Normal file
8
netbox/templates/ipam/ipaddress/base.html
Normal 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 %}
|
@ -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 %}
|
Loading…
Reference in New Issue
Block a user