refactor(views/recipes): if ignore stock is enabled, never disable add-to-shopping-list button

ref https://github.com/grocy/grocy/issues/686
This commit is contained in:
9Lukas5 2026-01-25 15:49:29 +01:00
parent be8740bbb3
commit d389f0c01c
No known key found for this signature in database
GPG Key ID: 3203216F282460B6

View File

@ -340,10 +340,10 @@
data-recipe-name="{{ $recipe->name }}">
<i class="fa-solid fa-utensils"></i>
</a>
<a class="btn @if(!GROCY_FEATURE_FLAG_SHOPPINGLIST) d-none @endif recipe-shopping-list @if(FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->need_fulfilled_with_shopping_list == 1) disabled @endif"
<a class="btn @if(!GROCY_FEATURE_FLAG_SHOPPINGLIST) d-none @endif recipe-shopping-list @if(!$userSettings['recipes_ignore_stock_on_add_to_cart_checkbox'] && FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->need_fulfilled_with_shopping_list == 1) disabled @endif"
href="#"
data-toggle="tooltip"
title="{{ $__t('Put missing products on shopping list') }}"
title="@if($userSettings['recipes_ignore_stock_on_add_to_cart_checkbox']) {{ $__t('Put all recipe products on shopping list') }} @else {{ $__t('Put missing products on shopping list') }} @endif"
data-recipe-id="{{ $recipe->id }}"
data-recipe-name="{{ $recipe->name }}">
<i class="fa-solid fa-cart-plus"></i>
@ -376,10 +376,10 @@
data-recipe-name="{{ $recipe->name }}">
<i class="fa-solid fa-utensils"></i>
</a>
<a class="btn recipe-shopping-list @if(FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->need_fulfilled_with_shopping_list == 1) disabled @endif"
<a class="btn recipe-shopping-list @if(!$userSettings['recipes_ignore_stock_on_add_to_cart_checkbox'] && FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->need_fulfilled_with_shopping_list == 1) disabled @endif"
href="#"
data-toggle="tooltip"
title="{{ $__t('Put missing products on shopping list') }}"
title="@if($userSettings['recipes_ignore_stock_on_add_to_cart_checkbox']) {{ $__t('Put all recipe ingredients on shopping list') }} @else {{ $__t('Put missing products on shopping list') }} @endif"
data-recipe-id="{{ $recipe->id }}"
data-recipe-name="{{ $recipe->name }}">
<i class="fa-solid fa-cart-plus"></i>