Make it possible to test quantity unit plural forms (closes #261)

This commit is contained in:
Bernd Bestel
2019-09-18 20:21:09 +02:00
parent 8f798a94d1
commit 346b589534
8 changed files with 127 additions and 1 deletions

View File

@@ -26,6 +26,10 @@
{
window.location.reload();
}
else if (redirectDestination == "stay")
{
// Do nothing
}
else
{
window.location.href = redirectDestination.replace("editobjectid", Grocy.EditObjectId);
@@ -50,6 +54,10 @@
{
window.location.reload();
}
else if (redirectDestination == "stay")
{
// Do nothing
}
else
{
window.location.href = redirectDestination.replace("editobjectid", Grocy.EditObjectId);
@@ -181,3 +189,22 @@ $("#qu-conversion-add-button").on("click", function(e)
Grocy.QuantityUnitEditFormRedirectUri = U("/quantityunitconversion/new?qu-unit=editobjectid");
$('#save-quantityunit-button').click();
});
$("#test-quantityunit-plural-forms-button").on("click", function(e)
{
e.preventDefault();
Grocy.QuantityUnitEditFormRedirectUri = "stay";
$("#save-quantityunit-button").click();
bootbox.alert({
message: '<iframe height="400px" class="embed-responsive" src="' + U("/quantityunitpluraltesting?embedded&qu=") + Grocy.EditObjectId.toString() + '"></iframe>',
closeButton: false,
size: "large",
callback: function(result)
{
Grocy.QuantityUnitEditFormRedirectUri = undefined;
Grocy.FrontendHelpers.EndUiBusy("quantityunit-form");
}
});
});