mirror of
https://github.com/grocy/grocy.git
synced 2026-04-06 21:06:15 +02:00
Fixes #1005. Recipes: filter by stock-status in gallery
This commit is contained in:
parent
4b5b7bcb19
commit
557db9e07d
|
|
@ -75,6 +75,17 @@ $("#status-filter").on("change", function()
|
|||
}
|
||||
|
||||
recipesTables.column(5).search(value).draw();
|
||||
|
||||
$('.recipe-gallery-item').removeClass('d-none');
|
||||
if(value !== "")
|
||||
{
|
||||
if(value === 'enoughtinstock')
|
||||
$('.recipe-gallery-item').not('.recipe-enoughtinstock').addClass('d-none');
|
||||
if(value === 'enoughinstockwithshoppinglist')
|
||||
$('.recipe-gallery-item').not('.recipe-enoughinstockwithshoppinglist').addClass('d-none');
|
||||
if(value === 'notenoughinstock')
|
||||
$('.recipe-gallery-item').not('.recipe-notenoughinstock').addClass('d-none');
|
||||
}
|
||||
});
|
||||
|
||||
$(".recipe-delete").on('click', function(e)
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@
|
|||
id="gallery">
|
||||
<div class="card-columns no-gutters">
|
||||
@foreach($recipes as $recipe)
|
||||
<a class="discrete-link recipe-gallery-item"
|
||||
<a class="discrete-link recipe-gallery-item @if(FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->need_fulfilled == 1) recipe-enoughtinstock @elseif(FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->need_fulfilled_with_shopping_list == 1) recipe-enoughinstockwithshoppinglist @else recipe-notenoughinstock @endif"
|
||||
data-recipe-id="{{ $recipe->id }}"
|
||||
href="#">
|
||||
<div id="RecipeGalleryCard-{{ $recipe->id }}"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user