From a3bcd60a378946a68e67a3b609d7ef126b014ee6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 12 Sep 2015 17:08:12 +0200 Subject: [PATCH] filter for entries with previewPicture --- src/Wallabag/CoreBundle/Filter/EntryFilterType.php | 11 +++++++++-- .../views/themes/material/Entry/entries.html.twig | 6 ++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php index 85d1a061..c0b89196 100644 --- a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php @@ -39,10 +39,17 @@ class EntryFilterType extends AbstractType $expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->literal('%'.$value.'%')); return $filterQuery->createCondition($expression); - }, + }, )) ->add('isArchived', 'filter_checkbox') - ->add('isStarred', 'filter_checkbox'); + ->add('isStarred', 'filter_checkbox') + ->add('previewPicture', 'filter_checkbox', array( + 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { + $expression = $filterQuery->getExpr()->isNotNull($field); + + return $filterQuery->createCondition($expression); + }, + )); } public function getName() diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig index 3711f6e5..9a2442a0 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig @@ -71,6 +71,12 @@
+ +
+ {{ form_widget(form.previewPicture) }} + +
+
{{ form_widget(form.isArchived) }} -- 2.41.0