aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNicolas Lœuillet <nicolas@loeuillet.org>2016-08-26 16:55:41 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-08-28 14:44:00 +0200
commitb6520f0b15ac35215e2d94d16a31ea971874dce8 (patch)
treee2353f1c9ebd7164da8975a8620b7b6d7e91e9e1 /src
parent8635ab1cd1ae90d7757a59444ef80759a040eccf (diff)
downloadwallabag-b6520f0b15ac35215e2d94d16a31ea971874dce8.tar.gz
wallabag-b6520f0b15ac35215e2d94d16a31ea971874dce8.tar.zst
wallabag-b6520f0b15ac35215e2d94d16a31ea971874dce8.zip
Add untagged entries
Fix #1631
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php19
-rw-r--r--src/Wallabag/CoreBundle/Controller/ExportController.php2
-rw-r--r--src/Wallabag/CoreBundle/Repository/EntryRepository.php16
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.da.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.de.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.en.yml2
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.es.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.it.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/_title.html.twig2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig4
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig3
17 files changed, 57 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index d71ba6cd..624576b5 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -226,6 +226,10 @@ class EntryController extends Controller
226 $repository = $this->get('wallabag_core.entry_repository'); 226 $repository = $this->get('wallabag_core.entry_repository');
227 227
228 switch ($type) { 228 switch ($type) {
229 case 'untagged':
230 $qb = $repository->getBuilderForUntaggedByUser($this->getUser()->getId());
231
232 break;
229 case 'starred': 233 case 'starred':
230 $qb = $repository->getBuilderForStarredByUser($this->getUser()->getId()); 234 $qb = $repository->getBuilderForStarredByUser($this->getUser()->getId());
231 break; 235 break;
@@ -523,4 +527,19 @@ class EntryController extends Controller
523 ['entry' => $entry] 527 ['entry' => $entry]
524 ); 528 );
525 } 529 }
530
531 /**
532 * Shows untagged articles for current user.
533 *
534 * @param Request $request
535 * @param int $page
536 *
537 * @Route("/untagged/list/{page}", name="untagged", defaults={"page" = "1"})
538 *
539 * @return \Symfony\Component\HttpFoundation\Response
540 */
541 public function showUntaggedEntriesAction(Request $request, $page)
542 {
543 return $this->showEntries('untagged', $request, $page);
544 }
526} 545}
diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php
index 959b308d..6191d5d7 100644
--- a/src/Wallabag/CoreBundle/Controller/ExportController.php
+++ b/src/Wallabag/CoreBundle/Controller/ExportController.php
@@ -46,7 +46,7 @@ class ExportController extends Controller
46 * 46 *
47 * @Route("/export/{category}.{format}", name="export_entries", requirements={ 47 * @Route("/export/{category}.{format}", name="export_entries", requirements={
48 * "format": "epub|mobi|pdf|json|xml|txt|csv", 48 * "format": "epub|mobi|pdf|json|xml|txt|csv",
49 * "category": "all|unread|starred|archive|tag_entries" 49 * "category": "all|unread|starred|archive|tag_entries|untagged"
50 * }) 50 * })
51 * 51 *
52 * @return \Symfony\Component\HttpFoundation\Response 52 * @return \Symfony\Component\HttpFoundation\Response
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
index fada40bb..e5c21679 100644
--- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
@@ -85,6 +85,22 @@ class EntryRepository extends EntityRepository
85 } 85 }
86 86
87 /** 87 /**
88 * Retrieves untagged entries for a user.
89 *
90 * @param int $userId
91 *
92 * @return QueryBuilder
93 */
94 public function getBuilderForUntaggedByUser($userId)
95 {
96 return $this
97 ->getBuilderByUser($userId)
98 ->leftJoin('e.tags', 't')
99 ->groupBy('e.id')
100 ->having('count(t.id) = 0');
101 }
102
103 /**
88 * Find Entries. 104 * Find Entries.
89 * 105 *
90 * @param int $userId 106 * @param int $userId
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
index f9b7bfac..cacc5865 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
@@ -312,6 +312,7 @@ tag:
312 page_title: 'Tags' 312 page_title: 'Tags'
313 list: 313 list:
314 # number_on_the_page: '{0} There is no tag.|{1} There is one tag.|]1,Inf[ There are %count% tags.' 314 # number_on_the_page: '{0} There is no tag.|{1} There is one tag.|]1,Inf[ There are %count% tags.'
315 # see_untagged_entries: 'See untagged entries'
315 316
316import: 317import:
317 # page_title: 'Import' 318 # page_title: 'Import'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
index 79d03286..e1ab7690 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
@@ -312,6 +312,7 @@ tag:
312 page_title: 'Tags' 312 page_title: 'Tags'
313 list: 313 list:
314 number_on_the_page: '{0} Es gibt keine Tags.|{1} Es gibt einen Tag.|]1,Inf[ Es gibt %count% Tags.' 314 number_on_the_page: '{0} Es gibt keine Tags.|{1} Es gibt einen Tag.|]1,Inf[ Es gibt %count% Tags.'
315 # see_untagged_entries: 'See untagged entries'
315 316
316import: 317import:
317 page_title: 'Importieren' 318 page_title: 'Importieren'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
index d921b39f..220c4d9c 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
@@ -140,6 +140,7 @@ entry:
140 archived: 'Archived entries' 140 archived: 'Archived entries'
141 filtered: 'Filtered entries' 141 filtered: 'Filtered entries'
142 filtered_tags: 'Filtered by tags' 142 filtered_tags: 'Filtered by tags'
143 untagged: 'Untagged entries'
143 list: 144 list:
144 number_on_the_page: '{0} There are no entries.|{1} There is one entry.|]1,Inf[ There are %count% entries.' 145 number_on_the_page: '{0} There are no entries.|{1} There is one entry.|]1,Inf[ There are %count% entries.'
145 reading_time: 'estimated reading time' 146 reading_time: 'estimated reading time'
@@ -312,6 +313,7 @@ tag:
312 page_title: 'Tags' 313 page_title: 'Tags'
313 list: 314 list:
314 number_on_the_page: '{0} There are no tags.|{1} There is one tag.|]1,Inf[ There are %count% tags.' 315 number_on_the_page: '{0} There are no tags.|{1} There is one tag.|]1,Inf[ There are %count% tags.'
316 see_untagged_entries: 'See untagged entries'
315 317
316import: 318import:
317 page_title: 'Import' 319 page_title: 'Import'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
index c2ec4dbd..6391fbe6 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
@@ -312,6 +312,7 @@ tag:
312 page_title: 'Etiquetas' 312 page_title: 'Etiquetas'
313 list: 313 list:
314 number_on_the_page: '{0} No hay ninguna etiqueta.|{1} Hay una etiqueta.|]1,Inf[ Hay %count% etiquetas.' 314 number_on_the_page: '{0} No hay ninguna etiqueta.|{1} Hay una etiqueta.|]1,Inf[ Hay %count% etiquetas.'
315 # see_untagged_entries: 'See untagged entries'
315 316
316import: 317import:
317 page_title: 'Importar' 318 page_title: 'Importar'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
index 561ed907..8d75dd52 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
@@ -312,6 +312,7 @@ tag:
312 page_title: 'برچسب‌ها' 312 page_title: 'برچسب‌ها'
313 list: 313 list:
314 number_on_the_page: '{0} هیچ برچسبی نیست.|{1} یک برچسب هست.|]1,Inf[ %count% برچسب هست.' 314 number_on_the_page: '{0} هیچ برچسبی نیست.|{1} یک برچسب هست.|]1,Inf[ %count% برچسب هست.'
315 # see_untagged_entries: 'See untagged entries'
315 316
316import: 317import:
317 page_title: 'درون‌ریزی' 318 page_title: 'درون‌ریزی'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
index c0671883..87c3e501 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
@@ -312,6 +312,7 @@ tag:
312 page_title: 'Tags' 312 page_title: 'Tags'
313 list: 313 list:
314 number_on_the_page: "{0} Il n'y a pas de tag.|{1} Il y a un tag.|]1,Inf[ Il y a %count% tags." 314 number_on_the_page: "{0} Il n'y a pas de tag.|{1} Il y a un tag.|]1,Inf[ Il y a %count% tags."
315 see_untagged_entries: 'Voir les articles sans tag'
315 316
316import: 317import:
317 page_title: 'Importer' 318 page_title: 'Importer'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
index 2e3dd08b..bdf0cd97 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
@@ -310,6 +310,7 @@ tag:
310 page_title: 'Tags' 310 page_title: 'Tags'
311 list: 311 list:
312 number_on_the_page: "{0} Non ci sono tag.|{1} C'è un tag.|]1,Inf[ ci sono %count% tag." 312 number_on_the_page: "{0} Non ci sono tag.|{1} C'è un tag.|]1,Inf[ ci sono %count% tag."
313 # see_untagged_entries: 'See untagged entries'
313 314
314import: 315import:
315 page_title: 'Importa' 316 page_title: 'Importa'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
index 7b978a60..70bc553c 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
@@ -312,6 +312,7 @@ tag:
312 page_title: 'Etiquetas' 312 page_title: 'Etiquetas'
313 list: 313 list:
314 number_on_the_page: "{0} I a pas cap d'etiquetas.|{1} I a una etiqueta.|]1,Inf[ I a %count% etiquetas." 314 number_on_the_page: "{0} I a pas cap d'etiquetas.|{1} I a una etiqueta.|]1,Inf[ I a %count% etiquetas."
315 # see_untagged_entries: 'See untagged entries'
315 316
316import: 317import:
317 page_title: 'Importar' 318 page_title: 'Importar'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
index da170e4d..8572ef2d 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
@@ -312,6 +312,7 @@ tag:
312 page_title: 'Tagi' 312 page_title: 'Tagi'
313 list: 313 list:
314 number_on_the_page: '{0} Nie ma tagów.|{1} Jest jeden tag.|]1,Inf[ Są %count% tagi.' 314 number_on_the_page: '{0} Nie ma tagów.|{1} Jest jeden tag.|]1,Inf[ Są %count% tagi.'
315 # see_untagged_entries: 'See untagged entries'
315 316
316import: 317import:
317 page_title: 'Import' 318 page_title: 'Import'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
index fa2d6468..166a8e6e 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
@@ -312,6 +312,7 @@ tag:
312 page_title: 'Tag-uri' 312 page_title: 'Tag-uri'
313 list: 313 list:
314 # number_on_the_page: '{0} There is no tag.|{1} There is one tag.|]1,Inf[ There are %count% tags.' 314 # number_on_the_page: '{0} There is no tag.|{1} There is one tag.|]1,Inf[ There are %count% tags.'
315 # see_untagged_entries: 'See untagged entries'
315 316
316import: 317import:
317 # page_title: 'Import' 318 # page_title: 'Import'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
index 05c31336..7386d70d 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
@@ -312,6 +312,7 @@ tag:
312 page_title: 'Etiketler' 312 page_title: 'Etiketler'
313 list: 313 list:
314 number_on_the_page: '{0} Herhangi bir etiket yok.|{1} Burada bir adet etiket var.|]1,Inf[ Burada %count% adet etiket var.' 314 number_on_the_page: '{0} Herhangi bir etiket yok.|{1} Burada bir adet etiket var.|]1,Inf[ Burada %count% adet etiket var.'
315 # see_untagged_entries: 'See untagged entries'
315 316
316import: 317import:
317 page_title: 'İçe Aktar' 318 page_title: 'İçe Aktar'
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/_title.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/_title.html.twig
index 525e2a20..d1c2f203 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/_title.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/_title.html.twig
@@ -8,6 +8,8 @@
8 {{ 'entry.page_titles.filtered'|trans }} 8 {{ 'entry.page_titles.filtered'|trans }}
9{% elseif currentRoute == 'tag_entries' %} 9{% elseif currentRoute == 'tag_entries' %}
10 {{ 'entry.page_titles.filtered_tags'|trans }} 10 {{ 'entry.page_titles.filtered_tags'|trans }}
11{% elseif currentRoute == 'untagged' %}
12 {{ 'entry.page_titles.untagged'|trans }}
11{% else %} 13{% else %}
12 {{ 'entry.page_titles.unread'|trans }} 14 {{ 'entry.page_titles.unread'|trans }}
13{% endif %} 15{% endif %}
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 739e1486..50043907 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
@@ -12,4 +12,8 @@
12 <li id="tag-{{ tag.id|e }}"><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.entries.getValues | length }})</a></li> 12 <li id="tag-{{ tag.id|e }}"><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.entries.getValues | length }})</a></li>
13 {% endfor %} 13 {% endfor %}
14 </ul> 14 </ul>
15
16 <div>
17 <a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }}</a>
18 </div>
15{% endblock %} 19{% 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 9495f543..1690633a 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
@@ -12,4 +12,7 @@
12 <li id="tag-{{ tag.id|e }}" class="col l4 m6 s12"><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.entries.getValues | length }})</a></li> 12 <li id="tag-{{ tag.id|e }}" class="col l4 m6 s12"><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.entries.getValues | length }})</a></li>
13 {% endfor %} 13 {% endfor %}
14 </ul> 14 </ul>
15 <div>
16 <a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }}</a>
17 </div>
15{% endblock %} 18{% endblock %}