From 35c7819cb63a9c481a2b612755d881d24d6586d0 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 6 Jun 2019 13:34:20 +0200 Subject: [PATCH] Remove link when there are no untagged articles --- src/Wallabag/CoreBundle/Controller/TagController.php | 4 ++-- .../CoreBundle/Resources/translations/messages.da.yml | 1 + .../CoreBundle/Resources/translations/messages.de.yml | 1 + .../CoreBundle/Resources/translations/messages.en.yml | 1 + .../CoreBundle/Resources/translations/messages.es.yml | 1 + .../CoreBundle/Resources/translations/messages.fa.yml | 1 + .../CoreBundle/Resources/translations/messages.fr.yml | 1 + .../CoreBundle/Resources/translations/messages.it.yml | 1 + .../CoreBundle/Resources/translations/messages.oc.yml | 1 + .../CoreBundle/Resources/translations/messages.pl.yml | 1 + .../CoreBundle/Resources/translations/messages.pt.yml | 1 + .../CoreBundle/Resources/translations/messages.ro.yml | 1 + .../CoreBundle/Resources/translations/messages.ru.yml | 1 + .../CoreBundle/Resources/translations/messages.th.yml | 1 + .../CoreBundle/Resources/translations/messages.tr.yml | 1 + .../Resources/views/themes/baggy/Tag/tags.html.twig | 6 +++++- .../Resources/views/themes/material/Tag/tags.html.twig | 6 +++++- 17 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index 91f34b3d..90d36d71 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -87,7 +87,7 @@ class TagController extends Controller { $tags = $this->get('wallabag_core.tag_repository') ->findAllFlatTagsWithNbEntries($this->getUser()->getId()); - $untagged = $this->get('wallabag_core.entry_repository') + $nbEntriesUntagged = $this->get('wallabag_core.entry_repository') ->countUntaggedEntriesByUser($this->getUser()->getId()); $renameForms = []; @@ -98,7 +98,7 @@ class TagController extends Controller return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [ 'tags' => $tags, 'renameForms' => $renameForms, - 'untagged' => $untagged, + 'nbEntriesUntagged' => $nbEntriesUntagged, ]); } diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index e04c2ff1..a01c7688 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -420,6 +420,7 @@ tag: list: # number_on_the_page: '{0} There is no tag.|{1} There is one tag.|]1,Inf[ There are %count% tags.' # see_untagged_entries: 'See untagged entries' + # no_untagged_entries: 'There are no untagged entries.' new: # add: 'Add' # placeholder: 'You can add several tags, separated by a comma.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 5a9668a9..a1b41855 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -411,6 +411,7 @@ tag: list: number_on_the_page: '{0} Es gibt keine Tags.|{1} Es gibt einen Tag.|]1,Inf[ Es gibt %count% Tags.' see_untagged_entries: 'Zeige nicht getaggte Einträge' + # no_untagged_entries: 'There are no untagged entries.' new: add: 'Hinzufügen' placeholder: 'Du kannst verschiedene Tags, getrennt von einem Komma, hinzufügen.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index e2994f53..020cd08a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -420,6 +420,7 @@ tag: list: number_on_the_page: '{0} There are no tags.|{1} There is one tag.|]1,Inf[ There are %count% tags.' see_untagged_entries: 'See untagged entries' + no_untagged_entries: 'There are no untagged entries.' new: add: 'Add' placeholder: 'You can add several tags, separated by a comma.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index d1ccfc81..130c12f3 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -420,6 +420,7 @@ tag: list: number_on_the_page: '{0} No hay ninguna etiqueta.|{1} Hay una etiqueta.|]1,Inf[ Hay %count% etiquetas.' see_untagged_entries: 'Ver artículos sin etiquetas' + # no_untagged_entries: 'There are no untagged entries.' new: add: 'Añadir' placeholder: 'Puedes añadir varias etiquetas, separadas por una coma.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index e5d36bd3..31db51fa 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -420,6 +420,7 @@ tag: list: number_on_the_page: '{0} هیچ برچسبی نیست.|{1} یک برچسب هست.|]1,Inf[ %count% برچسب هست.' # see_untagged_entries: 'See untagged entries' + # no_untagged_entries: 'There are no untagged entries.' new: # add: 'Add' # placeholder: 'You can add several tags, separated by a comma.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 0b1853a4..df3692dc 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -420,6 +420,7 @@ tag: list: number_on_the_page: "{0} Il n’y a pas de tag.|{1} Il y a un tag.|]1,Inf[ Il y a %count% tags." see_untagged_entries: "Voir les articles sans tag" + no_untagged_entries: 'Aucun article sans tag.' new: add: "Ajouter" placeholder: "Vous pouvez ajouter plusieurs tags, séparés par une virgule." diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 0474d2bc..337a1bfa 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -419,6 +419,7 @@ tag: list: number_on_the_page: "{0} Non ci sono etichette.|{1} C'è un'etichetta.|]1,Inf[ ci sono %count% etichette." see_untagged_entries: 'Vedi articoli non etichettati' + # no_untagged_entries: 'There are no untagged entries.' new: add: 'Aggiungi' placeholder: 'Puoi aggiungere varie etichette, separate da una virgola.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index e761832e..fc0a03b5 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -419,6 +419,7 @@ tag: list: number_on_the_page: "{0} I a pas cap d'etiquetas.|{1} I a una etiqueta.|]1,Inf[ I a %count% etiquetas." see_untagged_entries: "Afichar las entradas sens etiquetas" + # no_untagged_entries: 'There are no untagged entries.' new: add: 'Ajustar' placeholder: "Podètz ajustar mai qu'una etiqueta, separadas per de virgula." diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index f3d506e5..f9609ea2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -419,6 +419,7 @@ tag: list: number_on_the_page: '{0} Nie ma tagów.|{1} Jest jeden tag.|]1,Inf[ Są %count% tagi.' see_untagged_entries: 'Zobacz nieotagowane wpisy' + # no_untagged_entries: 'There are no untagged entries.' new: add: 'Dodaj' placeholder: 'Możesz dodać kilka tagów, oddzielając je przecinkami.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 6ddc1fc1..e9d3a6cf 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -419,6 +419,7 @@ tag: list: number_on_the_page: '{0} Não existem tags.|{1} Uma tag.|]1,Inf[ Existem %count% tags.' see_untagged_entries: 'Ver entradas sem tags' + # no_untagged_entries: 'There are no untagged entries.' new: # add: 'Add' # placeholder: 'You can add several tags, separated by a comma.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 8c0791f0..dde0c9a1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -419,6 +419,7 @@ tag: list: # number_on_the_page: '{0} There is no tag.|{1} There is one tag.|]1,Inf[ There are %count% tags.' # see_untagged_entries: 'See untagged entries' + # no_untagged_entries: 'There are no untagged entries.' new: # add: 'Add' # placeholder: 'You can add several tags, separated by a comma.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index 2ee2d83a..8dcba74b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -407,6 +407,7 @@ tag: list: number_on_the_page: '{0} Теги не найдены.|{1} Найден один тег.|]1,Inf[ Найдено %count% тегов.' see_untagged_entries: 'Просмотреть записи без тегов' + # no_untagged_entries: 'There are no untagged entries.' new: add: 'Добавить' placeholder: 'Вы можете добавить несколько тегов, разделенных запятой.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 967ae427..8dc65dd6 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -417,6 +417,7 @@ tag: list: number_on_the_page: '{0} ไม่มีการแท็ก|{1} มีหนึ่งแท็ก|]1,Inf[ มี %count% แท็ก' see_untagged_entries: 'พบรายการที่ไม่ได้แท็ก' + # no_untagged_entries: 'There are no untagged entries.' new: add: 'เพิ่ม' placeholder: 'คุณสามารถเพิ่มได้หลายแท็ก, จากการแบ่งโดย comma' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 2f86f25d..49ebe79f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -417,6 +417,7 @@ tag: list: number_on_the_page: '{0} Herhangi bir etiket yok.|{1} Burada bir adet etiket var.|]1,Inf[ Burada %count% adet etiket var.' # see_untagged_entries: 'See untagged entries' + # no_untagged_entries: 'There are no untagged entries.' new: # add: 'Add' # placeholder: 'You can add several tags, separated by a comma.' diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig index cddd6e13..aa17b842 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig @@ -31,6 +31,10 @@
- {{ 'tag.list.see_untagged_entries'|trans }} ({{untagged}}) + {% if nbEntriesUntagged == 0 %} + {{ 'tag.list.no_untagged_entries'|trans }} + {% else %} + {{ 'tag.list.see_untagged_entries'|trans }} ({{nbEntriesUntagged}}) + {% endif %}
{% endblock %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig index 552cafc9..0a3475ef 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig @@ -34,6 +34,10 @@
- {{ 'tag.list.see_untagged_entries'|trans }} ({{untagged}}) + {% if nbEntriesUntagged == 0 %} + {{ 'tag.list.no_untagged_entries'|trans }} + {% else %} + {{ 'tag.list.see_untagged_entries'|trans }} ({{nbEntriesUntagged}}) + {% endif %}
{% endblock %} -- 2.41.0