mirror of
https://github.com/grocy/grocy.git
synced 2025-04-30 10:05:45 +00:00
Add possibility to skip items in "all shopping list items to stock workflow" (closes #116)
This commit is contained in:
parent
02163c4305
commit
5c25e91984
@ -325,5 +325,6 @@ return array(
|
|||||||
'Show clock in header' => 'Show clock in header',
|
'Show clock in header' => 'Show clock in header',
|
||||||
'Stock settings' => 'Stock settings',
|
'Stock settings' => 'Stock settings',
|
||||||
'Shopping list to stock workflow' => 'Shopping list to stock workflow',
|
'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'
|
||||||
);
|
);
|
||||||
|
@ -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").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-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-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)
|
$(window).on("message", function(e)
|
||||||
{
|
{
|
||||||
var data = e.originalEvent.data;
|
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()
|
function OnListItemRemoved()
|
||||||
{
|
{
|
||||||
if ($(".shopping-list-stock-add-workflow-list-item-button").length === 0)
|
if ($(".shopping-list-stock-add-workflow-list-item-button").length === 0)
|
||||||
|
@ -108,6 +108,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<span id="shopping-list-stock-add-workflow-purchase-item-count" class="d-none mr-auto"></span>
|
<span id="shopping-list-stock-add-workflow-purchase-item-count" class="d-none mr-auto"></span>
|
||||||
|
<button id="shopping-list-stock-add-workflow-skip-button" type="button" class="btn btn-primary"><i class="fas fa-angle-double-right"></i> {{ $L('Skip') }}</button>
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ $L('Close') }}</button>
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ $L('Close') }}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user