Squashed commit

Optimized new chore start date handling (references #1612)
Change yearly chore schedule to be on the same day each year (closes #817)
Use the last price for out of stock ingredients (closes #779)
Make it optionally possible to show the recipes list full-width (closes #1772)
This commit is contained in:
Bernd Bestel
2022-02-09 17:48:21 +01:00
parent aaf248c1b3
commit 0d1f2ad09d
10 changed files with 248 additions and 48 deletions

View File

@@ -181,7 +181,7 @@ $('.input-group-chore-period-type').on('change', function(e)
}
else if (periodType === 'yearly')
{
$('#chore-period-type-info').attr("data-original-title", __t('This means the next execution of this chore is scheduled 1 year after the last execution'));
$('#chore-period-type-info').attr("data-original-title", __t('This means the next execution of this chore is scheduled each year on the same day (based on the start date)'));
$('#chore-period-interval-info').attr("data-original-title", __t('This means the next execution of this chore should only be scheduled every %s years', periodInterval.toString()));
}

View File

@@ -279,10 +279,33 @@ recipesTables.on('select', function(e, dt, type, indexes)
{
var selectedRecipeId = $(recipesTables.row(indexes[0]).node()).data("recipe-id");
var currentRecipeId = location.search.split('recipe=')[1];
if (selectedRecipeId.toString() !== currentRecipeId)
if (BoolVal(Grocy.UserSettings.recipes_show_list_side_by_side))
{
UpdateUriParam("recipe", selectedRecipeId.toString());
window.location.reload();
if (selectedRecipeId.toString() !== currentRecipeId)
{
UpdateUriParam("recipe", selectedRecipeId.toString());
window.location.reload();
}
}
else
{
bootbox.dialog({
message: '<iframe height="650px" class="embed-responsive" src="' + U("/recipes?embedded&recipe=") + selectedRecipeId + '#fullscreen"></iframe>',
size: 'extra-large',
backdrop: true,
closeButton: false,
buttons: {
cancel: {
label: __t('Close'),
className: 'btn-secondary responsive-button',
callback: function()
{
bootbox.hideAll();
}
}
}
});
}
}
});
@@ -291,7 +314,31 @@ $(".recipe-gallery-item").on("click", function(e)
{
e.preventDefault();
window.location.href = U('/recipes?tab=gallery&recipe=' + $(this).data("recipe-id"));
var selectedRecipeId = $(this).data("recipe-id");
if (BoolVal(Grocy.UserSettings.recipes_show_list_side_by_side))
{
window.location.href = U('/recipes?tab=gallery&recipe=' + selectedRecipeId);
}
else
{
bootbox.dialog({
message: '<iframe height="650px" class="embed-responsive" src="' + U("/recipes?embedded&recipe=") + selectedRecipeId + '#fullscreen"></iframe>',
size: 'extra-large',
backdrop: true,
closeButton: false,
buttons: {
cancel: {
label: __t('Close'),
className: 'btn-secondary responsive-button',
callback: function()
{
bootbox.hideAll();
}
}
}
});
}
});
$(".recipe-fullscreen").on('click', function(e)

View File

@@ -3,4 +3,7 @@
$("#recipe_ingredients_group_by_product_group").prop("checked", true);
}
RefreshLocaleNumberInput();
if (BoolVal(Grocy.UserSettings.recipes_show_list_side_by_side))
{
$("#recipes_show_list_side_by_side").prop("checked", true);
}