From dce50ddb798e9007e05352be3e8dc2bdda94bce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 20 Apr 2020 19:00:58 +0200 Subject: [PATCH] Added route to list entries with annotations --- app/config/security.yml | 4 +-- .../CoreBundle/Controller/EntryController.php | 19 ++++++++++- .../Controller/ExportController.php | 9 ++++- .../CoreBundle/Repository/EntryRepository.php | 19 +++++++++++ .../Resources/translations/messages.da.yml | 12 +++++++ .../Resources/translations/messages.de.yml | 2 ++ .../Resources/translations/messages.en.yml | 2 ++ .../Resources/translations/messages.es.yml | 2 ++ .../Resources/translations/messages.fa.yml | 34 +++++++++++++++++++ .../Resources/translations/messages.fr.yml | 2 ++ .../Resources/translations/messages.it.yml | 4 +++ .../Resources/translations/messages.ja.yml | 2 ++ .../Resources/translations/messages.oc.yml | 2 ++ .../Resources/translations/messages.pl.yml | 2 ++ .../Resources/translations/messages.pt.yml | 2 ++ .../Resources/translations/messages.ro.yml | 12 +++++++ .../Resources/translations/messages.ru.yml | 2 ++ .../Resources/translations/messages.th.yml | 2 ++ .../Resources/translations/messages.tr.yml | 2 ++ .../Resources/translations/messages.zh.yml | 2 ++ .../themes/common/Entry/_title.html.twig | 2 ++ .../views/themes/material/layout.html.twig | 5 +++ .../CoreBundle/Twig/WallabagExtension.php | 3 ++ 23 files changed, 143 insertions(+), 4 deletions(-) diff --git a/app/config/security.yml b/app/config/security.yml index 5a73440b2..50ae50492 100644 --- a/app/config/security.yml +++ b/app/config/security.yml @@ -69,11 +69,11 @@ security: - { path: ^/logout, roles: [IS_AUTHENTICATED_ANONYMOUSLY, IS_AUTHENTICATED_2FA_IN_PROGRESS] } - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY } - - { path: /(unread|starred|archive|all).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } + - { path: /(unread|starred|archive|with_annotations|all).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/locale, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: /tags/(.*).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/feed, roles: IS_AUTHENTICATED_ANONYMOUSLY } - - { path: /(unread|starred|archive).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } # For backwards compatibility + - { path: /(unread|starred|archive|with_annotations).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } # For backwards compatibility - { path: ^/share, roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/settings, roles: ROLE_SUPER_ADMIN } - { path: ^/annotations, roles: ROLE_USER } diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 588572a1d..4657d87ee 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -277,12 +277,26 @@ class EntryController extends Controller return $this->showEntries('untagged', $request, $page); } + /** + * Shows entries with annotations for current user. + * + * @param int $page + * + * @Route("/with_annotations/list/{page}", name="with_annotations", defaults={"page" = "1"}) + * + * @return \Symfony\Component\HttpFoundation\Response + */ + public function showWithAnnotationsEntriesAction(Request $request, $page) + { + return $this->showEntries('with_annotations', $request, $page); + } + /** * Shows random entry depending on the given type. * * @param string $type * - * @Route("/{type}/random", name="random_entry", requirements={"type": "unread|starred|archive|untagged|all"}) + * @Route("/{type}/random", name="random_entry", requirements={"type": "unread|starred|archive|untagged|with_annotations|all"}) * * @return \Symfony\Component\HttpFoundation\RedirectResponse */ @@ -563,6 +577,9 @@ class EntryController extends Controller $qb = $repository->getBuilderForArchiveByUser($this->getUser()->getId()); $formOptions['filter_archived'] = true; break; + case 'with_annotations': + $qb = $repository->getBuilderForAnnotationsByUser($this->getUser()->getId()); + break; case 'unread': $qb = $repository->getBuilderForUnreadByUser($this->getUser()->getId()); $formOptions['filter_unread'] = true; diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php index 824d21bb9..360640648 100644 --- a/src/Wallabag/CoreBundle/Controller/ExportController.php +++ b/src/Wallabag/CoreBundle/Controller/ExportController.php @@ -47,7 +47,7 @@ class ExportController extends Controller * * @Route("/export/{category}.{format}", name="export_entries", requirements={ * "format": "epub|mobi|pdf|json|xml|txt|csv", - * "category": "all|unread|starred|archive|tag_entries|untagged|search|same_domain" + * "category": "all|unread|starred|archive|tag_entries|untagged|search|with_annotations|same_domain" * }) * * @return \Symfony\Component\HttpFoundation\Response @@ -80,6 +80,13 @@ class ExportController extends Controller ->getResult(); $title = 'Search ' . $searchTerm; + } elseif ('with_annotations' === $category) { + $entries = $repository->getBuilderForAnnotationsByUser( + $this->getUser()->getId() + )->getQuery() + ->getResult(); + + $title = 'With annotations'; } else { $entries = $repository ->$methodBuilder($this->getUser()->getId()) diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 56f62e1cc..390f655d5 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -142,6 +142,21 @@ class EntryRepository extends EntityRepository return $this->sortQueryBuilder($this->getRawBuilderForUntaggedByUser($userId)); } + /** + * Retrieve entries with annotations for a user. + * + * @param int $userId + * + * @return QueryBuilder + */ + public function getBuilderForAnnotationsByUser($userId) + { + return $this + ->getSortedQueryBuilderByUser($userId) + ->innerJoin('e.annotations', 'a') + ; + } + /** * Retrieve untagged entries for a user. * @@ -579,6 +594,10 @@ class EntryRepository extends EntityRepository $qb->leftJoin('e.tags', 't'); $qb->andWhere('t.id is null'); break; + case 'with_annotations': + $qb->leftJoin('e.annotations', 'a'); + $qb->andWhere('a.id is not null'); + break; } $ids = $qb->getQuery()->getArrayResult(); diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index f1566e3c0..459b0d8e6 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -13,6 +13,7 @@ menu: starred: 'Favoritter' archive: 'Arkiv' all_articles: 'Alle artikler' + # with_annotations: 'With annotations' config: 'Opsætning' tags: 'Tags' howto: 'KUow-to' @@ -65,6 +66,17 @@ config: new_password_label: 'Ny adgangskode' repeat_new_password_label: 'Gentag adgangskode' entry: + # default_title: 'Title of the entry' + page_titles: + # unread: 'Unread entries' + # starred: 'Starred entries' + # archived: 'Archived entries' + # filtered: 'Filtered entries' + # with_annotations: 'Entries with annotations' + # filtered_tags: 'Filtered by tags:' + # filtered_search: 'Filtered by search:' + # untagged: 'Untagged entries' + # all: 'All entries' list: reading_time: 'estimeret læsetid' reading_time_minutes: 'estimeret læsetid: %readingTime% min' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 42c6652dd..f8be2fe96 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -19,6 +19,7 @@ menu: starred: Favoriten archive: Archiv all_articles: Alle Artikel + # with_annotations: 'With annotations' config: Konfiguration tags: Tags internal_settings: Interne Einstellungen @@ -236,6 +237,7 @@ entry: starred: Favorisierte Einträge archived: Archivierte Einträge filtered: Gefilterte Einträge + # with_annotations: 'Entries with annotations' filtered_tags: 'Gefiltert nach Tags:' filtered_search: 'Gefiltert nach Suche:' untagged: Nicht markierte Einträge diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index e2075c551..98d374a2d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -19,6 +19,7 @@ menu: starred: Starred archive: Archive all_articles: All entries + with_annotations: With annotations config: Config tags: Tags internal_settings: Internal Settings @@ -220,6 +221,7 @@ entry: starred: Starred entries archived: Archived entries filtered: Filtered entries + with_annotations: Entries with annotations filtered_tags: 'Filtered by tags:' filtered_search: 'Filtered by search:' untagged: Untagged entries diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 08d05a21c..8faad3d33 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -19,6 +19,7 @@ menu: starred: 'Favoritos' archive: 'Archivados' all_articles: 'Todos los artículos' + # with_annotations: 'With annotations' config: 'Configuración' tags: 'Etiquetas' internal_settings: 'Configuración interna' @@ -217,6 +218,7 @@ entry: starred: 'Artículos favoritos' archived: 'Artículos archivados' filtered: 'Artículos filtrados' + # with_annotations: 'Entries with annotations' filtered_tags: 'Filtrado por etiquetas:' filtered_search: 'Filtrado por búsqueda:' untagged: 'Artículos sin etiquetas' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 44e358cab..11869f03e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -15,6 +15,7 @@ security: go_to_account: حساب خود را ببینید menu: left: +<<<<<<< HEAD unread: خوانده‌نشده starred: برگزیده archive: بایگانی @@ -32,6 +33,27 @@ menu: site_credentials: اعتبارنامه‌های وب‌گاه users_management: مدیریت کاربران developer: مدیریت کارخواه‌های API +======= + unread: 'خوانده‌نشده' + starred: 'برگزیده' + archive: 'بایگانی' + all_articles: 'همه' + # with_annotations: 'With annotations' + config: 'پیکربندی' + tags: 'برچسب‌ها' + internal_settings: 'تنظیمات درونی' + import: 'درون‌ریزی' + howto: 'خودآموز' + # developer: 'API clients management' + logout: 'خروج' + about: 'درباره' + search: 'جستجو' + save_link: 'ذخیرهٔ یک پیوند' + back_to_unread: 'بازگشت به خوانده‌نشده‌ها' + # users_management: 'Users management' + # site_credentials: 'Site credentials' + quickstart: "Quickstart" +>>>>>>> 4b997bc8 (Added route to list entries with annotations) top: add_new_entry: افزودن مقالهٔ تازه search: جستجو @@ -106,10 +128,22 @@ config: tagging_rules_definition_title: برچسب‌گذاری خودکار یعنی چه؟ entry: page_titles: +<<<<<<< HEAD unread: مقاله‌های خوانده‌نشده starred: مقاله‌های برگزیده archived: مقاله‌های بایگانی‌شده filtered: مقاله‌های فیلترشده +======= + unread: 'مقاله‌های خوانده‌نشده' + starred: 'مقاله‌های برگزیده' + archived: 'مقاله‌های بایگانی‌شده' + filtered: 'مقاله‌های فیلترشده' + # with_annotations: 'Entries with annotations' + # filtered_tags: 'Filtered by tags:' + # filtered_search: 'Filtered by search:' + # untagged: 'Untagged entries' + # all: 'All entries' +>>>>>>> 4b997bc8 (Added route to list entries with annotations) list: number_on_the_page: '{0} هیج مقاله‌ای نیست.|{1} یک مقاله هست.|]1,Inf[ %count% مقاله هست.' reading_time: زمان تخمینی برای خواندن diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 9349d5f43..5bfc86a21 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -19,6 +19,7 @@ menu: starred: Favoris archive: Lus all_articles: Tous les articles + with_annotations: Avec annotations config: Configuration tags: Étiquettes internal_settings: Configuration interne @@ -220,6 +221,7 @@ entry: starred: Articles favoris archived: Articles lus filtered: Articles filtrés + with_annotations: Articles avec annotations filtered_tags: 'Articles filtrés par étiquettes :' filtered_search: 'Articles filtrés par recherche :' untagged: Article sans étiquette diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 4d742ef1e..c2dfcd60c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -15,10 +15,12 @@ security: go_to_account: Vai al tuo account menu: left: + unread: Non letti starred: Preferiti archive: Archivio all_articles: Tutti + # with_annotations: 'With annotations' config: Configurazione tags: Etichette internal_settings: Strumenti @@ -175,10 +177,12 @@ config: entry: default_title: Titolo del contenuto page_titles: + unread: Contenuti non letti starred: Contenuti preferiti archived: Contenuti archiviati filtered: Contenuti filtrati + # with_annotations: 'Entries with annotations' filtered_tags: 'Filtrati per etichetta:' filtered_search: 'Filtrati per ricerca:' untagged: Articoli non etichettati diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ja.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ja.yml index c02bc91b7..a6eb771d7 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ja.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ja.yml @@ -19,6 +19,7 @@ menu: starred: スター archive: アーカイブ all_articles: すべての記事 + # with_annotations: 'With annotations' config: 設定 tags: タグ internal_settings: 内部設定 @@ -235,6 +236,7 @@ entry: starred: スター付きの記事 archived: アーカイブ済の記事 filtered: フィルターされた記事 + # with_annotations: 'Entries with annotations' filtered_tags: 'タグによるフィルター:' untagged: タグがない記事 all: すべての記事 diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 9ce28b0cf..c99072570 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -19,6 +19,7 @@ menu: starred: Favorits archive: Legits all_articles: Totes los articles + # with_annotations: 'With annotations' config: Configuracion tags: Etiquetas internal_settings: Configuracion intèrna @@ -180,6 +181,7 @@ entry: starred: Articles favorits archived: Articles legits filtered: Articles filtrats + # with_annotations: 'Entries with annotations' filtered_tags: 'Articles filtrats per etiquetas :' filtered_search: 'Articles filtrats per recèrca :' untagged: Articles sens etiqueta diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 0da2d9916..72e96e3dd 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -19,6 +19,7 @@ menu: starred: Oznaczone gwiazdką archive: Archiwum all_articles: Wszystkie + # with_annotations: 'With annotations' config: Konfiguracja tags: Tagi internal_settings: Wewnętrzne ustawienia @@ -210,6 +211,7 @@ entry: starred: Wpisy oznaczone gwiazdką archived: Zarchiwizowane wpisy filtered: Odfiltrowane wpisy + # with_annotations: 'Entries with annotations' filtered_tags: 'Filtrowane po tagach:' filtered_search: 'Filtrowanie po wyszukiwaniu:' untagged: Odtaguj wpisy diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index c3e7d0021..bda707462 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -19,6 +19,7 @@ menu: starred: 'Destacado' archive: 'Arquivo' all_articles: 'Todas as entradas' + # with_annotations: 'With annotations' config: 'Configurações' tags: 'Tags' internal_settings: 'Configurações Internas' @@ -148,6 +149,7 @@ entry: starred: 'Entradas destacadas' archived: 'Entradas arquivadas' filtered: 'Entradas filtradas' + # with_annotations: 'Entries with annotations' filtered_tags: 'Filtrar por tags:' untagged: 'Entradas sem tags' list: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index a954551cf..0e415b363 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -13,6 +13,7 @@ menu: starred: 'Cu steluță' archive: 'Arhivă' all_articles: 'Toate' + # with_annotations: 'With annotations' config: 'Configurație' tags: 'Tag-uri' howto: 'Cum să' @@ -64,6 +65,17 @@ config: new_password_label: 'Parola nouă' repeat_new_password_label: '' entry: + # default_title: 'Title of the entry' + page_titles: + # unread: 'Unread entries' + # starred: 'Starred entries' + # archived: 'Archived entries' + # filtered: 'Filtered entries' + # with_annotations: 'Entries with annotations' + # filtered_tags: 'Filtered by tags:' + # filtered_search: 'Filtered by search:' + # untagged: 'Untagged entries' + # all: 'All entries' list: reading_time: 'timp estimat de citire' reading_time_minutes: 'timp estimat de citire: %readingTime% min' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index c6389ba03..745f5a9a1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -19,6 +19,7 @@ menu: starred: 'Помеченные' archive: 'Архивные' all_articles: 'Все записи' + # with_annotations: 'With annotations' config: 'Настройки' tags: 'Теги' internal_settings: 'Внутренние настройки' @@ -236,6 +237,7 @@ entry: starred: 'Помеченные записи' archived: 'Архивные записи' filtered: 'Отфильтрованные записи' + # with_annotations: 'Entries with annotations' filtered_tags: 'Отфильтрованные по тегу:' filtered_search: 'Отфильтрованные по поиску:' untagged: 'Записи без тегов' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 7a250ba59..0ebaf147e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -19,6 +19,7 @@ menu: starred: 'ทำการแสดง' archive: 'เอกสาร' all_articles: 'รายการทั้งหมด' + # with_annotations: 'With annotations' config: 'กำหนดค่า' tags: 'แท็ก' internal_settings: 'ตั้งค่าภายใน' @@ -158,6 +159,7 @@ entry: starred: 'รายการที่แสดง' archived: 'รายการเอกสาร' filtered: 'รายการที่กลั่นกรอง' + # with_annotations: 'Entries with annotations' filtered_tags: 'แท็กทีกลั่นกรอง่:' filtered_search: 'การค้นหาที่กลั่นกรอง:' untagged: 'รายการที่ไม่ได้แท็ก' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index f0414ddaa..b03b1b54d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -19,6 +19,7 @@ menu: starred: Favoriler archive: Arşiv all_articles: Hepsi + # with_annotations: 'With annotations' config: Yapılandırma tags: Etiketler import: İçe Aktar @@ -315,6 +316,7 @@ entry: starred: Favorilenmiş makaleler archived: Arşivlenmiş makaleler filtered: Fitrelenmiş makaleler + # with_annotations: 'Entries with annotations' filtered_tags: 'Etiket ile filtrele:' filtered_search: 'Arama kriteri ile filtrele:' untagged: Etiketlenmemiş makaleler diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.zh.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.zh.yml index 0fe114723..7cd9aebb4 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.zh.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.zh.yml @@ -19,6 +19,7 @@ menu: starred: '收藏' archive: '存档' all_articles: '所有项目' + # with_annotations: 'With annotations' config: '配置' tags: '标签' internal_settings: '内部设置' @@ -236,6 +237,7 @@ entry: starred: '收藏项目' archived: '存档项目' filtered: '筛选后项目' + # with_annotations: 'Entries with annotations' filtered_tags: '根据标签筛选:' filtered_search: '根据搜索筛选:' untagged: '无标签项目' diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_title.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_title.html.twig index 95fdd640e..09d1523cc 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_title.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_title.html.twig @@ -14,6 +14,8 @@ {{ 'entry.page_titles.untagged'|trans }} {% elseif currentRoute == 'same_domain' %} {{ 'entry.page_titles.same_domain'|trans }} +{% elseif currentRoute == 'with_annotations' %} + {{ 'entry.page_titles.with_annotations'|trans }} {% else %} {{ 'entry.page_titles.unread'|trans }} {% endif %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig index a57385c33..b38a33ce2 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig @@ -40,6 +40,8 @@ {% set activeRoute = null %} {% if currentRoute == 'all' or currentRouteFromQueryParams == 'all' %} {% set activeRoute = 'all' %} + {% elseif currentRoute == 'with_annotations' or currentRouteFromQueryParams == 'with_annotations' %} + {% set activeRoute = 'with_annotations' %} {% elseif currentRoute == 'archive' or currentRouteFromQueryParams == 'archive' %} {% set activeRoute = 'archive' %} {% elseif currentRoute == 'starred' or currentRouteFromQueryParams == 'starred' %} @@ -59,6 +61,9 @@
  • {{ 'menu.left.archive'|trans }} {{ count_entries('archive') }}
  • +
  • + {{ 'menu.left.with_annotations'|trans }} {{ count_entries('with_annotations') }} +
  • {{ 'menu.left.all_articles'|trans }} {{ count_entries('all') }}
  • diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php index c8ba265b4..7c7516791 100644 --- a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php +++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php @@ -95,6 +95,9 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface case 'unread': $qb = $this->entryRepository->getBuilderForUnreadByUser($user->getId()); break; + case 'with_annotations': + $qb = $this->entryRepository->getBuilderForAnnotationsByUser($user->getId()); + break; case 'all': $qb = $this->entryRepository->getBuilderForAllByUser($user->getId()); break;