aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag')
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php12
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.da.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.de.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.en.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.es.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig5
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig5
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php18
14 files changed, 50 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
index cd4d3490..f3f848e9 100644
--- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
@@ -87,6 +87,18 @@ class EntryFilterType extends AbstractType
87 ->add('isStarred', CheckboxFilterType::class, [ 87 ->add('isStarred', CheckboxFilterType::class, [
88 'label' => 'entry.filters.starred_label', 88 'label' => 'entry.filters.starred_label',
89 ]) 89 ])
90 ->add('isUnread', CheckboxFilterType::class, [
91 'label' => 'entry.filters.unread_label',
92 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
93 if (false === $values['value']) {
94 return;
95 }
96
97 $expression = $filterQuery->getExpr()->eq('e.isArchived', 'false');
98
99 return $filterQuery->createCondition($expression);
100 },
101 ])
90 ->add('previewPicture', CheckboxFilterType::class, [ 102 ->add('previewPicture', CheckboxFilterType::class, [
91 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { 103 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
92 if (false === $values['value']) { 104 if (false === $values['value']) {
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
index 0c2a3249..213d5790 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'Status' 154 status_label: 'Status'
155 archived_label: 'Arkiveret' 155 archived_label: 'Arkiveret'
156 starred_label: 'Favorit' 156 starred_label: 'Favorit'
157 unread_label: 'Ulæst'
157 preview_picture_label: 'Har et vist billede' 158 preview_picture_label: 'Har et vist billede'
158 preview_picture_help: 'Forhåndsvis billede' 159 preview_picture_help: 'Forhåndsvis billede'
159 language_label: 'Sprog' 160 language_label: 'Sprog'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
index b28b3b04..89cbbbf8 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'Status' 154 status_label: 'Status'
155 archived_label: 'Archiviert' 155 archived_label: 'Archiviert'
156 starred_label: 'Favorisiert' 156 starred_label: 'Favorisiert'
157 unread_label: 'Ungelesene'
157 preview_picture_label: 'Vorschaubild vorhanden' 158 preview_picture_label: 'Vorschaubild vorhanden'
158 preview_picture_help: 'Vorschaubild' 159 preview_picture_help: 'Vorschaubild'
159 language_label: 'Sprache' 160 language_label: 'Sprache'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
index ec560559..b65e4522 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'Status' 154 status_label: 'Status'
155 archived_label: 'Archived' 155 archived_label: 'Archived'
156 starred_label: 'Starred' 156 starred_label: 'Starred'
157 unread_label: 'Unread'
157 preview_picture_label: 'Has a preview picture' 158 preview_picture_label: 'Has a preview picture'
158 preview_picture_help: 'Preview picture' 159 preview_picture_help: 'Preview picture'
159 language_label: 'Language' 160 language_label: 'Language'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
index 11358d8e..8351bcf4 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'Estatus' 154 status_label: 'Estatus'
155 archived_label: 'Archivado' 155 archived_label: 'Archivado'
156 starred_label: 'Favorito' 156 starred_label: 'Favorito'
157 unread_label: 'Sin leer'
157 preview_picture_label: 'Hay una foto' 158 preview_picture_label: 'Hay una foto'
158 preview_picture_help: 'Foto de preview' 159 preview_picture_help: 'Foto de preview'
159 language_label: 'Idioma' 160 language_label: 'Idioma'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
index 92b4dabe..db6e5960 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'وضعیت' 154 status_label: 'وضعیت'
155 archived_label: 'بایگانی‌شده' 155 archived_label: 'بایگانی‌شده'
156 starred_label: 'برگزیده' 156 starred_label: 'برگزیده'
157 unread_label: 'خوانده‌نشده'
157 preview_picture_label: 'دارای عکس پیش‌نمایش' 158 preview_picture_label: 'دارای عکس پیش‌نمایش'
158 preview_picture_help: 'پیش‌نمایش عکس' 159 preview_picture_help: 'پیش‌نمایش عکس'
159 language_label: 'زبان' 160 language_label: 'زبان'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
index 84e3a5fc..9fc8ca2a 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'Status' 154 status_label: 'Status'
155 archived_label: 'Lus' 155 archived_label: 'Lus'
156 starred_label: 'Favoris' 156 starred_label: 'Favoris'
157 unread_label: 'Non lus'
157 preview_picture_label: 'A une photo' 158 preview_picture_label: 'A une photo'
158 preview_picture_help: 'Photo' 159 preview_picture_help: 'Photo'
159 language_label: 'Langue' 160 language_label: 'Langue'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
index 70e4342c..c81c852b 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'Estatus' 154 status_label: 'Estatus'
155 archived_label: 'Legits' 155 archived_label: 'Legits'
156 starred_label: 'Favorits' 156 starred_label: 'Favorits'
157 unread_label: 'Pas legits'
157 preview_picture_label: 'A una fotò' 158 preview_picture_label: 'A una fotò'
158 preview_picture_help: 'Fotò' 159 preview_picture_help: 'Fotò'
159 language_label: 'Lenga' 160 language_label: 'Lenga'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
index dd2dce5d..3707a857 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'Status' 154 status_label: 'Status'
155 archived_label: 'Zarchiwizowane' 155 archived_label: 'Zarchiwizowane'
156 starred_label: 'Oznaczone gwiazdką' 156 starred_label: 'Oznaczone gwiazdką'
157 unread_label: 'Nieprzeczytane'
157 preview_picture_label: 'Posiada podgląd obrazu' 158 preview_picture_label: 'Posiada podgląd obrazu'
158 preview_picture_help: 'Podgląd obrazu' 159 preview_picture_help: 'Podgląd obrazu'
159 language_label: 'Język' 160 language_label: 'Język'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
index a3a09f4c..27be1edc 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'Status' 154 status_label: 'Status'
155 archived_label: 'Arhivat' 155 archived_label: 'Arhivat'
156 starred_label: 'Steluțe' 156 starred_label: 'Steluțe'
157 unread_label: 'Necitite'
157 preview_picture_label: 'Are o imagine de previzualizare' 158 preview_picture_label: 'Are o imagine de previzualizare'
158 preview_picture_help: 'Previzualizare imagine' 159 preview_picture_help: 'Previzualizare imagine'
159 language_label: 'Limbă' 160 language_label: 'Limbă'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
index bc502a2b..85ee7316 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'Durum' 154 status_label: 'Durum'
155 archived_label: 'Arşiv' 155 archived_label: 'Arşiv'
156 starred_label: 'Favori' 156 starred_label: 'Favori'
157 unread_label: 'Okunmayan'
157 preview_picture_label: 'Resim önizlemesi varsa' 158 preview_picture_label: 'Resim önizlemesi varsa'
158 preview_picture_help: 'Resim önizlemesi' 159 preview_picture_help: 'Resim önizlemesi'
159 language_label: 'Dil' 160 language_label: 'Dil'
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
index a2caaebf..778625ae 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
@@ -54,6 +54,11 @@
54 </div> 54 </div>
55 55
56 <div class="input-field"> 56 <div class="input-field">
57 {{ form_widget(form.isUnread) }}
58 {{ form_label(form.isUnread) }}
59 </div>
60
61 <div class="input-field">
57 {{ form_widget(form.previewPicture) }} 62 {{ form_widget(form.previewPicture) }}
58 {{ form_label(form.previewPicture) }} 63 {{ form_label(form.previewPicture) }}
59 </div> 64 </div>
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 1d569226..920fa933 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
@@ -126,6 +126,11 @@
126 {{ form_label(form.isStarred) }} 126 {{ form_label(form.isStarred) }}
127 </div> 127 </div>
128 128
129 <div class="input-field col s6 with-checkbox">
130 {{ form_widget(form.isUnread) }}
131 {{ form_label(form.isUnread) }}
132 </div>
133
129 <div class="col s12"> 134 <div class="col s12">
130 <label>{{ 'entry.filters.preview_picture_help'|trans }}</label> 135 <label>{{ 'entry.filters.preview_picture_help'|trans }}</label>
131 </div> 136 </div>
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
index cbba1a57..5ce893c1 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
@@ -499,6 +499,24 @@ class EntryControllerTest extends WallabagCoreTestCase
499 $this->assertCount(1, $crawler->filter('div[class=entry]')); 499 $this->assertCount(1, $crawler->filter('div[class=entry]'));
500 } 500 }
501 501
502 public function testFilterOnUnreadStatus()
503 {
504 $this->logInAs('admin');
505 $client = $this->getClient();
506
507 $crawler = $client->request('GET', '/all/list');
508
509 $form = $crawler->filter('button[id=submit-filter]')->form();
510
511 $data = [
512 'entry_filter[isUnread]' => true,
513 ];
514
515 $crawler = $client->submit($form, $data);
516
517 $this->assertCount(4, $crawler->filter('div[class=entry]'));
518 }
519
502 public function testFilterOnCreationDate() 520 public function testFilterOnCreationDate()
503 { 521 {
504 $this->logInAs('admin'); 522 $this->logInAs('admin');