mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 09:16:10 -06:00
Standardize usage of inc/panel_table.html
This commit is contained in:
parent
459997ec5c
commit
4d329a7c9b
@ -714,7 +714,6 @@ class IPAddressView(generic.ObjectView):
|
||||
return {
|
||||
'parent_prefixes_table': parent_prefixes_table,
|
||||
'duplicate_ips_table': duplicate_ips_table,
|
||||
'more_duplicate_ips': duplicate_ips.count() > 10,
|
||||
'related_ips_table': related_ips_table,
|
||||
'services': services,
|
||||
}
|
||||
|
@ -1,16 +1,14 @@
|
||||
{% load render_table from django_tables2 %}
|
||||
|
||||
<div class="card {% if panel_class %}bg-{{ panel_class }}{% endif %}">
|
||||
{% if heading %}
|
||||
<h5 class="card-header">
|
||||
{{ heading }}
|
||||
</h5>
|
||||
<div class="card {% if panel_class %}border-{{ panel_class }}{% endif %}">
|
||||
{% if heading %}
|
||||
<h5 class="card-header{% if panel_class %} text-{{ panel_class }}{% endif %}">{{ heading }}</h5>
|
||||
{% endif %}
|
||||
<div class="card-body table-responsive">
|
||||
{% if table.rows %}
|
||||
{% render_table table 'inc/table.html' %}
|
||||
{% else %}
|
||||
<div class="text-muted">None</div>
|
||||
{% endif %}
|
||||
<div class="card-body table-responsive">
|
||||
{% if table.rows %}
|
||||
{% render_table table 'inc/table.html' %}
|
||||
{% else %}
|
||||
<div class="text-muted">None</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -81,16 +81,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="card">
|
||||
<h5 class="card-header">Members</h5>
|
||||
<div class="card-body table-responsive">
|
||||
{% if members_table.rows %}
|
||||
{% render_table members_table 'inc/table.html' %}
|
||||
{% else %}
|
||||
<div class="text-muted">None</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% include 'inc/panel_table.html' with table=members_table heading='Members' %}
|
||||
{% plugin_full_width_page object %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -114,30 +114,9 @@
|
||||
<div class="col col-md-8">
|
||||
{% include 'inc/panel_table.html' with table=parent_prefixes_table heading='Parent Prefixes' %}
|
||||
{% if duplicate_ips_table.rows %}
|
||||
{# Custom version of panel_table.html #}
|
||||
<div class="card border-danger">
|
||||
<h5 class="card-header">
|
||||
<span class="text-danger">Duplicate IP Addresses</span>
|
||||
{% if more_duplicate_ips %}
|
||||
<div class="float-end">
|
||||
<a type="button" class="btn btn-primary btn-sm"
|
||||
{% if object.vrf %}
|
||||
href="{% url 'ipam:ipaddress_list' %}?address={{ object.address.ip }}&vrf_id={{ object.vrf.pk }}"
|
||||
{% else %}
|
||||
href="{% url 'ipam:ipaddress_list' %}?address={{ object.address.ip }}&vrf_id=null"
|
||||
{% endif %}
|
||||
>Show all</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</h5>
|
||||
<div class="card-body table-responsive">
|
||||
{% render_table duplicate_ips_table 'inc/table.html' %}
|
||||
</div>
|
||||
</div>
|
||||
{% include 'inc/panel_table.html' with table=duplicate_ips_table heading='Duplicate IPs' panel_class='danger' %}
|
||||
{% endif %}
|
||||
<div class="my-3">
|
||||
{% include 'inc/panel_table.html' with table=related_ips_table heading='Related IP Addresses' %}
|
||||
</div>
|
||||
{% include 'inc/panel_table.html' with table=related_ips_table heading='Related IPs' %}
|
||||
{% include 'inc/panels/services.html' %}
|
||||
{% plugin_right_page object %}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user