diff --git a/localization/en/strings.php b/localization/en/strings.php index 55ce25b9..f477d5b9 100644 --- a/localization/en/strings.php +++ b/localization/en/strings.php @@ -325,5 +325,6 @@ return array( 'Show clock in header' => 'Show clock in header', 'Stock settings' => 'Stock settings', 'Shopping list to stock workflow' => 'Shopping list to stock workflow', - 'Automatically do the booking using the last price and the amount of the shopping list item, if the product has "Default best before days" set' => 'Automatically do the booking using the last price and the amount of the shopping list item, if the product has "Default best before days" set' + 'Automatically do the booking using the last price and the amount of the shopping list item, if the product has "Default best before days" set' => 'Automatically do the booking using the last price and the amount of the shopping list item, if the product has "Default best before days" set', + 'Skip' => 'Überspringen' ); diff --git a/public/viewjs/shoppinglist.js b/public/viewjs/shoppinglist.js index 293123a7..7bd6bc1c 100644 --- a/public/viewjs/shoppinglist.js +++ b/public/viewjs/shoppinglist.js @@ -149,6 +149,11 @@ $(document).on('click', '.shopping-list-stock-add-workflow-list-item-button', fu { $("#shopping-list-stock-add-workflow-purchase-item-count").removeClass("d-none"); $("#shopping-list-stock-add-workflow-purchase-item-count").text(L("Adding shopping list item #1 of #2", Grocy.ShoppingListToStockWorkflowCurrent, Grocy.ShoppingListToStockWorkflowCount)); + $("#shopping-list-stock-add-workflow-skip-button").removeClass("d-none"); + } + else + { + $("#shopping-list-stock-add-workflow-skip-button").addClass("d-none"); } }); @@ -163,6 +168,13 @@ $(document).on('click', '#add-all-items-to-stock-button', function(e) $(".shopping-list-stock-add-workflow-list-item-button").first().click(); }); +$("#shopping-list-stock-add-workflow-modal").on("hidden.bs.modal", function(e) +{ + Grocy.ShoppingListToStockWorkflowAll = false; + Grocy.ShoppingListToStockWorkflowCount = 0; + Grocy.ShoppingListToStockWorkflowCurrent = 0; +}) + $(window).on("message", function(e) { var data = e.originalEvent.data; @@ -196,6 +208,13 @@ $(window).on("message", function(e) } }); +$(document).on('click', '#shopping-list-stock-add-workflow-skip-button', function(e) +{ + e.preventDefault(); + + window.postMessage(WindowMessageBag("Ready"), Grocy.BaseUrl); +}); + function OnListItemRemoved() { if ($(".shopping-list-stock-add-workflow-list-item-button").length === 0) diff --git a/views/shoppinglist.blade.php b/views/shoppinglist.blade.php index 71a4d588..2b18debf 100644 --- a/views/shoppinglist.blade.php +++ b/views/shoppinglist.blade.php @@ -108,6 +108,7 @@