From 3b29110500c4f16012bad3829182f48241550ced Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Tue, 24 Sep 2019 10:24:47 +0200 Subject: [PATCH] Never show close buttons in modal dialogs, this is not needed --- public/js/grocy.js | 3 ++- public/viewjs/batteries.js | 1 + public/viewjs/calendar.js | 3 ++- public/viewjs/chores.js | 1 + public/viewjs/components/barcodescanner.js | 1 + public/viewjs/components/productpicker.js | 1 + public/viewjs/equipment.js | 1 + public/viewjs/locations.js | 1 + public/viewjs/manageapikeys.js | 1 + public/viewjs/mealplan.js | 2 ++ public/viewjs/productform.js | 1 + public/viewjs/productgroups.js | 1 + public/viewjs/products.js | 4 +++- public/viewjs/quantityunitform.js | 1 + public/viewjs/quantityunits.js | 1 + public/viewjs/recipeform.js | 2 ++ public/viewjs/recipes.js | 3 +++ public/viewjs/shoppinglist.js | 2 ++ public/viewjs/taskcategories.js | 1 + public/viewjs/tasks.js | 1 + public/viewjs/userentities.js | 1 + public/viewjs/userfields.js | 1 + public/viewjs/userobjects.js | 1 + public/viewjs/users.js | 1 + 24 files changed, 33 insertions(+), 3 deletions(-) diff --git a/public/js/grocy.js b/public/js/grocy.js index 96a6b9f3..8d3e725e 100644 --- a/public/js/grocy.js +++ b/public/js/grocy.js @@ -393,7 +393,8 @@ Grocy.FrontendHelpers.ShowGenericError = function(message, exception) { bootbox.alert({ title: __t('Error details'), - message: JSON.stringify(exception, null, 4) + message: JSON.stringify(exception, null, 4), + closeButton: false }); } }); diff --git a/public/viewjs/batteries.js b/public/viewjs/batteries.js index e87985c5..0b6de32e 100644 --- a/public/viewjs/batteries.js +++ b/public/viewjs/batteries.js @@ -49,6 +49,7 @@ $(document).on('click', '.battery-delete-button', function (e) className: 'btn-danger' } }, + closeButton: false, callback: function(result) { if (result === true) diff --git a/public/viewjs/calendar.js b/public/viewjs/calendar.js index 41658afa..c4a50ef7 100644 --- a/public/viewjs/calendar.js +++ b/public/viewjs/calendar.js @@ -27,7 +27,8 @@ $("#ical-button").on("click", function(e) { bootbox.alert({ title: __t('Share/Integrate calendar (iCal)'), - message: __t('Use the following (public) URL to share or integrate the calendar in iCal format') + '' + message: __t('Use the following (public) URL to share or integrate the calendar in iCal format') + '', + closeButton: false }); }, function(xhr) diff --git a/public/viewjs/chores.js b/public/viewjs/chores.js index 88b77e68..4c28637c 100644 --- a/public/viewjs/chores.js +++ b/public/viewjs/chores.js @@ -39,6 +39,7 @@ $(document).on('click', '.chore-delete-button', function (e) bootbox.confirm({ message: __t('Are you sure to delete chore "%s"?', objectName), + closeButton: false, buttons: { confirm: { label: __t('Yes'), diff --git a/public/viewjs/components/barcodescanner.js b/public/viewjs/components/barcodescanner.js index ea6c266b..45a9203e 100644 --- a/public/viewjs/components/barcodescanner.js +++ b/public/viewjs/components/barcodescanner.js @@ -145,6 +145,7 @@ $(document).on("click", "#barcodescanner-start-button", function(e) }, size: 'big', backdrop: true, + closeButton: false, buttons: { cancel: { label: __t('Cancel'), diff --git a/public/viewjs/components/productpicker.js b/public/viewjs/components/productpicker.js index 165a17ea..6d804bfb 100644 --- a/public/viewjs/components/productpicker.js +++ b/public/viewjs/components/productpicker.js @@ -169,6 +169,7 @@ $('#product_id_text_input').on('blur', function(e) }, size: 'large', backdrop: true, + closeButton: false, buttons: { cancel: { label: __t('Cancel'), diff --git a/public/viewjs/equipment.js b/public/viewjs/equipment.js index 68fc95ea..7d376510 100644 --- a/public/viewjs/equipment.js +++ b/public/viewjs/equipment.js @@ -87,6 +87,7 @@ $(document).on('click', '.equipment-delete-button', function (e) bootbox.confirm({ message: __t('Are you sure to delete equipment "%s"?', objectName), + closeButton: false, buttons: { confirm: { label: __t('Yes'), diff --git a/public/viewjs/locations.js b/public/viewjs/locations.js index 25cec28e..c34b2917 100644 --- a/public/viewjs/locations.js +++ b/public/viewjs/locations.js @@ -39,6 +39,7 @@ $(document).on('click', '.location-delete-button', function (e) bootbox.confirm({ message: __t('Are you sure to delete location "%s"?', objectName), + closeButton: false, buttons: { confirm: { label: __t('Yes'), diff --git a/public/viewjs/manageapikeys.js b/public/viewjs/manageapikeys.js index ef5f7f86..87bcc489 100644 --- a/public/viewjs/manageapikeys.js +++ b/public/viewjs/manageapikeys.js @@ -45,6 +45,7 @@ $(document).on('click', '.apikey-delete-button', function (e) bootbox.confirm({ message: __t('Are you sure to delete API key "%s"?', objectName), + closeButton: false, buttons: { confirm: { label: __t('Yes'), diff --git a/public/viewjs/mealplan.js b/public/viewjs/mealplan.js index b25bb34e..240d502c 100644 --- a/public/viewjs/mealplan.js +++ b/public/viewjs/mealplan.js @@ -219,6 +219,7 @@ $(document).on('click', '.recipe-order-missing-button', function(e) bootbox.confirm({ message: __t('Are you sure to put all missing ingredients for recipe "%s" on the shopping list?', objectName), + closeButton: false, buttons: { confirm: { label: __t('Yes'), @@ -266,6 +267,7 @@ $(document).on('click', '.recipe-consume-button', function(e) bootbox.confirm({ message: __t('Are you sure to consume all ingredients needed by recipe "%s" (ingredients marked with "check only if a single unit is in stock" will be ignored)?', objectName), + closeButton: false, buttons: { confirm: { label: __t('Yes'), diff --git a/public/viewjs/productform.js b/public/viewjs/productform.js index e1683f20..3df99660 100644 --- a/public/viewjs/productform.js +++ b/public/viewjs/productform.js @@ -376,6 +376,7 @@ $(document).on('click', '.qu-conversion-delete-button', function(e) bootbox.confirm({ message: __t('Are you sure to remove this conversion?'), + closeButton: false, buttons: { confirm: { label: __t('Yes'), diff --git a/public/viewjs/productgroups.js b/public/viewjs/productgroups.js index 61941c56..eedfb88b 100644 --- a/public/viewjs/productgroups.js +++ b/public/viewjs/productgroups.js @@ -39,6 +39,7 @@ $(document).on('click', '.product-group-delete-button', function(e) bootbox.confirm({ message: __t('Are you sure to delete product group "%s"?', objectName), + closeButton: false, buttons: { confirm: { label: __t('Yes'), diff --git a/public/viewjs/products.js b/public/viewjs/products.js index ed4660e2..9eb97d66 100644 --- a/public/viewjs/products.js +++ b/public/viewjs/products.js @@ -63,6 +63,7 @@ $(document).on('click', '.product-delete-button', function (e) { bootbox.confirm({ message: __t('Are you sure to delete product "%s"?', objectName), + closeButton: false, buttons: { confirm: { label: __t('Yes'), @@ -95,7 +96,8 @@ $(document).on('click', '.product-delete-button', function (e) { bootbox.alert({ title: __t('Delete not possible'), - message: __t('This product cannot be deleted because it is in stock, please remove the stock amount first.') + '

' + __t('Stock amount') + ': ' + stockAmount + ' ' + __n(stockAmount, productDetails.quantity_unit_stock.name, productDetails.quantity_unit_stock.name_plural) + message: __t('This product cannot be deleted because it is in stock, please remove the stock amount first.') + '

' + __t('Stock amount') + ': ' + stockAmount + ' ' + __n(stockAmount, productDetails.quantity_unit_stock.name, productDetails.quantity_unit_stock.name_plural), + closeButton: false }); } }, diff --git a/public/viewjs/quantityunitform.js b/public/viewjs/quantityunitform.js index e0308232..ddb29f0a 100644 --- a/public/viewjs/quantityunitform.js +++ b/public/viewjs/quantityunitform.js @@ -147,6 +147,7 @@ $(document).on('click', '.qu-conversion-delete-button', function(e) bootbox.confirm({ message: __t('Are you sure to remove this conversion?'), + closeButton: false, buttons: { confirm: { label: __t('Yes'), diff --git a/public/viewjs/quantityunits.js b/public/viewjs/quantityunits.js index 6346eb56..fd66b740 100644 --- a/public/viewjs/quantityunits.js +++ b/public/viewjs/quantityunits.js @@ -39,6 +39,7 @@ $(document).on('click', '.quantityunit-delete-button', function (e) bootbox.confirm({ message: __t('Are you sure to delete quantity unit "%s"?', objectName), + closeButton: false, buttons: { confirm: { label: 'Yes', diff --git a/public/viewjs/recipeform.js b/public/viewjs/recipeform.js index afb825e1..2dc8f1ef 100644 --- a/public/viewjs/recipeform.js +++ b/public/viewjs/recipeform.js @@ -144,6 +144,7 @@ $(document).on('click', '.recipe-pos-delete-button', function(e) bootbox.confirm({ message: __t('Are you sure to delete recipe ingredient "%s"?', objectName), + closeButton: false, buttons: { confirm: { label: __t('Yes'), @@ -181,6 +182,7 @@ $(document).on('click', '.recipe-include-delete-button', function(e) bootbox.confirm({ message: __t('Are you sure to remove included recipe "%s"?', objectName), + closeButton: false, buttons: { confirm: { label: __t('Yes'), diff --git a/public/viewjs/recipes.js b/public/viewjs/recipes.js index 5dbfddac..64f0b502 100644 --- a/public/viewjs/recipes.js +++ b/public/viewjs/recipes.js @@ -90,6 +90,7 @@ $("#selectedRecipeDeleteButton").on('click', function(e) bootbox.confirm({ message: __t('Are you sure to delete recipe "%s"?', objectName), + closeButton: false, buttons: { confirm: { label: __t('Yes'), @@ -126,6 +127,7 @@ $(document).on('click', '.recipe-order-missing-button', function(e) bootbox.confirm({ message: __t('Are you sure to put all missing ingredients for recipe "%s" on the shopping list?', objectName) + "

" + __t("Uncheck ingredients to not put them on the shopping list") + ":" + $("#missing-recipe-pos-list")[0].outerHTML.replace("d-none", ""), + closeButton: false, buttons: { confirm: { label: __t('Yes'), @@ -171,6 +173,7 @@ $("#selectedRecipeConsumeButton").on('click', function(e) bootbox.confirm({ message: __t('Are you sure to consume all ingredients needed by recipe "%s" (ingredients marked with "check only if a single unit is in stock" will be ignored)?', objectName), + closeButton: false, buttons: { confirm: { label: __t('Yes'), diff --git a/public/viewjs/shoppinglist.js b/public/viewjs/shoppinglist.js index ce3d962a..df574cc3 100644 --- a/public/viewjs/shoppinglist.js +++ b/public/viewjs/shoppinglist.js @@ -71,6 +71,7 @@ $("#delete-selected-shopping-list").on("click", function() bootbox.confirm({ message: __t('Are you sure to delete shopping list "%s"?', objectName), + closeButton: false, buttons: { confirm: { label: __t('Yes'), @@ -143,6 +144,7 @@ $(document).on('click', '#clear-shopping-list', function(e) { bootbox.confirm({ message: __t('Are you sure to empty shopping list "%s"?', $("#selected-shopping-list option:selected").text()), + closeButton: false, buttons: { confirm: { label: __t('Yes'), diff --git a/public/viewjs/taskcategories.js b/public/viewjs/taskcategories.js index dc852475..197facf4 100644 --- a/public/viewjs/taskcategories.js +++ b/public/viewjs/taskcategories.js @@ -39,6 +39,7 @@ $(document).on('click', '.task-category-delete-button', function (e) bootbox.confirm({ message: __t('Are you sure to delete task category "%s"?', objectName), + closeButton: false, buttons: { confirm: { label: __t('Yes'), diff --git a/public/viewjs/tasks.js b/public/viewjs/tasks.js index 1395fcc6..58e0391e 100644 --- a/public/viewjs/tasks.js +++ b/public/viewjs/tasks.js @@ -137,6 +137,7 @@ $(document).on('click', '.delete-task-button', function (e) bootbox.confirm({ message: __t('Are you sure to delete task "%s"?', objectName), + closeButton: false, buttons: { confirm: { label: __t('Yes'), diff --git a/public/viewjs/userentities.js b/public/viewjs/userentities.js index cb320477..417933b1 100644 --- a/public/viewjs/userentities.js +++ b/public/viewjs/userentities.js @@ -39,6 +39,7 @@ $(document).on('click', '.userentity-delete-button', function (e) bootbox.confirm({ message: __t('Are you sure to delete userentity "%s"?', objectName), + closeButton: false, buttons: { confirm: { label: __t('Yes'), diff --git a/public/viewjs/userfields.js b/public/viewjs/userfields.js index a1b559e9..331755ec 100644 --- a/public/viewjs/userfields.js +++ b/public/viewjs/userfields.js @@ -51,6 +51,7 @@ $(document).on('click', '.userfield-delete-button', function (e) bootbox.confirm({ message: __t('Are you sure to delete user field "%s"?', objectName), + closeButton: false, buttons: { confirm: { label: __t('Yes'), diff --git a/public/viewjs/userobjects.js b/public/viewjs/userobjects.js index 88091b07..a51e31b5 100644 --- a/public/viewjs/userobjects.js +++ b/public/viewjs/userobjects.js @@ -38,6 +38,7 @@ $(document).on('click', '.userobject-delete-button', function (e) bootbox.confirm({ message: __t('Are you sure to delete this userobject?'), + closeButton: false, buttons: { confirm: { label: __t('Yes'), diff --git a/public/viewjs/users.js b/public/viewjs/users.js index bbc12c33..e882f5f3 100644 --- a/public/viewjs/users.js +++ b/public/viewjs/users.js @@ -39,6 +39,7 @@ $(document).on('click', '.user-delete-button', function (e) bootbox.confirm({ message: __t('Are you sure to delete user "%s"?', objectName), + closeButton: false, buttons: { confirm: { label: __t('Yes'),