diff options
4 files changed, 19 insertions, 2 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index 616c37f2..bc794c7f 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php | |||
@@ -86,9 +86,12 @@ class TagController extends Controller | |||
86 | { | 86 | { |
87 | $tags = $this->get('wallabag_core.tag_repository') | 87 | $tags = $this->get('wallabag_core.tag_repository') |
88 | ->findAllFlatTagsWithNbEntries($this->getUser()->getId()); | 88 | ->findAllFlatTagsWithNbEntries($this->getUser()->getId()); |
89 | $untagged = $this->get('wallabag_core.entry_repository') | ||
90 | ->countUntaggedEntriesForUser($this->getUser()->getId()); | ||
89 | 91 | ||
90 | return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [ | 92 | return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [ |
91 | 'tags' => $tags, | 93 | 'tags' => $tags, |
94 | 'untagged' => $untagged | ||
92 | ]); | 95 | ]); |
93 | } | 96 | } |
94 | 97 | ||
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index b5e35eff..3a1f19b4 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php | |||
@@ -116,6 +116,20 @@ class EntryRepository extends EntityRepository | |||
116 | } | 116 | } |
117 | 117 | ||
118 | /** | 118 | /** |
119 | * Retrieve the number of untagged entries for a user. | ||
120 | * | ||
121 | * @param int $userId | ||
122 | * | ||
123 | * @return int | ||
124 | */ | ||
125 | public function countUntaggedEntriesByUser($userId) | ||
126 | { | ||
127 | return $this->getRawBuilderForUntaggedByUser($userId) | ||
128 | ->select('count(e.id)') | ||
129 | ->getSingleScalarResult(); | ||
130 | } | ||
131 | |||
132 | /** | ||
119 | * Find Entries. | 133 | * Find Entries. |
120 | * | 134 | * |
121 | * @param int $userId | 135 | * @param int $userId |
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 070d5629..e428ddf9 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 | |||
@@ -19,6 +19,6 @@ | |||
19 | </ul> | 19 | </ul> |
20 | 20 | ||
21 | <div> | 21 | <div> |
22 | <a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }}</a> | 22 | <a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }} ({{untagged}})</a> |
23 | </div> | 23 | </div> |
24 | {% endblock %} | 24 | {% 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 c15b5146..6a8272fe 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 | |||
@@ -23,6 +23,6 @@ | |||
23 | </div> | 23 | </div> |
24 | 24 | ||
25 | <div> | 25 | <div> |
26 | <a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }}</a> | 26 | <a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }} ({{untagged}})</a> |
27 | </div> | 27 | </div> |
28 | {% endblock %} | 28 | {% endblock %} |