mirror of
https://github.com/grocy/grocy.git
synced 2025-10-10 16:00:56 +00:00
Added 'category' filter to tasks view. (#2412)
* Added 'category' filter to tasks view. * Remove extraneous css attributes. * Applied code style rules * Use correct column * Task categories are not something that is translated... * Added "Uncategorized" as additional filter option --------- Co-authored-by: Bernd Bestel <bernd@berrnd.de>
This commit is contained in:
@@ -34,12 +34,25 @@ $("#status-filter").on("change", function()
|
||||
tasksTable.column(tasksTable.colReorder.transpose(5)).search(value).draw();
|
||||
});
|
||||
|
||||
$("#category-filter").on("change", function()
|
||||
{
|
||||
var value = $(this).val();
|
||||
if (value === "all")
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
|
||||
tasksTable.column(tasksTable.colReorder.transpose(3)).search(value).draw();
|
||||
});
|
||||
|
||||
$("#clear-filter-button").on("click", function()
|
||||
{
|
||||
$("#search").val("");
|
||||
$("#status-filter").val("all");
|
||||
$("#category-filter").val("all");
|
||||
$("#search").trigger("keyup");
|
||||
$("#status-filter").trigger("change");
|
||||
$("#category-filter").trigger("change");
|
||||
$("#show-done-tasks").trigger('checked', false);
|
||||
});
|
||||
|
||||
|
@@ -81,6 +81,22 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 col-xl-3">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa-solid fa-filter"></i> {{ $__t('Category') }}</span>
|
||||
</div>
|
||||
<select class="custom-control custom-select"
|
||||
id="category-filter">
|
||||
<option value="all">{{ $__t('All') }}</option>
|
||||
@foreach($taskCategories as $taskCategory)
|
||||
<option value="{{ $taskCategory->name }}">{{ $taskCategory->name }}</option>
|
||||
@endforeach
|
||||
<option class="font-italic font-weight-light"
|
||||
value="{{ $__t('Uncategorized') }}">{{ $__t('Uncategorized') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 col-xl-3">
|
||||
<div class="form-check custom-control custom-checkbox">
|
||||
<input class="form-check-input custom-control-input"
|
||||
|
Reference in New Issue
Block a user