From 68b1234388b98d14ce2b40746ac34acfdfcaa239 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Mon, 27 Sep 2021 10:36:01 -0400 Subject: [PATCH] Fixes #7353: Fix bulk creation of device/VM components via list view --- docs/release-notes/version-3.0.md | 1 + netbox/templates/dcim/device_list.html | 129 +++++++++--------- .../virtualization/virtualmachine_list.html | 24 ++-- netbox/virtualization/views.py | 1 + 4 files changed, 81 insertions(+), 74 deletions(-) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index d4e0a603f..ed8a722ec 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -15,6 +15,7 @@ * [#7324](https://github.com/netbox-community/netbox/issues/7324) - Fix TypeError exception in web UI when filtering objects using single-choice filters * [#7333](https://github.com/netbox-community/netbox/issues/7333) - Prevent inadvertent deletion of prior change records when deleting objects * [#7341](https://github.com/netbox-community/netbox/issues/7341) - Fix incorrect URL in circuit breadcrumbs +* [#7353](https://github.com/netbox-community/netbox/issues/7353) - Fix bulk creation of device/VM components via list view * [#7356](https://github.com/netbox-community/netbox/issues/7356) - Fix display of model documentation when adding device components * [#7360](https://github.com/netbox-community/netbox/issues/7360) - Correct redirection URL after removing child device from device bay diff --git a/netbox/templates/dcim/device_list.html b/netbox/templates/dcim/device_list.html index 0a6f1f051..177a0fb36 100644 --- a/netbox/templates/dcim/device_list.html +++ b/netbox/templates/dcim/device_list.html @@ -1,70 +1,69 @@ {% extends 'generic/object_list.html' %} {% block bulk_buttons %} - {% if perms.dcim.change_device %} - - {% endif %} + + {% endif %} + {% if perms.dcim.add_consoleserverport %} +
  • + +
  • + {% endif %} + {% if perms.dcim.add_powerport %} +
  • + +
  • + {% endif %} + {% if perms.dcim.add_poweroutlet %} +
  • + +
  • + {% endif %} + {% if perms.dcim.add_interface %} +
  • + +
  • + {% endif %} + {% if perms.dcim.add_rearport %} +
  • + +
  • + {% endif %} + {% if perms.dcim.add_devicebay %} +
  • + +
  • + {% endif %} + {% if perms.dcim.add_inventoryitem %} +
  • + +
  • + {% endif %} + + + {% endif %} {% endblock %} diff --git a/netbox/templates/virtualization/virtualmachine_list.html b/netbox/templates/virtualization/virtualmachine_list.html index 245e55092..90c784f31 100644 --- a/netbox/templates/virtualization/virtualmachine_list.html +++ b/netbox/templates/virtualization/virtualmachine_list.html @@ -1,14 +1,20 @@ {% extends 'generic/object_list.html' %} {% block bulk_buttons %} - {% if perms.virtualization.change_virtualmachine %} -
    - +
    - {% endif %} + + {% endif %} + + + {% endif %} {% endblock %} diff --git a/netbox/virtualization/views.py b/netbox/virtualization/views.py index a8b2b8f1f..2294d2c38 100644 --- a/netbox/virtualization/views.py +++ b/netbox/virtualization/views.py @@ -506,6 +506,7 @@ class VirtualMachineBulkAddInterfaceView(generic.BulkComponentCreateView): model_form = forms.VMInterfaceForm filterset = filtersets.VirtualMachineFilterSet table = tables.VirtualMachineTable + default_return_url = 'virtualization:virtualmachine_list' def get_required_permission(self): return f'virtualization.add_vminterface'