]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Add unread filter to entries pages
authorDaniel Bartram <me@danielbartram.com>
Mon, 9 May 2016 13:19:09 +0000 (14:19 +0100)
committerDaniel Bartram <me@danielbartram.com>
Mon, 9 May 2016 13:56:52 +0000 (14:56 +0100)
Add the ability to filter for unread pages in the filters menu.

13 files changed:
src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig

index cd4d349021e5be8aec4f0ca32b73be1aafc9b379..f3f848e9a6db0f667e5e80a0e9b308192a1dfc86 100644 (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']) {
index 8d3920630228b0c1dc995c23432d83dd58700562..1e58352d232342a1e1759e35a2005131af0be23f 100644 (file)
@@ -154,6 +154,7 @@ entry:
         status_label: 'Status'
         archived_label: 'Arkiveret'
         starred_label: 'Favorit'
+        unread_label: 'Ulæst'
         preview_picture_label: 'Har et vist billede'
         preview_picture_help: 'Forhåndsvis billede'
         language_label: 'Sprog'
index c7a8949296cb3efbf945f6cd312df69d30cf5bc9..512b01bc5c0496743de4fe2ec95bf8bd0d5e25a2 100644 (file)
@@ -154,6 +154,7 @@ entry:
         status_label: 'Status'
         archived_label: 'Archiviert'
         starred_label: 'Favorisiert'
+        unread_label: 'Ungelesene'
         preview_picture_label: 'Vorschaubild vorhanden'
         preview_picture_help: 'Vorschaubild'
         language_label: 'Sprache'
index 1cc424044a4c781d8358ab79eab041f03cd6bdf9..6658baa96c9ab0ca74c149cfe2d55ab7fac5eacf 100644 (file)
@@ -154,6 +154,7 @@ entry:
         status_label: 'Status'
         archived_label: 'Archived'
         starred_label: 'Starred'
+        unread_label: 'Unread'
         preview_picture_label: 'Has a preview picture'
         preview_picture_help: 'Preview picture'
         language_label: 'Language'
index e8461247c9c96b9104858dd0b04b90630c525f8b..0ae2e24330b23f7aafc276d9f5b30d864ebac68c 100644 (file)
@@ -154,6 +154,7 @@ entry:
         status_label: 'Estatus'
         archived_label: 'Archivado'
         starred_label: 'Favorito'
+        unread_label: 'Sin leer'
         preview_picture_label: 'Hay una foto'
         preview_picture_help: 'Foto de preview'
         language_label: 'Idioma'
index d34ff8ff839735462bacfc0380d43e235c679c0b..b06015435d0f3c9d35fcf8c946873e377e8115f6 100644 (file)
@@ -154,6 +154,7 @@ entry:
         status_label: 'وضعیت'
         archived_label: 'بایگانی‌شده'
         starred_label: 'برگزیده'
+        unread_label: 'خوانده‌نشده'
         preview_picture_label: 'دارای عکس پیش‌نمایش'
         preview_picture_help: 'پیش‌نمایش عکس'
         language_label: 'زبان'
index 80ba0546a9e26fac01c4e1acd3de517ad9a8ab67..954ab0c359ad42b5cc76c1294d0e58ca452e5453 100644 (file)
@@ -154,6 +154,7 @@ entry:
         status_label: 'Status'
         archived_label: 'Lus'
         starred_label: 'Favoris'
+        unread_label: 'Non lus'
         preview_picture_label: 'A une photo'
         preview_picture_help: 'Photo'
         language_label: 'Langue'
index 46f58bbf5b0e4b9f4f32b76c00a6934a123c2a2f..24b8c6e2cb0f4371fe298569c47c9d22226b0431 100644 (file)
@@ -154,6 +154,7 @@ entry:
         status_label: 'Estatus'
         archived_label: 'Legits'
         starred_label: 'Favorits'
+        unread_label: 'Pas legits'
         preview_picture_label: 'A una fotò'
         preview_picture_help: 'Fotò'
         language_label: 'Lenga'
index 292749ed68c6b980e27eef252265c7556ddf71f9..fa23f0b859ab7317a44090df7e42112b48acf0ca 100644 (file)
@@ -154,6 +154,7 @@ entry:
         status_label: 'Status'
         archived_label: 'Zarchiwizowane'
         starred_label: 'Oznaczone gwiazdką'
+        unread_label: 'Nieprzeczytane'
         preview_picture_label: 'Posiada podgląd obrazu'
         preview_picture_help: 'Podgląd obrazu'
         language_label: 'Język'
index 45040f3596e31ae5183560cf01337584d1fc9103..648ba37004dd547f7f7f9834b2757419adab3c3c 100644 (file)
@@ -154,6 +154,7 @@ entry:
         status_label: 'Status'
         archived_label: 'Arhivat'
         starred_label: 'Steluțe'
+        unread_label: 'Necitite'
         preview_picture_label: 'Are o imagine de previzualizare'
         preview_picture_help: 'Previzualizare imagine'
         language_label: 'Limbă'
index 8a095a5b119fba0ffb30f3727a295e247ace9241..0fc8d3287e08282f4a525606bcc0caeb6162a10f 100644 (file)
@@ -154,6 +154,7 @@ entry:
         status_label: 'Durum'
         archived_label: 'Arşiv'
         starred_label: 'Favori'
+        unread_label: 'Okunmayan'
         preview_picture_label: 'Resim önizlemesi varsa'
         preview_picture_help: 'Resim önizlemesi'
         language_label: 'Dil'
index a2caaebf80a9e5c4fcf51db7afcf0087f9614c2b..778625ae0338742cc32ebf955c36903ea1643e06 100644 (file)
                     {{ form_label(form.isStarred) }}
                 </div>
 
+                <div class="input-field">
+                    {{ form_widget(form.isUnread) }}
+                    {{ form_label(form.isUnread) }}
+                </div>
+
                 <div class="input-field">
                     {{ form_widget(form.previewPicture) }}
                     {{ form_label(form.previewPicture) }}
index cc4038c5803b200e4586dfae19a62c1b10f322fc..9ce5b64599cc7d2d54479728c5d585a98eae0551 100644 (file)
                     {{ form_label(form.isStarred) }}
                 </div>
 
+                <div class="input-field col s6 with-checkbox">
+                    {{ form_widget(form.isUnread) }}
+                    {{ form_label(form.isUnread) }}
+                </div>
+
                 <div class="col s12">
                     <label>{{ 'entry.filters.preview_picture_help'|trans }}</label>
                 </div>