diff --git a/changelog/55_UNRELEASED_2019-xx-xx.md b/changelog/55_UNRELEASED_2019-xx-xx.md index 7f708e61..9ce03268 100644 --- a/changelog/55_UNRELEASED_2019-xx-xx.md +++ b/changelog/55_UNRELEASED_2019-xx-xx.md @@ -20,6 +20,7 @@ ### Shopping list improvements/fixes - Added a compact view to have better shopping list for shopping trips (new button "Compact view" in the header, additionally this is automatically enabled on mobile devices / when screen width is < 768 px) +- It's now possible to filter for only undone (not striked through) items (new option in the "Filter by status" dropdown) - Fixed that when `FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS` was set to `false`, the shopping list appeared empty after some actions ### Recipe improvements diff --git a/localization/strings.pot b/localization/strings.pot index cff66011..bf238383 100644 --- a/localization/strings.pot +++ b/localization/strings.pot @@ -1648,3 +1648,6 @@ msgstr "" msgid "Normal view" msgstr "" + +msgid "Only undone items" +msgstr "" diff --git a/public/viewjs/shoppinglist.js b/public/viewjs/shoppinglist.js index 27aa188e..fb7986d1 100644 --- a/public/viewjs/shoppinglist.js +++ b/public/viewjs/shoppinglist.js @@ -282,6 +282,20 @@ $(document).on('click', '.order-listitem-button', function(e) console.error(xhr); } ); + + + var statusInfoCell = $("#shoppinglistitem-" + listItemId + "-status-info"); + if (done == 1) + { + statusInfoCell.text(statusInfoCell.text().replace("xxUNDONExx", "")); + } + else + { + statusInfoCell.text(statusInfoCell.text() + " xxUNDONExx"); + } + shoppingListTable.rows().invalidate().draw(false); + + $("#status-filter").trigger("change"); }); function OnListItemRemoved() diff --git a/views/shoppinglist.blade.php b/views/shoppinglist.blade.php index 32f47c0c..80dbe994 100644 --- a/views/shoppinglist.blade.php +++ b/views/shoppinglist.blade.php @@ -83,6 +83,7 @@ @@ -135,8 +136,9 @@ @if(!empty(FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->product_group_id)) {{ FindObjectInArrayByPropertyValue($productGroups, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->product_group_id)->name }} @else {{ $__t('Ungrouped') }} @endif - + @if(FindObjectInArrayByPropertyValue($missingProducts, 'id', $listItem->product_id) !== null) belowminstockamount @endif + @if($listItem->done != 1) xxUNDONExx @endif @include('components.userfields_tbody', array(