Changelog, small changes and added missing localization strings for #556

This commit is contained in:
Bernd Bestel 2020-02-10 18:24:15 +01:00
parent c5f38689fa
commit aa787e765e
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
8 changed files with 29 additions and 13 deletions

View File

@ -12,6 +12,7 @@
- Variable ingredient amounts are now marked accordingly on the renedered recipe
- After selecting a recipe on mobile devices, the page now automatically scrolls to the recipe card
- Added the recipes base servings to be displayed on the recipe card and properly named the servings column in the recipes list/table (thanks @kriddles)
- Added that recipe ingredients can now also be displayed grouped by the products product group (additionally to the ingredient group, new option in the recipes settings / top right corner settings menu) (defaults to `false`, so no changed behavior when not configured) (thanks @kriddles)
- Fixed that when editing a recipe ingredient which had "Only check if a single unit is in stock" set, not any quantity unit could be picked and the amount stayed empty
- Fixed that when reloading the "new recipe"-page (or when it gets auto-reloaded due to "Auto reload on external changes" is enabled), for each reload a new recipe was created
- Fixed that the recipe "fullscreen card" was not correctly displayed

View File

@ -99,6 +99,9 @@ DefaultUserSetting('shopping_list_to_stock_workflow_auto_submit_when_prefilled',
DefaultUserSetting('shopping_list_show_calendar', false);
DefaultUserSetting('shopping_list_disable_auto_compact_view_on_mobile', false);
# Recipe settings
DefaultUserSetting('recipe_ingredients_group_by_product_group', false); // Group recipe ingredients by their product group
# Chores settings
DefaultUserSetting('chores_due_soon_days', 5);
@ -108,9 +111,6 @@ DefaultUserSetting('batteries_due_soon_days', 5);
# Tasks settings
DefaultUserSetting('tasks_due_soon_days', 5);
# Recipe settings
DefaultUserSetting('recipe_ingredient_display_product_group', false); // Display the product group information in the ingredient list
# If the page should be automatically reloaded when there was
# an external change
DefaultUserSetting('auto_reload_on_db_change', true);

View File

@ -1735,3 +1735,12 @@ msgstr ""
msgid "Base: %s"
msgstr ""
msgid "Recipes settings"
msgstr ""
msgid "Recipe card"
msgstr ""
msgid "Group ingredients by their product group"
msgstr ""

View File

@ -18,6 +18,7 @@ SELECT
(CASE WHEN rp.only_check_single_unit_in_stock = 1 THEN 1 ELSE rp.amount * (r.desired_servings*1.0 / r.base_servings*1.0) * (rnr.includes_servings*1.0 / CASE WHEN rnr.recipe_id != rnr.includes_recipe_id THEN rnrr.base_servings*1.0 ELSE 1 END) END / p.qu_factor_purchase_to_stock) * pcp.last_price * rp.price_factor AS costs,
CASE WHEN rnr.recipe_id = rnr.includes_recipe_id THEN 0 ELSE 1 END AS is_nested_recipe_pos,
rp.ingredient_group,
pg.name as product_group,
rp.id, -- Just a dummy id column
r.type as recipe_type,
rnr.includes_recipe_id as child_recipe_id,
@ -34,6 +35,8 @@ JOIN recipes_pos rp
ON rnr.includes_recipe_id = rp.recipe_id
JOIN products p
ON rp.product_id = p.id
LEFT JOIN product_groups pg
ON p.product_group_id = pg.id
LEFT JOIN (
SELECT product_id, SUM(amount) AS amount
FROM shopping_list
@ -63,6 +66,7 @@ SELECT
(CASE WHEN rp.only_check_single_unit_in_stock = 1 THEN 1 ELSE rp.amount * (r.desired_servings*1.0 / r.base_servings*1.0) * (rnr.includes_servings*1.0 / CASE WHEN rnr.recipe_id != rnr.includes_recipe_id THEN rnrr.base_servings*1.0 ELSE 1 END) END / p.qu_factor_purchase_to_stock) * pcp.last_price * rp.price_factor AS costs,
CASE WHEN rnr.recipe_id = rnr.includes_recipe_id THEN 0 ELSE 1 END AS is_nested_recipe_pos,
rp.ingredient_group,
pg.name as product_group,
rp.id, -- Just a dummy id column
r.type as recipe_type,
rnr.includes_recipe_id as child_recipe_id,
@ -79,6 +83,8 @@ JOIN recipes_pos rp
ON rnr.includes_recipe_id = rp.recipe_id
JOIN products p
ON rp.product_id = p.id
LEFT JOIN product_groups pg
ON p.product_group_id = pg.id
LEFT JOIN (
SELECT product_id, SUM(amount) AS amount
FROM shopping_list

View File

@ -1,4 +1,4 @@
if (BoolVal(Grocy.UserSettings.recipe_ingredient_display_product_group))
if (BoolVal(Grocy.UserSettings.recipe_ingredients_group_by_product_group))
{
$("#recipe_ingredient_display_product_group").prop("checked", true);
$("#recipe_ingredients_group_by_product_group").prop("checked", true);
}

View File

@ -395,6 +395,9 @@
@if(GROCY_FEATURE_FLAG_SHOPPINGLIST)
<a class="dropdown-item discrete-link" href="{{ $U('/shoppinglistsettings') }}"><i class="fas fa-shopping-cart"></i>&nbsp;{{ $__t('Shopping list settings') }}</a>
@endif
@if(GROCY_FEATURE_FLAG_RECIPES)
<a class="dropdown-item discrete-link" href="{{ $U('/recipessettings') }}"><i class="fas fa-cocktail"></i>&nbsp;{{ $__t('Recipes settings') }}</a>
@endif
@if(GROCY_FEATURE_FLAG_CHORES)
<a class="dropdown-item discrete-link" href="{{ $U('/choressettings') }}"><i class="fas fa-home"></i>&nbsp;{{ $__t('Chores settings') }}</a>
@endif
@ -404,9 +407,6 @@
@if(GROCY_FEATURE_FLAG_TASKS)
<a class="dropdown-item discrete-link" href="{{ $U('/taskssettings') }}"><i class="fas fa-tasks"></i>&nbsp;{{ $__t('Tasks settings') }}</a>
@endif
@if(GROCY_FEATURE_FLAG_RECIPES)
<a class="dropdown-item discrete-link" href="{{ $U('/recipessettings') }}"><i class="fas fa-cocktail"></i>&nbsp;{{ $__t('Recipes settings') }}</a>
@endif
<div class="dropdown-divider"></div>
<a class="dropdown-item discrete-link" href="{{ $U('/users') }}"><i class="fas fa-users"></i>&nbsp;{{ $__t('Manage users') }}</a>
<div class="dropdown-divider"></div>

View File

@ -201,7 +201,7 @@
@if($lastIngredientGroup != $selectedRecipePosition->ingredient_group)
<h5 class="mb-2 mt-2 ml-2"><strong>{{ $selectedRecipePosition->ingredient_group }}</strong></h5>
@endif
@if(boolval($userSettings['recipe_ingredient_display_product_group']) && $lastProductGroup != $selectedRecipePosition->product_group)
@if(boolval($userSettings['recipe_ingredients_group_by_product_group']) && $lastProductGroup != $selectedRecipePosition->product_group)
<h6 class="mb-2 mt-2 ml-4"><strong>{{ $selectedRecipePosition->product_group }}</strong></h6>
@endif
<li class="list-group-item px-0 ml-5">
@ -258,7 +258,7 @@
@if($lastIngredientGroup != $selectedRecipePosition->ingredient_group)
<h5 class="mb-2 mt-2 ml-2"><strong>{{ $selectedRecipePosition->ingredient_group }}</strong></h5>
@endif
@if(boolval($userSettings['recipe_ingredient_display_product_group']) && $lastProductGroup != $selectedRecipePosition->product_group)
@if(boolval($userSettings['recipe_ingredients_group_by_product_group']) && $lastProductGroup != $selectedRecipePosition->product_group)
<h6 class="mb-2 mt-2 ml-4"><strong>{{ $selectedRecipePosition->product_group }}</strong></h6>
@endif
<li class="list-group-item px-0 ml-5">

View File

@ -9,11 +9,11 @@
<div class="col-lg-6 col-xs-12">
<h1>@yield('title')</h1>
<h4 class="mt-2">{{ $__t('Recipe card ingredients') }}</h4>
<h4 class="mt-2">{{ $__t('Recipe card') }}</h4>
<div class="form-group">
<div class="checkbox">
<label for="recipe_ingredient_display_product_group">
<input type="checkbox" class="user-setting-control" id="recipe_ingredient_display_product_group" name="recipe_ingredient_display_product_group" data-setting-key="recipe_ingredient_display_product_group"> {{ $__t('In the recipe card ingredients, display product groups') }}
<label for="recipe_ingredients_group_by_product_group">
<input type="checkbox" class="user-setting-control" id="recipe_ingredients_group_by_product_group" data-setting-key="recipe_ingredients_group_by_product_group"> {{ $__t('Group ingredients by their product group') }}
</label>
</div>
</div>