aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
diff options
context:
space:
mode:
authorDaniel Bartram <me@danielbartram.com>2016-05-09 14:19:09 +0100
committerDaniel Bartram <me@danielbartram.com>2016-05-09 14:56:52 +0100
commit733b2cf19b5d5a93617f24b2447b9a30ba22d303 (patch)
treebba432528d830b96aff7def157308fde0d5890ad /src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
parentb1fcd47a5c7992fdfc907a8f8f1aab5fd98e7c6a (diff)
downloadwallabag-733b2cf19b5d5a93617f24b2447b9a30ba22d303.tar.gz
wallabag-733b2cf19b5d5a93617f24b2447b9a30ba22d303.tar.zst
wallabag-733b2cf19b5d5a93617f24b2447b9a30ba22d303.zip
Add unread filter to entries pages
Add the ability to filter for unread pages in the filters menu.
Diffstat (limited to 'src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php')
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
index cd4d3490..f3f848e9 100644
--- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
@@ -87,6 +87,18 @@ class EntryFilterType extends AbstractType
87 ->add('isStarred', CheckboxFilterType::class, [ 87 ->add('isStarred', CheckboxFilterType::class, [
88 'label' => 'entry.filters.starred_label', 88 'label' => 'entry.filters.starred_label',
89 ]) 89 ])
90 ->add('isUnread', CheckboxFilterType::class, [
91 'label' => 'entry.filters.unread_label',
92 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
93 if (false === $values['value']) {
94 return;
95 }
96
97 $expression = $filterQuery->getExpr()->eq('e.isArchived', 'false');
98
99 return $filterQuery->createCondition($expression);
100 },
101 ])
90 ->add('previewPicture', CheckboxFilterType::class, [ 102 ->add('previewPicture', CheckboxFilterType::class, [
91 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { 103 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
92 if (false === $values['value']) { 104 if (false === $values['value']) {