From 692358c3436455e8a209e909a192b58f8ec38113 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 28 Feb 2022 11:19:22 +0100 Subject: [PATCH] add alert when no there are any device selected --- ereuse_devicehub/static/js/main_inventory.js | 2 ++ .../inventory/alert_export_error.html | 21 +++++++++++++++++++ .../templates/inventory/device_list.html | 2 ++ 3 files changed, 25 insertions(+) create mode 100644 ereuse_devicehub/templates/inventory/alert_export_error.html diff --git a/ereuse_devicehub/static/js/main_inventory.js b/ereuse_devicehub/static/js/main_inventory.js index 47650dcd..d790af81 100644 --- a/ereuse_devicehub/static/js/main_inventory.js +++ b/ereuse_devicehub/static/js/main_inventory.js @@ -155,5 +155,7 @@ function export_file(type_file) { if (devices_id){ var url = "/inventory/export/"+type_file+"/?ids="+devices_id; window.location.href = url; + } else { + $("#exportAlertModal").click(); } } diff --git a/ereuse_devicehub/templates/inventory/alert_export_error.html b/ereuse_devicehub/templates/inventory/alert_export_error.html new file mode 100644 index 00000000..8212a364 --- /dev/null +++ b/ereuse_devicehub/templates/inventory/alert_export_error.html @@ -0,0 +1,21 @@ + diff --git a/ereuse_devicehub/templates/inventory/device_list.html b/ereuse_devicehub/templates/inventory/device_list.html index 3ad4f69c..63395f5a 100644 --- a/ereuse_devicehub/templates/inventory/device_list.html +++ b/ereuse_devicehub/templates/inventory/device_list.html @@ -205,6 +205,7 @@ Exports +