1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-06-27 16:36:00 +00:00

Add untagged entries

Fix #1631
This commit is contained in:
Nicolas Lœuillet 2016-08-26 16:55:41 +02:00 committed by Jeremy Benoist
parent 8635ab1cd1
commit b6520f0b15
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
17 changed files with 57 additions and 1 deletions

View file

@ -226,6 +226,10 @@ class EntryController extends Controller
$repository = $this->get('wallabag_core.entry_repository'); $repository = $this->get('wallabag_core.entry_repository');
switch ($type) { switch ($type) {
case 'untagged':
$qb = $repository->getBuilderForUntaggedByUser($this->getUser()->getId());
break;
case 'starred': case 'starred':
$qb = $repository->getBuilderForStarredByUser($this->getUser()->getId()); $qb = $repository->getBuilderForStarredByUser($this->getUser()->getId());
break; break;
@ -523,4 +527,19 @@ class EntryController extends Controller
['entry' => $entry] ['entry' => $entry]
); );
} }
/**
* Shows untagged articles for current user.
*
* @param Request $request
* @param int $page
*
* @Route("/untagged/list/{page}", name="untagged", defaults={"page" = "1"})
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function showUntaggedEntriesAction(Request $request, $page)
{
return $this->showEntries('untagged', $request, $page);
}
} }

View file

@ -46,7 +46,7 @@ class ExportController extends Controller
* *
* @Route("/export/{category}.{format}", name="export_entries", requirements={ * @Route("/export/{category}.{format}", name="export_entries", requirements={
* "format": "epub|mobi|pdf|json|xml|txt|csv", * "format": "epub|mobi|pdf|json|xml|txt|csv",
* "category": "all|unread|starred|archive|tag_entries" * "category": "all|unread|starred|archive|tag_entries|untagged"
* }) * })
* *
* @return \Symfony\Component\HttpFoundation\Response * @return \Symfony\Component\HttpFoundation\Response

View file

@ -84,6 +84,22 @@ class EntryRepository extends EntityRepository
; ;
} }
/**
* Retrieves untagged entries for a user.
*
* @param int $userId
*
* @return QueryBuilder
*/
public function getBuilderForUntaggedByUser($userId)
{
return $this
->getBuilderByUser($userId)
->leftJoin('e.tags', 't')
->groupBy('e.id')
->having('count(t.id) = 0');
}
/** /**
* Find Entries. * Find Entries.
* *

View file

@ -312,6 +312,7 @@ tag:
page_title: 'Tags' page_title: 'Tags'
list: list:
# number_on_the_page: '{0} There is no tag.|{1} There is one tag.|]1,Inf[ There are %count% tags.' # 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'
import: import:
# page_title: 'Import' # page_title: 'Import'

View file

@ -312,6 +312,7 @@ tag:
page_title: 'Tags' page_title: 'Tags'
list: list:
number_on_the_page: '{0} Es gibt keine Tags.|{1} Es gibt einen Tag.|]1,Inf[ Es gibt %count% Tags.' number_on_the_page: '{0} Es gibt keine Tags.|{1} Es gibt einen Tag.|]1,Inf[ Es gibt %count% Tags.'
# see_untagged_entries: 'See untagged entries'
import: import:
page_title: 'Importieren' page_title: 'Importieren'

View file

@ -140,6 +140,7 @@ entry:
archived: 'Archived entries' archived: 'Archived entries'
filtered: 'Filtered entries' filtered: 'Filtered entries'
filtered_tags: 'Filtered by tags' filtered_tags: 'Filtered by tags'
untagged: 'Untagged entries'
list: list:
number_on_the_page: '{0} There are no entries.|{1} There is one entry.|]1,Inf[ There are %count% entries.' number_on_the_page: '{0} There are no entries.|{1} There is one entry.|]1,Inf[ There are %count% entries.'
reading_time: 'estimated reading time' reading_time: 'estimated reading time'
@ -312,6 +313,7 @@ tag:
page_title: 'Tags' page_title: 'Tags'
list: list:
number_on_the_page: '{0} There are no tags.|{1} There is one tag.|]1,Inf[ There are %count% tags.' 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'
import: import:
page_title: 'Import' page_title: 'Import'

View file

@ -312,6 +312,7 @@ tag:
page_title: 'Etiquetas' page_title: 'Etiquetas'
list: list:
number_on_the_page: '{0} No hay ninguna etiqueta.|{1} Hay una etiqueta.|]1,Inf[ Hay %count% etiquetas.' number_on_the_page: '{0} No hay ninguna etiqueta.|{1} Hay una etiqueta.|]1,Inf[ Hay %count% etiquetas.'
# see_untagged_entries: 'See untagged entries'
import: import:
page_title: 'Importar' page_title: 'Importar'

View file

@ -312,6 +312,7 @@ tag:
page_title: 'برچسب‌ها' page_title: 'برچسب‌ها'
list: list:
number_on_the_page: '{0} هیچ برچسبی نیست.|{1} یک برچسب هست.|]1,Inf[ %count% برچسب هست.' number_on_the_page: '{0} هیچ برچسبی نیست.|{1} یک برچسب هست.|]1,Inf[ %count% برچسب هست.'
# see_untagged_entries: 'See untagged entries'
import: import:
page_title: 'درون‌ریزی' page_title: 'درون‌ریزی'

View file

@ -312,6 +312,7 @@ tag:
page_title: 'Tags' page_title: 'Tags'
list: list:
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." 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."
see_untagged_entries: 'Voir les articles sans tag'
import: import:
page_title: 'Importer' page_title: 'Importer'

View file

@ -310,6 +310,7 @@ tag:
page_title: 'Tags' page_title: 'Tags'
list: list:
number_on_the_page: "{0} Non ci sono tag.|{1} C'è un tag.|]1,Inf[ ci sono %count% tag." number_on_the_page: "{0} Non ci sono tag.|{1} C'è un tag.|]1,Inf[ ci sono %count% tag."
# see_untagged_entries: 'See untagged entries'
import: import:
page_title: 'Importa' page_title: 'Importa'

View file

@ -312,6 +312,7 @@ tag:
page_title: 'Etiquetas' page_title: 'Etiquetas'
list: list:
number_on_the_page: "{0} I a pas cap d'etiquetas.|{1} I a una etiqueta.|]1,Inf[ I a %count% etiquetas." 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: 'See untagged entries'
import: import:
page_title: 'Importar' page_title: 'Importar'

View file

@ -312,6 +312,7 @@ tag:
page_title: 'Tagi' page_title: 'Tagi'
list: list:
number_on_the_page: '{0} Nie ma tagów.|{1} Jest jeden tag.|]1,Inf[ Są %count% tagi.' number_on_the_page: '{0} Nie ma tagów.|{1} Jest jeden tag.|]1,Inf[ Są %count% tagi.'
# see_untagged_entries: 'See untagged entries'
import: import:
page_title: 'Import' page_title: 'Import'

View file

@ -312,6 +312,7 @@ tag:
page_title: 'Tag-uri' page_title: 'Tag-uri'
list: list:
# number_on_the_page: '{0} There is no tag.|{1} There is one tag.|]1,Inf[ There are %count% tags.' # 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'
import: import:
# page_title: 'Import' # page_title: 'Import'

View file

@ -312,6 +312,7 @@ tag:
page_title: 'Etiketler' page_title: 'Etiketler'
list: list:
number_on_the_page: '{0} Herhangi bir etiket yok.|{1} Burada bir adet etiket var.|]1,Inf[ Burada %count% adet etiket var.' 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'
import: import:
page_title: 'İçe Aktar' page_title: 'İçe Aktar'

View file

@ -8,6 +8,8 @@
{{ 'entry.page_titles.filtered'|trans }} {{ 'entry.page_titles.filtered'|trans }}
{% elseif currentRoute == 'tag_entries' %} {% elseif currentRoute == 'tag_entries' %}
{{ 'entry.page_titles.filtered_tags'|trans }} {{ 'entry.page_titles.filtered_tags'|trans }}
{% elseif currentRoute == 'untagged' %}
{{ 'entry.page_titles.untagged'|trans }}
{% else %} {% else %}
{{ 'entry.page_titles.unread'|trans }} {{ 'entry.page_titles.unread'|trans }}
{% endif %} {% endif %}

View file

@ -12,4 +12,8 @@
<li id="tag-{{ tag.id|e }}"><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.entries.getValues | length }})</a></li> <li id="tag-{{ tag.id|e }}"><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.entries.getValues | length }})</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
<div>
<a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }}</a>
</div>
{% endblock %} {% endblock %}

View file

@ -12,4 +12,7 @@
<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> <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>
{% endfor %} {% endfor %}
</ul> </ul>
<div>
<a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }}</a>
</div>
{% endblock %} {% endblock %}