Remove link when there are no untagged articles

This commit is contained in:
Jeremy Benoist 2019-06-06 13:34:20 +02:00
parent 0f2d24feb4
commit 35c7819cb6
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
17 changed files with 26 additions and 4 deletions

View file

@ -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,
]);
}

View file

@ -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.'

View file

@ -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.'

View file

@ -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.'

View file

@ -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.'

View file

@ -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.'

View file

@ -420,6 +420,7 @@ tag:
list:
number_on_the_page: "{0} Il ny 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."

View file

@ -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.'

View file

@ -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."

View file

@ -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.'

View file

@ -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.'

View file

@ -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.'

View file

@ -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: 'Вы можете добавить несколько тегов, разделенных запятой.'

View file

@ -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'

View file

@ -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.'

View file

@ -31,6 +31,10 @@
</ul>
<div>
<a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }} ({{untagged}})</a>
{% if nbEntriesUntagged == 0 %}
{{ 'tag.list.no_untagged_entries'|trans }}
{% else %}
<a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }} ({{nbEntriesUntagged}})</a>
{% endif %}
</div>
{% endblock %}

View file

@ -34,6 +34,10 @@
</div>
<div>
<a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }} ({{untagged}})</a>
{% if nbEntriesUntagged == 0 %}
{{ 'tag.list.no_untagged_entries'|trans }}
{% else %}
<a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }} ({{nbEntriesUntagged}})</a>
{% endif %}
</div>
{% endblock %}