Closes #3235
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
{
$tags = $this->get('wallabag_core.tag_repository')
->findAllFlatTagsWithNbEntries($this->getUser()->getId());
+ $untagged = $this->get('wallabag_core.entry_repository')
+ ->countUntaggedEntriesForUser($this->getUser()->getId());
return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [
'tags' => $tags,
+ 'untagged' => $untagged
]);
}
->andWhere('size(e.tags) = 0');
}
+ /**
+ * Retrieve the number of untagged entries for a user.
+ *
+ * @param int $userId
+ *
+ * @return int
+ */
+ public function countUntaggedEntriesByUser($userId)
+ {
+ return $this->getRawBuilderForUntaggedByUser($userId)
+ ->select('count(e.id)')
+ ->getSingleScalarResult();
+ }
+
/**
* Find Entries.
*
</ul>
<div>
- <a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }}</a>
+ <a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }} ({{untagged}})</a>
</div>
{% endblock %}
</div>
<div>
- <a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }}</a>
+ <a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }} ({{untagged}})</a>
</div>
{% endblock %}