Show untagged entries count on tag list (#3993)

Show untagged entries count on tag list
This commit is contained in:
Thomas Citharel 2019-06-06 14:09:23 +02:00 committed by GitHub
commit 9c7997db8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 42 additions and 2 deletions

View file

@ -87,6 +87,8 @@ class TagController extends Controller
{
$tags = $this->get('wallabag_core.tag_repository')
->findAllFlatTagsWithNbEntries($this->getUser()->getId());
$nbEntriesUntagged = $this->get('wallabag_core.entry_repository')
->countUntaggedEntriesByUser($this->getUser()->getId());
$renameForms = [];
foreach ($tags as $tag) {
@ -96,6 +98,7 @@ class TagController extends Controller
return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [
'tags' => $tags,
'renameForms' => $renameForms,
'nbEntriesUntagged' => $nbEntriesUntagged,
]);
}

View file

@ -129,6 +129,21 @@ class EntryRepository extends EntityRepository
->andWhere('t.id is null');
}
/**
* Retrieve the number of untagged entries for a user.
*
* @param int $userId
*
* @return int
*/
public function countUntaggedEntriesByUser($userId)
{
return (int) $this->getRawBuilderForUntaggedByUser($userId)
->select('count(e.id)')
->getQuery()
->getSingleScalarResult();
}
/**
* Find Entries.
*

View file

@ -422,6 +422,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

@ -413,6 +413,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

@ -422,6 +422,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

@ -422,6 +422,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

@ -422,6 +422,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

@ -422,6 +422,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

@ -421,6 +421,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

@ -421,6 +421,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

@ -421,6 +421,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

@ -421,6 +421,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

@ -421,6 +421,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

@ -410,6 +410,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

@ -419,6 +419,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

@ -419,6 +419,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 }}</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 }}</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 %}