mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 20:36:15 +02:00
Limit mealplan products dropdown based on include_in_mealplan product variable
This commit is contained in:
parent
15b4f2ede3
commit
405c3efad1
|
|
@ -169,7 +169,7 @@ class RecipesController extends BaseController
|
|||
'recipes' => $recipes,
|
||||
'internalRecipes' => $this->Database->recipes()->whereNot('type', RecipesService::RECIPE_TYPE_NORMAL)->fetchAll(),
|
||||
'recipesResolved' => $this->RecipesService->GetRecipesResolved(),
|
||||
'products' => $this->Database->products()->orderBy('name'),
|
||||
'products' => $this->Database->products()->where('include_in_mealplan', '1')->orderBy('name'),
|
||||
'quantityUnits' => $this->Database->quantity_units()->orderBy('name'),
|
||||
'quantityUnitConversionsResolved' => $this->Database->quantity_unit_conversions_resolved()
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
ALTER TABLE products
|
||||
ADD include_in_mealplan TINYINT NOT NULL DEFAULT 0;
|
||||
|
||||
ALTER TABLE products
|
||||
ADD default_best_before_days_after_freezing INTEGER NOT NULL DEFAULT 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -252,6 +252,16 @@
|
|||
<input type="hidden" name="default_best_before_days_after_thawing" value="0">
|
||||
@endif
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input type="hidden" name="include_in_mealplan" value="0">
|
||||
<input @if($mode == 'edit' && $product->include_in_mealplan == 1) checked @endif class="form-check-input" type="checkbox" id="include_in_mealplan" name="include_in_mealplan" value="1">
|
||||
<label class="form-check-label" for="include_in_mealplan">{{ $__t('Include in Mealplan') }}
|
||||
<span class="text-muted small">{{ $__t('When checked, this product is available to be added to a mealplan.') }}</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="product-picture">{{ $__t('Product picture') }}
|
||||
<span class="text-muted small">{{ $__t('If you don\'t select a file, the current picture will not be altered') }}</span>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user