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 1/8] 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; From 0aeaf0e8c2c3840e7ce4f794aab2fcd6ceb1a78d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 20 Apr 2020 19:21:35 +0200 Subject: [PATCH 2/8] Added tests --- .../CoreBundle/Controller/EntryControllerTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index cb6682bef..3edef6e6c 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -411,6 +411,16 @@ class EntryControllerTest extends WallabagCoreTestCase $this->assertSame(200, $client->getResponse()->getStatusCode()); } + public function testWithAnnotations() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $client->request('GET', '/with_annotations/list'); + + $this->assertSame(200, $client->getResponse()->getStatusCode()); + } + public function testRangeException() { $this->logInAs('admin'); @@ -1590,6 +1600,10 @@ class EntryControllerTest extends WallabagCoreTestCase $this->assertSame(302, $client->getResponse()->getStatusCode()); $this->assertStringContainsString('/view/', $client->getResponse()->getTargetUrl(), 'Untagged random'); + $client->request('GET', '/with_annotations/random'); + $this->assertSame(302, $client->getResponse()->getStatusCode()); + $this->assertContains('/view/', $client->getResponse()->getTargetUrl(), 'With annotations random'); + $client->request('GET', '/all/random'); $this->assertSame(302, $client->getResponse()->getStatusCode()); $this->assertStringContainsString('/view/', $client->getResponse()->getTargetUrl(), 'All random'); From 6dfc03183982ad0a51288e4165ab18e610e3d0ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sun, 26 Apr 2020 14:09:16 +0200 Subject: [PATCH 3/8] Enhanced tests and changed route --- app/config/security.yml | 4 ++-- src/Wallabag/CoreBundle/Controller/EntryController.php | 8 ++++---- src/Wallabag/CoreBundle/Controller/ExportController.php | 4 ++-- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 2 +- .../Resources/views/themes/common/Entry/_title.html.twig | 2 +- .../Resources/views/themes/material/layout.html.twig | 8 ++++---- src/Wallabag/CoreBundle/Twig/WallabagExtension.php | 2 +- .../CoreBundle/Controller/EntryControllerTest.php | 6 +++--- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/config/security.yml b/app/config/security.yml index 50ae50492..5e74e82fb 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|with_annotations|all).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } + - { path: /(unread|starred|archive|annotated|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|with_annotations).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } # For backwards compatibility + - { path: /(unread|starred|archive|annotated).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 4657d87ee..54ee6bf7e 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -282,13 +282,13 @@ class EntryController extends Controller * * @param int $page * - * @Route("/with_annotations/list/{page}", name="with_annotations", defaults={"page" = "1"}) + * @Route("/annotated/list/{page}", name="annotated", defaults={"page" = "1"}) * * @return \Symfony\Component\HttpFoundation\Response */ public function showWithAnnotationsEntriesAction(Request $request, $page) { - return $this->showEntries('with_annotations', $request, $page); + return $this->showEntries('annotated', $request, $page); } /** @@ -296,7 +296,7 @@ class EntryController extends Controller * * @param string $type * - * @Route("/{type}/random", name="random_entry", requirements={"type": "unread|starred|archive|untagged|with_annotations|all"}) + * @Route("/{type}/random", name="random_entry", requirements={"type": "unread|starred|archive|untagged|annotated|all"}) * * @return \Symfony\Component\HttpFoundation\RedirectResponse */ @@ -577,7 +577,7 @@ class EntryController extends Controller $qb = $repository->getBuilderForArchiveByUser($this->getUser()->getId()); $formOptions['filter_archived'] = true; break; - case 'with_annotations': + case 'annotated': $qb = $repository->getBuilderForAnnotationsByUser($this->getUser()->getId()); break; case 'unread': diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php index 360640648..2db335527 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|with_annotations|same_domain" + * "category": "all|unread|starred|archive|tag_entries|untagged|search|annotated|same_domain" * }) * * @return \Symfony\Component\HttpFoundation\Response @@ -80,7 +80,7 @@ class ExportController extends Controller ->getResult(); $title = 'Search ' . $searchTerm; - } elseif ('with_annotations' === $category) { + } elseif ('annotated' === $category) { $entries = $repository->getBuilderForAnnotationsByUser( $this->getUser()->getId() )->getQuery() diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 390f655d5..d44506c72 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -594,7 +594,7 @@ class EntryRepository extends EntityRepository $qb->leftJoin('e.tags', 't'); $qb->andWhere('t.id is null'); break; - case 'with_annotations': + case 'annotated': $qb->leftJoin('e.annotations', 'a'); $qb->andWhere('a.id is not null'); break; 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 09d1523cc..3c5fad1e9 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,7 +14,7 @@ {{ 'entry.page_titles.untagged'|trans }} {% elseif currentRoute == 'same_domain' %} {{ 'entry.page_titles.same_domain'|trans }} -{% elseif currentRoute == 'with_annotations' %} +{% elseif currentRoute == 'annotated' %} {{ 'entry.page_titles.with_annotations'|trans }} {% else %} {{ 'entry.page_titles.unread'|trans }} 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 b38a33ce2..104d577b9 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig @@ -40,8 +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 == 'annotated' or currentRouteFromQueryParams == 'annotated' %} + {% set activeRoute = 'annotated' %} {% elseif currentRoute == 'archive' or currentRouteFromQueryParams == 'archive' %} {% set activeRoute = 'archive' %} {% elseif currentRoute == 'starred' or currentRouteFromQueryParams == 'starred' %} @@ -61,8 +61,8 @@
  • {{ 'menu.left.archive'|trans }} {{ count_entries('archive') }}
  • -
  • - {{ 'menu.left.with_annotations'|trans }} {{ count_entries('with_annotations') }} +
  • + {{ 'menu.left.with_annotations'|trans }} {{ count_entries('annotated') }}
  • {{ '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 7c7516791..26635fba0 100644 --- a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php +++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php @@ -95,7 +95,7 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface case 'unread': $qb = $this->entryRepository->getBuilderForUnreadByUser($user->getId()); break; - case 'with_annotations': + case 'annotated': $qb = $this->entryRepository->getBuilderForAnnotationsByUser($user->getId()); break; case 'all': diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 3edef6e6c..d010db097 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -416,9 +416,9 @@ class EntryControllerTest extends WallabagCoreTestCase $this->logInAs('admin'); $client = $this->getClient(); - $client->request('GET', '/with_annotations/list'); - + $crawler = $client->request('GET', '/annotated/list'); $this->assertSame(200, $client->getResponse()->getStatusCode()); + $this->assertCount(2, $crawler->filter('li.entry')); } public function testRangeException() @@ -1600,7 +1600,7 @@ class EntryControllerTest extends WallabagCoreTestCase $this->assertSame(302, $client->getResponse()->getStatusCode()); $this->assertStringContainsString('/view/', $client->getResponse()->getTargetUrl(), 'Untagged random'); - $client->request('GET', '/with_annotations/random'); + $client->request('GET', '/annotated/random'); $this->assertSame(302, $client->getResponse()->getStatusCode()); $this->assertContains('/view/', $client->getResponse()->getTargetUrl(), 'With annotations random'); From cd975c5f13038384bebeebdc0dd868c653b255ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 2 Aug 2021 16:57:42 +0200 Subject: [PATCH 4/8] Added annotated filter --- .../CoreBundle/Form/Type/EntryFilterType.php | 23 ++++++++--- .../Resources/translations/messages.en.yml | 1 + .../themes/material/Entry/entries.html.twig | 5 +++ .../Controller/EntryControllerTest.php | 39 +++++++++++++++++++ 4 files changed, 63 insertions(+), 5 deletions(-) diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php index 176b7ea07..ba2f53662 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php @@ -93,7 +93,7 @@ class EntryFilterType extends AbstractType 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { $value = $values['value']; if (\strlen($value) <= 2 || empty($value)) { - return; + return false; } $expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->lower($filterQuery->getExpr()->literal('%' . $value . '%'))); @@ -105,7 +105,7 @@ class EntryFilterType extends AbstractType 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { $value = $values['value']; if (false === \array_key_exists($value, Response::$statusTexts)) { - return; + return false; } $paramName = sprintf('%s', str_replace('.', '_', $field)); @@ -129,7 +129,7 @@ class EntryFilterType extends AbstractType 'data' => $options['filter_unread'], 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { if (false === $values['value']) { - return; + return false; } $expression = $filterQuery->getExpr()->eq('e.isArchived', 'false'); @@ -137,10 +137,22 @@ class EntryFilterType extends AbstractType return $filterQuery->createCondition($expression); }, ]) + ->add('isAnnotated', CheckboxFilterType::class, [ + 'label' => 'entry.filters.annotated_label', + 'data' => $options['filter_annotated'], + 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { + if (false === $values['value']) { + return false; + } + + $qb = $filterQuery->getQueryBuilder(); + $qb->innerJoin('e.annotations', 'a'); + }, + ]) ->add('previewPicture', CheckboxFilterType::class, [ 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { if (false === $values['value']) { - return; + return false; } $expression = $filterQuery->getExpr()->isNotNull($field); @@ -152,7 +164,7 @@ class EntryFilterType extends AbstractType ->add('isPublic', CheckboxFilterType::class, [ 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { if (false === $values['value']) { - return; + return false; } // is_public isn't a real field @@ -183,6 +195,7 @@ class EntryFilterType extends AbstractType 'filter_archived' => false, 'filter_starred' => false, 'filter_unread' => false, + 'filter_annotated' => false, ]); } } diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 98d374a2d..775006fc1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -247,6 +247,7 @@ entry: archived_label: Archived starred_label: Starred unread_label: Unread + annotated_label: Annotated preview_picture_label: Has a preview picture preview_picture_help: Preview picture is_public_label: Has a public link diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig index f80156834..604d399da 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig @@ -131,6 +131,11 @@ {{ form_label(form.isUnread) }} +
    + {{ form_widget(form.isAnnotated) }} + {{ form_label(form.isAnnotated) }} +
    +
    diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index d010db097..7c105ac78 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -3,6 +3,7 @@ namespace Tests\Wallabag\CoreBundle\Controller; use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; +use Wallabag\AnnotationBundle\Entity\Annotation; use Wallabag\CoreBundle\Entity\Config; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\SiteCredential; @@ -888,6 +889,44 @@ class EntryControllerTest extends WallabagCoreTestCase $this->assertCount(0, $crawler->filter('li.entry')); } + public function testFilterOnAnnotatedStatus() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $crawler = $client->request('GET', '/all/list'); + + $form = $crawler->filter('button[id=submit-filter]')->form(); + + $data = [ + 'entry_filter[isAnnotated]' => true, + ]; + + $crawler = $client->submit($form, $data); + + $this->assertCount(2, $crawler->filter('li.entry')); + + $entry = new Entry($this->getLoggedInUser()); + $entry->setUrl($this->url); + + $em = $this->getClient()->getContainer()->get('doctrine.orm.entity_manager'); + $user = $em + ->getRepository('WallabagUserBundle:User') + ->findOneByUserName('admin'); + + $annotation = new Annotation($user); + $annotation->setEntry($entry); + $annotation->setText('This is my annotation /o/'); + $annotation->setQuote('content'); + + $this->getEntityManager()->persist($entry); + $this->getEntityManager()->flush(); + + $crawler = $client->submit($form, $data); + + $this->assertCount(3, $crawler->filter('li.entry')); + } + public function testPaginationWithFilter() { $this->logInAs('admin'); From 9992017fb7691cc522be1636e9474f2a7ac62040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 3 Aug 2021 08:20:33 +0200 Subject: [PATCH 5/8] Fixed translation file --- .../Resources/translations/messages.fa.yml | 29 +------------------ 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 11869f03e..640c76b01 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -15,11 +15,11 @@ security: go_to_account: حساب خود را ببینید menu: left: -<<<<<<< HEAD unread: خوانده‌نشده starred: برگزیده archive: بایگانی all_articles: همه + # with_annotations: 'With annotations' config: پیکربندی tags: برچسب‌ها internal_settings: تنظیمات درونی @@ -33,27 +33,7 @@ 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: جستجو @@ -128,22 +108,15 @@ 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: زمان تخمینی برای خواندن From 0feee8ba9ab7ab4ed4cae48a8bd88bb21747459e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 30 Aug 2021 15:34:34 +0200 Subject: [PATCH 6/8] Fixed review --- src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | 1 + .../Resources/views/themes/material/Entry/entries.html.twig | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 5bfc86a21..85a373d36 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -245,6 +245,7 @@ entry: archived_label: Lus starred_label: Favoris unread_label: Non lus + annotated_label: Annotés preview_picture_label: A une photo preview_picture_help: Photo is_public_label: A un lien public diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig index 604d399da..4390b1e35 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig @@ -131,7 +131,7 @@ {{ form_label(form.isUnread) }} -
    +
    {{ form_widget(form.isAnnotated) }} {{ form_label(form.isAnnotated) }}
    From 9160c4e7136e39f48988deeaaef4ff150b1639d4 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 2 Mar 2022 19:57:10 +0100 Subject: [PATCH 7/8] Remove commented translations Not necessary as they are handled by weblate. --- .../Resources/translations/messages.da.yml | 12 ------------ .../Resources/translations/messages.de.yml | 2 -- .../Resources/translations/messages.es.yml | 2 -- .../Resources/translations/messages.fa.yml | 6 ------ .../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 -- 14 files changed, 54 deletions(-) diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 459b0d8e6..f1566e3c0 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -13,7 +13,6 @@ menu: starred: 'Favoritter' archive: 'Arkiv' all_articles: 'Alle artikler' - # with_annotations: 'With annotations' config: 'Opsætning' tags: 'Tags' howto: 'KUow-to' @@ -66,17 +65,6 @@ 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 f8be2fe96..42c6652dd 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -19,7 +19,6 @@ menu: starred: Favoriten archive: Archiv all_articles: Alle Artikel - # with_annotations: 'With annotations' config: Konfiguration tags: Tags internal_settings: Interne Einstellungen @@ -237,7 +236,6 @@ 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.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 8faad3d33..08d05a21c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -19,7 +19,6 @@ 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' @@ -218,7 +217,6 @@ 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 640c76b01..efc84762d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -19,7 +19,6 @@ menu: starred: برگزیده archive: بایگانی all_articles: همه - # with_annotations: 'With annotations' config: پیکربندی tags: برچسب‌ها internal_settings: تنظیمات درونی @@ -112,11 +111,6 @@ entry: starred: مقاله‌های برگزیده archived: مقاله‌های بایگانی‌شده filtered: مقاله‌های فیلترشده - # with_annotations: 'Entries with annotations' - # filtered_tags: 'Filtered by tags:' - # filtered_search: 'Filtered by search:' - # untagged: 'Untagged entries' - # all: 'All entries' list: number_on_the_page: '{0} هیج مقاله‌ای نیست.|{1} یک مقاله هست.|]1,Inf[ %count% مقاله هست.' reading_time: زمان تخمینی برای خواندن diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index c2dfcd60c..4d742ef1e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -15,12 +15,10 @@ 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 @@ -177,12 +175,10 @@ 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 a6eb771d7..c02bc91b7 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ja.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ja.yml @@ -19,7 +19,6 @@ menu: starred: スター archive: アーカイブ all_articles: すべての記事 - # with_annotations: 'With annotations' config: 設定 tags: タグ internal_settings: 内部設定 @@ -236,7 +235,6 @@ 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 c99072570..9ce28b0cf 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -19,7 +19,6 @@ menu: starred: Favorits archive: Legits all_articles: Totes los articles - # with_annotations: 'With annotations' config: Configuracion tags: Etiquetas internal_settings: Configuracion intèrna @@ -181,7 +180,6 @@ 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 72e96e3dd..0da2d9916 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -19,7 +19,6 @@ menu: starred: Oznaczone gwiazdką archive: Archiwum all_articles: Wszystkie - # with_annotations: 'With annotations' config: Konfiguracja tags: Tagi internal_settings: Wewnętrzne ustawienia @@ -211,7 +210,6 @@ 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 bda707462..c3e7d0021 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -19,7 +19,6 @@ menu: starred: 'Destacado' archive: 'Arquivo' all_articles: 'Todas as entradas' - # with_annotations: 'With annotations' config: 'Configurações' tags: 'Tags' internal_settings: 'Configurações Internas' @@ -149,7 +148,6 @@ 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 0e415b363..a954551cf 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -13,7 +13,6 @@ menu: starred: 'Cu steluță' archive: 'Arhivă' all_articles: 'Toate' - # with_annotations: 'With annotations' config: 'Configurație' tags: 'Tag-uri' howto: 'Cum să' @@ -65,17 +64,6 @@ 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 745f5a9a1..c6389ba03 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -19,7 +19,6 @@ menu: starred: 'Помеченные' archive: 'Архивные' all_articles: 'Все записи' - # with_annotations: 'With annotations' config: 'Настройки' tags: 'Теги' internal_settings: 'Внутренние настройки' @@ -237,7 +236,6 @@ 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 0ebaf147e..7a250ba59 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -19,7 +19,6 @@ menu: starred: 'ทำการแสดง' archive: 'เอกสาร' all_articles: 'รายการทั้งหมด' - # with_annotations: 'With annotations' config: 'กำหนดค่า' tags: 'แท็ก' internal_settings: 'ตั้งค่าภายใน' @@ -159,7 +158,6 @@ 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 b03b1b54d..f0414ddaa 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -19,7 +19,6 @@ menu: starred: Favoriler archive: Arşiv all_articles: Hepsi - # with_annotations: 'With annotations' config: Yapılandırma tags: Etiketler import: İçe Aktar @@ -316,7 +315,6 @@ 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 7cd9aebb4..0fe114723 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.zh.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.zh.yml @@ -19,7 +19,6 @@ menu: starred: '收藏' archive: '存档' all_articles: '所有项目' - # with_annotations: 'With annotations' config: '配置' tags: '标签' internal_settings: '内部设置' @@ -237,7 +236,6 @@ entry: starred: '收藏项目' archived: '存档项目' filtered: '筛选后项目' - # with_annotations: 'Entries with annotations' filtered_tags: '根据标签筛选:' filtered_search: '根据搜索筛选:' untagged: '无标签项目' From 7ec0c9f8446dc4a7db0161925c80d5faf1f6bd1a Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 2 Mar 2022 20:05:45 +0100 Subject: [PATCH 8/8] Fix tests --- tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | 2 +- .../ImportBundle/Controller/DeliciousControllerTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 7c105ac78..0a75c88d7 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -1641,7 +1641,7 @@ class EntryControllerTest extends WallabagCoreTestCase $client->request('GET', '/annotated/random'); $this->assertSame(302, $client->getResponse()->getStatusCode()); - $this->assertContains('/view/', $client->getResponse()->getTargetUrl(), 'With annotations random'); + $this->assertStringContainsString('/view/', $client->getResponse()->getTargetUrl(), 'With annotations random'); $client->request('GET', '/all/random'); $this->assertSame(302, $client->getResponse()->getStatusCode()); diff --git a/tests/Wallabag/ImportBundle/Controller/DeliciousControllerTest.php b/tests/Wallabag/ImportBundle/Controller/DeliciousControllerTest.php index a8029f45e..1d14d1d8a 100644 --- a/tests/Wallabag/ImportBundle/Controller/DeliciousControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/DeliciousControllerTest.php @@ -120,7 +120,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); - $tags = $content->getTags(); + $tags = $content->getTagsLabel(); $this->assertContains('osx', $tags, 'It includes the "osx" tag'); $this->assertGreaterThanOrEqual(4, \count($tags));