]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Add all entries RSS feed and put links on tag page itself and baggy too 3207/head
authorThomas Citharel <tcit@tcit.fr>
Tue, 20 Jun 2017 16:29:46 +0000 (18:29 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Wed, 21 Jun 2017 10:02:04 +0000 (12:02 +0200)
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
21 files changed:
src/Wallabag/CoreBundle/Controller/RssController.php
src/Wallabag/CoreBundle/Controller/TagController.php
src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_rss_link.html.twig [new file with mode: 0644]
src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig

index 090eccab2676daa8c2358ae2cd50d42052ce309c..e87dd9a1f1063bc8c6aed1a0c59e1d4fbd6fc1fa 100644 (file)
@@ -26,7 +26,7 @@ class RssController extends Controller
      *
      * @return \Symfony\Component\HttpFoundation\Response
      */
-    public function showUnreadAction(Request $request, User $user)
+    public function showUnreadRSSAction(Request $request, User $user)
     {
         return $this->showEntries('unread', $user, $request->query->get('page', 1));
     }
@@ -39,7 +39,7 @@ class RssController extends Controller
      *
      * @return \Symfony\Component\HttpFoundation\Response
      */
-    public function showArchiveAction(Request $request, User $user)
+    public function showArchiveRSSAction(Request $request, User $user)
     {
         return $this->showEntries('archive', $user, $request->query->get('page', 1));
     }
@@ -52,11 +52,24 @@ class RssController extends Controller
      *
      * @return \Symfony\Component\HttpFoundation\Response
      */
-    public function showStarredAction(Request $request, User $user)
+    public function showStarredRSSAction(Request $request, User $user)
     {
         return $this->showEntries('starred', $user, $request->query->get('page', 1));
     }
 
+    /**
+     * Shows all entries for current user.
+     *
+     * @Route("/{username}/{token}/all.xml", name="all_rss", defaults={"_format"="xml"})
+     * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_rsstoken_converter")
+     *
+     * @return \Symfony\Component\HttpFoundation\Response
+     */
+    public function showAllRSSAction(Request $request, User $user)
+    {
+        return $this->showEntries('all', $user, $request->query->get('page', 1));
+    }
+
     /**
      * Shows entries associated to a tag for current user.
      *
@@ -143,6 +156,10 @@ class RssController extends Controller
                 $qb = $repository->getBuilderForUnreadByUser($user->getId());
                 break;
 
+            case 'all':
+                $qb = $repository->getBuilderForAllByUser($user->getId());
+                break;
+
             default:
                 throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type));
         }
index 72822479794efa8ce426c4ca72c364834a9217f0..a8b1eaddb9a045008fb12adcce30695528c21fc0 100644 (file)
@@ -144,7 +144,7 @@ class TagController extends Controller
             'form' => null,
             'entries' => $entries,
             'currentPage' => $page,
-            'tag' => $tag->getSlug(),
+            'tag' => $tag,
         ]);
     }
 }
index a91a0ce4e225e2c552c1504d5a6122dbc2c0fea6..52904d2572db520e6a13bdc66d703894994cf30b 100644 (file)
@@ -90,9 +90,10 @@ config:
         token_reset: 'Nulstil token'
         rss_links: 'RSS-Links'
         rss_link:
-            unread: 'ulæst'
-            starred: 'favoritter'
-            archive: 'arkiv'
+            unread: 'Ulæst'
+            starred: 'Favoritter'
+            archive: 'Arkiv'
+            # all: 'All'
         # rss_limit: 'Number of items in the feed'
     form_user:
         # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connexion"
index e77cdca30fc4d3d900da1aaae8e1ab47e750a1d7..481b5d0544ab7c8eac11badb3d094c8654ad46fb 100644 (file)
@@ -93,6 +93,7 @@ config:
             unread: 'Ungelesene'
             starred: 'Favoriten'
             archive: 'Archivierte'
+            # all: 'All'
         rss_limit: 'Anzahl der Einträge pro Feed'
     form_user:
         two_factor_description: "Wenn du die Zwei-Faktor-Authentifizierung aktivierst, erhältst du eine E-Mail mit einem Code bei jeder nicht vertrauenswürdigen Verbindung"
index 50edab3a0b349683eb7c093d974238ee39632675..98888d0573a90f06f2d0a8845528d5eb337cc011 100644 (file)
@@ -90,9 +90,10 @@ config:
         token_reset: 'Regenerate your token'
         rss_links: 'RSS links'
         rss_link:
-            unread: 'unread'
-            starred: 'starred'
-            archive: 'archived'
+            unread: 'Unread'
+            starred: 'Starred'
+            archive: 'Archived'
+            all: 'All'
         rss_limit: 'Number of items in the feed'
     form_user:
         two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connection."
index 6fbf00eb4937a62115e470d02ea7af312ed10454..310a00deb942c28e8086300dc366c8a59fbf14b2 100644 (file)
@@ -93,6 +93,7 @@ config:
             unread: 'sin leer'
             starred: 'favoritos'
             archive: 'archivados'
+            # all: 'All'
         rss_limit: 'Límite de artículos en feed RSS'
     form_user:
         two_factor_description: "Con la autenticación en dos pasos recibirá código por e-mail en cada nueva conexión que no sea de confianza."
index ad7d6cd98a8cce49a71bedcbd1db8002f0c2fb2c..d5247fc36573036fcc4fe8047dee39c29bf44e22 100644 (file)
@@ -93,6 +93,7 @@ config:
             unread: 'خوانده‌نشده'
             starred: 'برگزیده'
             archive: 'بایگانی'
+            # all: 'All'
         rss_limit: 'محدودیت آر-اس-اس'
     form_user:
         two_factor_description: "با فعال‌کردن تأیید ۲مرحله‌ای هر بار که اتصال تأییدنشده‌ای برقرار شد، به شما یک کد از راه ایمیل فرستاده می‌شود"
index c4b029c3c3b7fbdc8b96d49db546c414779d4ee7..b338eba4ad614386adcd0ac891fd083c821f251b 100644 (file)
@@ -88,11 +88,12 @@ config:
         no_token: "Aucun jeton généré"
         token_create: "Créez votre jeton"
         token_reset: "Réinitialisez votre jeton"
-        rss_links: "Adresse de vos flux RSS"
+        rss_links: "Adresses de vos flux RSS"
         rss_link:
-            unread: "non lus"
-            starred: "favoris"
-            archive: "lus"
+            unread: "Non lus"
+            starred: "Favoris"
+            archive: "Lus"
+            all: "Tous"
         rss_limit: "Nombre d’articles dans le flux"
     form_user:
         two_factor_description: "Activer l’authentification double-facteur veut dire que vous allez recevoir un code par courriel à chaque nouvelle connexion non approuvée."
index 4bd04aadb81f0bd50bbf6fb7ba8bf808a0080bfc..a3ff5495b1b502715fec0b24907e40b9b7db5bad 100644 (file)
@@ -90,9 +90,10 @@ config:
         token_reset: 'Rigenera il tuo token'
         rss_links: 'Collegamenti RSS'
         rss_link:
-            unread: 'non letti'
-            starred: 'preferiti'
-            archive: 'archiviati'
+            unread: 'Non letti'
+            starred: 'Preferiti'
+            archive: 'Archiviati'
+            # all: 'All'
         rss_limit: 'Numero di elementi nel feed'
     form_user:
         two_factor_description: "Abilitando l'\autenticazione a due fattori riceverai una e-mail con un codice per ogni nuova connesione non verificata"
index a6dd4dcd0361593a0cd44f391990fe35084f3527..a6566a12df18706bb92b35248ce86bbf36e54ae8 100644 (file)
@@ -88,11 +88,12 @@ config:
         no_token: 'Pas cap de geton generat'
         token_create: 'Creatz vòstre geton'
         token_reset: 'Reïnicializatz vòstre geton'
-        rss_links: 'URL de vòstres fluxes RSS'
+        rss_links: 'URLs de vòstres fluxes RSS'
         rss_link:
-            unread: 'pas legits'
-            starred: 'favorits'
-            archive: 'legits'
+            unread: 'Pas legits'
+            starred: 'Favorits'
+            archive: 'Legits'
+            # all: 'All'
         rss_limit: "Nombre d'articles dins un flux RSS"
     form_user:
         two_factor_description: "Activar l'autentificacion doble-factor vòl dire que recebretz un còdi per corrièl per cada novèla connexion pas aprovada."
index 7312abd79b0d7829b3645bad1cbcfc24e3e10fa2..8e1276d9c101c9fb7c1d1d9a55067586f413fcca 100644 (file)
@@ -90,9 +90,10 @@ config:
         token_reset: 'Zresetuj swojego tokena'
         rss_links: 'RSS links'
         rss_link:
-            unread: 'nieprzeczytane'
-            starred: 'oznaczone gwiazdką'
-            archive: 'archiwum'
+            unread: 'Nieprzeczytane'
+            starred: 'Oznaczone gwiazdką'
+            archive: 'Archiwum'
+            # all: 'All'
         rss_limit: 'Link do RSS'
     form_user:
         two_factor_description: "Włączenie autoryzacji dwuetapowej oznacza, że będziesz otrzymywał maile z kodem przy każdym nowym, niezaufanym połączeniu"
index 18090352db832430f0a63e192bd9acacf3c0da47..953c86bb015ac46b5254e587612e38985de9b360 100644 (file)
@@ -90,9 +90,10 @@ config:
         token_reset: 'Gerar novamente seu token'
         rss_links: 'Links RSS'
         rss_link:
-            unread: 'não lido'
-            starred: 'destacado'
-            archive: 'arquivado'
+            unread: 'Não lido'
+            starred: 'Destacado'
+            archive: 'Arquivado'
+            # all: 'All'
         rss_limit: 'Número de itens no feed'
     form_user:
         two_factor_description: 'Habilitar autenticação de dois passos significa que você receberá um e-mail com um código a cada nova conexão desconhecida.'
index f8866fdc1f174ced119dce9b2831c5b41ef2a7dc..51dbbcafcbc7c05cea949a7c9ef45ef704fad9d8 100644 (file)
@@ -90,9 +90,10 @@ config:
         token_reset: 'Resetează-ți token-ul'
         rss_links: 'Link-uri RSS'
         rss_link:
-            unread: 'unread'
-            starred: 'starred'
-            archive: 'archived'
+            unread: 'Unread'
+            starred: 'Starred'
+            archive: 'Archived'
+            # all: 'All'
         rss_limit: 'Limită RSS'
     form_user:
         # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connexion"
index 4d01e7f75e460cd5c104aed9a92c7a12ea1933ba..ff19e9d91a710946290efb9bf4d38d9d11245a57 100644 (file)
@@ -90,9 +90,10 @@ config:
         token_reset: 'Belirteci (token) sıfırla'
         rss_links: 'RSS akış bağlantıları'
         rss_link:
-            unread: 'okunmayan'
-            starred: 'favoriler'
-            archive: 'arşiv'
+            unread: 'Okunmayan'
+            starred: 'Favoriler'
+            archive: 'Arşiv'
+            # all: 'All'
         rss_limit: 'RSS içeriğinden talep edilecek makale limiti'
     form_user:
         two_factor_description: "İki adımlı doğrulamayı aktifleştirdiğinizde, her yeni güvenilmeyen bağlantılarda size e-posta ile bir kod alacaksınız."
index 01f63a7b2b46b6c0c5509483ca3d781c43dc3995..2bf64cd6a237ec46bb606673f8c0e4f01ce54774 100644 (file)
@@ -82,7 +82,7 @@
         <fieldset class="w500p inline">
             <div class="row">
                 <h3>{{ 'config.form_settings.android_configuration'|trans }}</h3>
-                <a href="wallabag://{{ app.user.username }}@{{ wallabag_url }}" >Touch here to prefill your Android application</a>
+                <a href="wallabag://{{ app.user.username }}@{{ wallabag_url }}">Touch here to prefill your Android application</a>
                 <br/>
                 <img id="androidQrcode" />
                 <script>
 
         <fieldset class="w500p inline">
             <div class="row">
-                <label>Rss token</label>
+                <label>{{ 'config.form_rss.token_label'|trans }}</label>
                 {% if rss.token %}
                     {{ rss.token }}
                 {% else %}
             <div class="row">
                 <label>{{ 'config.form_rss.rss_links'|trans }}</label>
                 <ul>
-                    <li><a href="{{ path('unread_rss', {'username': rss.username, 'token': rss.token}) }}">unread</a></li>
-                    <li><a href="{{ path('starred_rss', {'username': rss.username, 'token': rss.token}) }}">fav</a></li>
-                    <li><a href="{{ path('archive_rss', {'username': rss.username, 'token': rss.token}) }}">archives</a></li>
+                    <li><a href="{{ path('unread_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.unread'|trans }}</a></li>
+                    <li><a href="{{ path('starred_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.starred'|trans }}</a></li>
+                    <li><a href="{{ path('archive_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.archive'|trans }}</a></li>
+                    <li><a href="{{ path('all_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.all'|trans }}</a></li>
                 </ul>
             </div>
         </fieldset>
index 6c26d5bf4f716861408a0abd29677bf5f753ffec..6424df8d3ba710f064bb94f00612f0fc6ae36c94 100644 (file)
@@ -1,5 +1,12 @@
 {% extends "WallabagCoreBundle::layout.html.twig" %}
 
+{% block head %}
+    {{ parent() }}
+    {% if tag is defined and app.user.config.rssToken %}
+        <link rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" />
+    {% endif %}
+{% endblock %}
+
 {% block title %}
     {% set filter = '' %}
     {% if tag is defined %}
 {% endblock %}
 
 {% block content %}
-
+    {% set currentRoute = app.request.attributes.get('_route') %}
     {% set listMode = app.user.config.listMode %}
     <div class="results">
         <div class="nb-results">{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}</div>
         <div class="pagination">
             <a href="{{ path('switch_view_mode') }}"><i class="listMode-btn material-icons md-24">{% if listMode == 0 %}list{% else %}view_module{% endif %}</i></a>
+            {% if app.user.config.rssToken %}
+                {% include "@WallabagCore/themes/common/Entry/_rss_link.html.twig" %}
+            {% endif %}
             <i class="btn-clickable download-btn material-icons md-24 js-export-action">file_download</i>
             <i class="btn-clickable filter-btn material-icons md-24 js-filters-action">filter_list</i>
             {% if entries.getNbPages > 1 %}
@@ -76,7 +86,6 @@
 
     <!-- Export -->
     <aside id="download-form">
-    {% set currentRoute = app.request.attributes.get('_route') %}
     {% set currentTag = '' %}
     {% if tag is defined %}
         {% set currentTag = tag %}
index 7509918ede38c31fc8fa62845326494100b0e0b2..070d5629a4474a9a4afcc69e4de383eabe495b18 100644 (file)
@@ -9,7 +9,12 @@
 
     <ul>
     {% for tag in tags %}
-        <li id="tag-{{ tag.id|e }}"><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.nbEntries }})</a></li>
+        <li id="tag-{{ tag.id|e }}">
+            <a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.nbEntries }})</a>
+            <a rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" class="right">
+                <i class="material-icons md-24">rss_feed</i>
+            </a>
+        </li>
     {% endfor %}
     </ul>
 
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_rss_link.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_rss_link.html.twig
new file mode 100644 (file)
index 0000000..2bf9b2b
--- /dev/null
@@ -0,0 +1,6 @@
+{% if tag is defined %}
+    <a rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" class="right"><i class="material-icons md-24">rss_feed</i></a>
+{% elseif currentRoute in ['unread', 'starred', 'archive', 'all'] %}
+    <a rel="alternate" type="application/rss+xml" href="{{ path(currentRoute ~ '_rss', {'username': app.user.username, 'token': app.user.config.rssToken}) }}" class="right"><i class="material-icons">rss_feed</i></a>
+{% endif %}
+
index 1e10bf38abc5bf160c7833f207ad2d19850b5ba8..f290cb49c971169c14eb2729663591b23d293f25 100644 (file)
                                         <li><a href="{{ path('unread_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.unread'|trans }}</a></li>
                                         <li><a href="{{ path('starred_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.starred'|trans }}</a></li>
                                         <li><a href="{{ path('archive_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.archive'|trans }}</a></li>
+                                        <li><a href="{{ path('all_rss', {'username': rss.username, 'token': rss.token}) }}">{{ 'config.form_rss.rss_link.all'|trans }}</a></li>
                                     </ul>
                                 </div>
                             </div>
index 5ba420575a759d46325420ca2cdd8fe8e7c7565c..0c4dc80b6333491cc6b79adf75120a9b28e49b49 100644 (file)
@@ -1,9 +1,16 @@
 {% extends "WallabagCoreBundle::layout.html.twig" %}
 
+{% block head %}
+    {{ parent() }}
+    {% if tag is defined and app.user.config.rssToken %}
+        <link rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" />
+    {% endif %}
+{% endblock %}
+
 {% block title %}
     {% set filter = '' %}
     {% if tag is defined %}
-        {% set filter = tag %}
+        {% set filter = tag.slug %}
     {% endif %}
     {% if searchTerm is defined and searchTerm is not empty %}
         {% set filter = searchTerm %}
 
 {% block content %}
     {% set listMode = app.user.config.listMode %}
+    {% set currentRoute = app.request.attributes.get('_route') %}
     <div class="results clearfix">
         <div class="nb-results left">
             {{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}
             <a href="{{ path('switch_view_mode') }}"><i class="material-icons">{% if listMode == 0 %}view_list{% else %}view_module{% endif %}</i></a>
+            {% if app.user.config.rssToken %}
+                {% include "@WallabagCore/themes/common/Entry/_rss_link.html.twig" %}
+            {% endif %}
         </div>
         {% if entries.getNbPages > 1 %}
             {{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }}
 
     <!-- Export -->
     <div id="export" class="side-nav right-aligned">
-    {% set currentRoute = app.request.attributes.get('_route') %}
     {% set currentTag = '' %}
     {% if tag is defined %}
-        {% set currentTag = tag %}
+        {% set currentTag = tag.slug %}
     {% endif %}
     {% if currentRoute == 'homepage' %}
         {% set currentRoute = 'unread' %}
index 98d7b0376a45441b56eb095f2669f33bb20f851f..97ddedc9fc84d31d19f5ce04246c085f7e6c7b88 100644 (file)
@@ -15,7 +15,7 @@
                 <li title="{{tag.label}} ({{ tag.nbEntries }})" id="tag-{{ tag.id }}" class="col l2 m2 s5">
                     <a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.nbEntries }})</a>
                     {% if app.user.config.rssToken %}
-                        <a href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" class="right"><i class="material-icons">rss_feed</i></a>
+                        <a rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" class="right"><i class="material-icons">rss_feed</i></a>
                     {% endif %}
                 </li>
             {% endfor %}