diff --git a/netbox/ipam/tables.py b/netbox/ipam/tables.py index 963e0d58f..2ffd68c61 100644 --- a/netbox/ipam/tables.py +++ b/netbox/ipam/tables.py @@ -21,13 +21,13 @@ PREFIX_LINK = """ {% else %} {% endif %} - {{ record.prefix }} + {{ record.prefix }} """ PREFIX_LINK_BRIEF = """ - {{ record.prefix }} + {{ record.prefix }} """ diff --git a/netbox/ipam/views.py b/netbox/ipam/views.py index 205703c39..e95b1aefb 100644 --- a/netbox/ipam/views.py +++ b/netbox/ipam/views.py @@ -447,6 +447,7 @@ def prefix_add(request): else: form = PrefixForm(initial={ 'site': request.GET.get('site'), + 'vrf': request.GET.get('vrf'), 'prefix': request.GET.get('prefix'), }) diff --git a/netbox/templates/ipam/prefix.html b/netbox/templates/ipam/prefix.html index 6ed18ef29..284de4f96 100644 --- a/netbox/templates/ipam/prefix.html +++ b/netbox/templates/ipam/prefix.html @@ -86,7 +86,13 @@
- {% include 'ipam/inc/prefix_table.html' with table=child_prefix_table table_template='panel_table.html' heading='Child Prefixes' site=prefix.site %} + {% if child_prefix_table.rows %} + {% include 'ipam/inc/prefix_table.html' with table=child_prefix_table table_template='panel_table.html' heading='Child Prefixes' parent=prefix %} + {% elif prefix.new_subnet %} + + Add Child Prefix + + {% endif %}
{% endblock %}