mirror of
https://github.com/grocy/grocy.git
synced 2026-04-08 05:36: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();
|
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)
|
$(".recipe-delete").on('click', function(e)
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@
|
||||||
id="gallery">
|
id="gallery">
|
||||||
<div class="card-columns no-gutters">
|
<div class="card-columns no-gutters">
|
||||||
@foreach($recipes as $recipe)
|
@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 }}"
|
data-recipe-id="{{ $recipe->id }}"
|
||||||
href="#">
|
href="#">
|
||||||
<div id="RecipeGalleryCard-{{ $recipe->id }}"
|
<div id="RecipeGalleryCard-{{ $recipe->id }}"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user