diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index ff20d617c..939a58266 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -15,6 +15,7 @@ * [#7089](https://github.com/netbox-community/netbox/issues/7089) - Fix ContentTypeFilterSet not filtering on q filter * [#7090](https://github.com/netbox-community/netbox/issues/7090) - Fix Cable Bulk Edit Form - allow decimal input on Length field * [#7091](https://github.com/netbox-community/netbox/issues/7091) - Ensure API requests from the UI are aware of `BASE_PATH` +* [#7092](https://github.com/netbox-community/netbox/issues/7092) - Fix missing bulk edit buttons on Prefix IP Addresses table * [#7093](https://github.com/netbox-community/netbox/issues/7093) - Multi-select custom field filters should employ exact match * [#7096](https://github.com/netbox-community/netbox/issues/7096) - Home links should honor `BASE_PATH` configuration * [#7101](https://github.com/netbox-community/netbox/issues/7101) - Enforce `MAX_PAGE_SIZE` for table and REST API pagination diff --git a/netbox/ipam/views.py b/netbox/ipam/views.py index 5151fdd20..b33947f4e 100644 --- a/netbox/ipam/views.py +++ b/netbox/ipam/views.py @@ -455,8 +455,16 @@ class PrefixIPAddressesView(generic.ObjectView): bulk_querystring = 'vrf_id={}&parent={}'.format(instance.vrf.pk if instance.vrf else '0', instance.prefix) + # Compile permissions list for rendering the object table + permissions = { + 'add': request.user.has_perm('ipam.add_ipaddress'), + 'change': request.user.has_perm('ipam.change_ipaddress'), + 'delete': request.user.has_perm('ipam.delete_ipaddress'), + } + return { 'table': table, + 'permissions': permissions, 'bulk_querystring': bulk_querystring, 'active_tab': 'ip-addresses', 'first_available_ip': instance.get_first_available_ip(), diff --git a/netbox/templates/utilities/obj_table.html b/netbox/templates/utilities/obj_table.html index ad14de48d..fdcc59fa8 100644 --- a/netbox/templates/utilities/obj_table.html +++ b/netbox/templates/utilities/obj_table.html @@ -1,40 +1,44 @@ {% load helpers %} + {% if permissions.change or permissions.delete %}
{% csrf_token %} + {% if table.paginator.num_pages > 1 %}
-
-
- {% if bulk_edit_url and permissions.change %} - - {% endif %} - {% if bulk_delete_url and permissions.delete %} - - {% endif %} -
-
- - -
+
+ {% if bulk_edit_url and permissions.change %} + + {% endif %} + {% if bulk_delete_url and permissions.delete %} + + {% endif %} +
+
+ +
{% endif %} + {% include table_template|default:'inc/responsive_table.html' %} +
{% block extra_actions %}{% endblock %} + {% if bulk_edit_url and permissions.change %} {% endif %} + {% if bulk_delete_url and permissions.delete %}
{% else %} + {% include table_template|default:'inc/responsive_table.html' %} + {% endif %} - {% include 'inc/paginator.html' with paginator=table.paginator page=table.page %} -
+ +{% include 'inc/paginator.html' with paginator=table.paginator page=table.page %}