X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FForm%2FType%2FEntryFilterType.php;h=f3f848e9a6db0f667e5e80a0e9b308192a1dfc86;hb=5ecdfcd041767c9e3244a92bb0a6cc3c3f80fea3;hp=5c2216cf29cbca9f7a2deb3fdc4752244a4a898d;hpb=d8f8a5901086f243f9fa215d52baea6833e1cb55;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php index 5c2216cf..f3f848e9 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php @@ -38,6 +38,10 @@ class EntryFilterType extends AbstractType 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { $value = $values['value']; + if (null === $value['left_number'][0] || null === $value['right_number'][0]) { + return; + } + $min = (int) ($value['left_number'][0] * $this->user->getConfig()->getReadingSpeed()); $max = (int) ($value['right_number'][0] * $this->user->getConfig()->getReadingSpeed()); @@ -83,6 +87,18 @@ class EntryFilterType extends AbstractType ->add('isStarred', CheckboxFilterType::class, [ 'label' => 'entry.filters.starred_label', ]) + ->add('isUnread', CheckboxFilterType::class, [ + 'label' => 'entry.filters.unread_label', + 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { + if (false === $values['value']) { + return; + } + + $expression = $filterQuery->getExpr()->eq('e.isArchived', 'false'); + + return $filterQuery->createCondition($expression); + }, + ]) ->add('previewPicture', CheckboxFilterType::class, [ 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { if (false === $values['value']) {