From 5df74d77424ea67fb3a5ffeb41ae3c689849be9c Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 7 Mar 2022 11:24:02 +0100 Subject: [PATCH] extra message confirm when you want delete one lot with devices --- ereuse_devicehub/static/js/main_inventory.js | 10 ++++++++++ ereuse_devicehub/templates/inventory/device_list.html | 3 ++- ereuse_devicehub/templates/inventory/removelot.html | 5 ++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/static/js/main_inventory.js b/ereuse_devicehub/static/js/main_inventory.js index 333bf049..86c25a82 100644 --- a/ereuse_devicehub/static/js/main_inventory.js +++ b/ereuse_devicehub/static/js/main_inventory.js @@ -59,6 +59,16 @@ function deviceSelect() { } } +function removeLot() { + var devices = $(".deviceSelect"); + if (devices.length > 0) { + $("#btnRemoveLots .text-danger").show(); + } else { + $("#btnRemoveLots .text-danger").hide(); + } + $("#activeRemoveLotModal").click(); +} + function removeTag() { var devices = $(".deviceSelect").filter(':checked'); var devices_id = $.map(devices, function(x) { return $(x).attr('data')}); diff --git a/ereuse_devicehub/templates/inventory/device_list.html b/ereuse_devicehub/templates/inventory/device_list.html index bb01f389..4736f1a1 100644 --- a/ereuse_devicehub/templates/inventory/device_list.html +++ b/ereuse_devicehub/templates/inventory/device_list.html @@ -38,7 +38,8 @@
{% if lot and lot.is_temporary %} - + + Remove Lot diff --git a/ereuse_devicehub/templates/inventory/removelot.html b/ereuse_devicehub/templates/inventory/removelot.html index 125d97d3..8e8cfb8f 100644 --- a/ereuse_devicehub/templates/inventory/removelot.html +++ b/ereuse_devicehub/templates/inventory/removelot.html @@ -9,12 +9,15 @@