Add unread filter to entries pages

Add the ability to filter for unread pages in the filters menu.
This commit is contained in:
Daniel Bartram
2016-05-09 14:19:09 +01:00
parent b1fcd47a5c
commit 733b2cf19b
13 changed files with 32 additions and 0 deletions

View File

@ -87,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']) {