mirror of
				https://github.com/netbox-community/netbox.git
				synced 2024-05-10 07:54:54 +00:00 
			
		
		
		
	Fixes #7072: Fix table configuration under prefix child object views
This commit is contained in:
		@@ -1,4 +1,6 @@
 | 
			
		||||
{% extends 'ipam/prefix/base.html' %}
 | 
			
		||||
{% load helpers %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
 | 
			
		||||
{% block extra_controls %}
 | 
			
		||||
  {% if perms.ipam.add_ipaddress and active_tab == 'ip-addresses' and first_available_ip %}
 | 
			
		||||
@@ -11,7 +13,13 @@
 | 
			
		||||
{% block content %}
 | 
			
		||||
  <div class="row">
 | 
			
		||||
    <div class="col col-md-12">
 | 
			
		||||
      {% include 'inc/table_controls.html' with table_modal="IPAddressTable_config" %}
 | 
			
		||||
      {% include 'utilities/obj_table.html' with heading='IP Addresses' bulk_edit_url='ipam:ipaddress_bulk_edit' bulk_delete_url='ipam:ipaddress_bulk_delete' %}
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
  {% table_config_form table table_name="IPAddressTable" %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block javascript %}
 | 
			
		||||
  <script src="{% static 'js/tableconfig.js' %}"></script>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,17 @@
 | 
			
		||||
{% extends 'ipam/prefix/base.html' %}
 | 
			
		||||
 | 
			
		||||
{% load helpers %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
  <div class="row">
 | 
			
		||||
    <div class="col col-md-12">
 | 
			
		||||
      {% include 'inc/table_controls.html' with table_modal="IPRangeTable_config" %}
 | 
			
		||||
      {% include 'utilities/obj_table.html' with heading='Child IP Ranges' bulk_edit_url='ipam:prefix_bulk_edit' bulk_delete_url='ipam:prefix_bulk_delete' parent=prefix %}
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
  {% table_config_form table table_name="IPRangeTable" %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block javascript %}
 | 
			
		||||
  <script src="{% static 'js/tableconfig.js' %}"></script>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 
 | 
			
		||||
@@ -2,20 +2,17 @@
 | 
			
		||||
{% load helpers %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
 | 
			
		||||
{% block buttons %}
 | 
			
		||||
{% block extra_controls %}
 | 
			
		||||
  {% include 'ipam/inc/toggle_available.html' %}
 | 
			
		||||
  {% if request.user.is_authenticated and table_config_form %}
 | 
			
		||||
      <button type="button" class="btn btn-default" data-toggle="modal" data-target="#PrefixDetailTable_config" title="Configure table"><i class="mdi mdi-cog"></i> Configure</button>
 | 
			
		||||
  {% endif %}
 | 
			
		||||
  {% if perms.ipam.add_prefix and active_tab == 'prefixes' and first_available_prefix %}
 | 
			
		||||
    <a href="{% url 'ipam:prefix_add' %}?prefix={{ first_available_prefix }}&vrf={{ object.vrf.pk }}&site={{ object.site.pk }}&tenant_group={{ object.tenant.group.pk }}&tenant={{ object.tenant.pk }}" class="btn btn-success">
 | 
			
		||||
    <a href="{% url 'ipam:prefix_add' %}?prefix={{ first_available_prefix }}&vrf={{ object.vrf.pk }}&site={{ object.site.pk }}&tenant_group={{ object.tenant.group.pk }}&tenant={{ object.tenant.pk }}" class="btn btn-sm btn-success">
 | 
			
		||||
      <i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add Child Prefix
 | 
			
		||||
    </a>
 | 
			
		||||
  {% endif %}
 | 
			
		||||
  {% if perms.ipam.add_ipaddress and active_tab == 'ip-addresses' and first_available_ip %}
 | 
			
		||||
    <a href="{% url 'ipam:ipaddress_add' %}?address={{ first_available_ip }}&vrf={{ object.vrf.pk }}&tenant_group={{ object.tenant.group.pk }}&tenant={{ object.tenant.pk }}" class="btn btn-success">
 | 
			
		||||
    <a href="{% url 'ipam:ipaddress_add' %}?address={{ first_available_ip }}&vrf={{ object.vrf.pk }}&tenant_group={{ object.tenant.group.pk }}&tenant={{ object.tenant.pk }}" class="btn btn-sm btn-success">
 | 
			
		||||
      <span class="mdi mdi-plus-thick" aria-hidden="true"></span>
 | 
			
		||||
      Add an IP Address
 | 
			
		||||
      Add Child IP Address
 | 
			
		||||
    </a>
 | 
			
		||||
  {% endif %}
 | 
			
		||||
  {{ block.super }}
 | 
			
		||||
@@ -24,12 +21,13 @@
 | 
			
		||||
{% block content %}
 | 
			
		||||
  <div class="row">
 | 
			
		||||
    <div class="col col-md-12">
 | 
			
		||||
      {% include 'inc/table_controls.html' with table_modal="PrefixDetailTable_config" %}
 | 
			
		||||
      {% include 'utilities/obj_table.html' with heading='Child Prefixes' bulk_edit_url='ipam:prefix_bulk_edit' bulk_delete_url='ipam:prefix_bulk_delete' parent=prefix %}
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
  {% table_config_form prefix_table table_name="PrefixDetailTable" %}
 | 
			
		||||
  {% table_config_form table table_name="PrefixDetailTable" %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block javascript %}
 | 
			
		||||
<script src="{% static 'js/tableconfig.js' %}"></script>
 | 
			
		||||
  <script src="{% static 'js/tableconfig.js' %}"></script>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user