aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-09-12 17:08:12 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-09-12 17:08:12 +0200
commita3bcd60a378946a68e67a3b609d7ef126b014ee6 (patch)
treeb9678878588c6bccc37a6c11c094f59f93e210ac /src
parent9c08a891f9bb90bc3f23a575a734283c1ee00ba1 (diff)
downloadwallabag-a3bcd60a378946a68e67a3b609d7ef126b014ee6.tar.gz
wallabag-a3bcd60a378946a68e67a3b609d7ef126b014ee6.tar.zst
wallabag-a3bcd60a378946a68e67a3b609d7ef126b014ee6.zip
filter for entries with previewPicture
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Filter/EntryFilterType.php11
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig6
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
39 $expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->literal('%'.$value.'%')); 39 $expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->literal('%'.$value.'%'));
40 40
41 return $filterQuery->createCondition($expression); 41 return $filterQuery->createCondition($expression);
42 }, 42 },
43 )) 43 ))
44 ->add('isArchived', 'filter_checkbox') 44 ->add('isArchived', 'filter_checkbox')
45 ->add('isStarred', 'filter_checkbox'); 45 ->add('isStarred', 'filter_checkbox')
46 ->add('previewPicture', 'filter_checkbox', array(
47 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
48 $expression = $filterQuery->getExpr()->isNotNull($field);
49
50 return $filterQuery->createCondition($expression);
51 },
52 ));
46 } 53 }
47 54
48 public function getName() 55 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 @@
71 <div class="col s12"> 71 <div class="col s12">
72 <label>{% trans %}Status{% endtrans %}</label> 72 <label>{% trans %}Status{% endtrans %}</label>
73 </div> 73 </div>
74
75 <div class="input-field col s6">
76 {{ form_widget(form.previewPicture) }}
77 <label for="entry_filter_previewPicture">{% trans %}Has a preview picture{% endtrans %}</label>
78 </div>
79
74 <div class="input-field col s6"> 80 <div class="input-field col s6">
75 {{ form_widget(form.isArchived) }} 81 {{ form_widget(form.isArchived) }}
76 <label for="entry_filter_isArchived">{% trans %}Archived{% endtrans %}</label> 82 <label for="entry_filter_isArchived">{% trans %}Archived{% endtrans %}</label>