mirror of https://github.com/wallabag/wallabag.git
Show untagged entries count on tag list
Closes #3235 Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
parent
7e5b7e029a
commit
ad51743e8b
|
@ -87,6 +87,8 @@ class TagController extends Controller
|
||||||
{
|
{
|
||||||
$tags = $this->get('wallabag_core.tag_repository')
|
$tags = $this->get('wallabag_core.tag_repository')
|
||||||
->findAllFlatTagsWithNbEntries($this->getUser()->getId());
|
->findAllFlatTagsWithNbEntries($this->getUser()->getId());
|
||||||
|
$untagged = $this->get('wallabag_core.entry_repository')
|
||||||
|
->countUntaggedEntriesForUser($this->getUser()->getId());
|
||||||
|
|
||||||
$renameForms = [];
|
$renameForms = [];
|
||||||
foreach ($tags as $tag) {
|
foreach ($tags as $tag) {
|
||||||
|
@ -96,6 +98,7 @@ class TagController extends Controller
|
||||||
return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [
|
return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [
|
||||||
'tags' => $tags,
|
'tags' => $tags,
|
||||||
'renameForms' => $renameForms,
|
'renameForms' => $renameForms,
|
||||||
|
'untagged' => $untagged,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,6 +129,20 @@ class EntryRepository extends EntityRepository
|
||||||
->andWhere('t.id is null');
|
->andWhere('t.id is null');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
* Find Entries.
|
||||||
*
|
*
|
||||||
|
|
|
@ -31,6 +31,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<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>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -34,6 +34,6 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<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>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in New Issue