From: Nicolas LÅ“uillet Date: Sat, 12 Sep 2015 15:08:12 +0000 (+0200) Subject: filter for entries with previewPicture X-Git-Tag: 2.0.0-alpha.0~3^2~2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=a3bcd60a378946a68e67a3b609d7ef126b014ee6;p=github%2Fwallabag%2Fwallabag.git filter for entries with previewPicture --- 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) }}