Add all entries RSS feed and put links on tag page itself and baggy too

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2017-06-20 18:29:46 +02:00 committed by Jeremy Benoist
parent ebf2d92327
commit bd40f1af88
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
21 changed files with 106 additions and 45 deletions

View file

@ -26,7 +26,7 @@ class RssController extends Controller
* *
* @return \Symfony\Component\HttpFoundation\Response * @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)); return $this->showEntries('unread', $user, $request->query->get('page', 1));
} }
@ -39,7 +39,7 @@ class RssController extends Controller
* *
* @return \Symfony\Component\HttpFoundation\Response * @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)); return $this->showEntries('archive', $user, $request->query->get('page', 1));
} }
@ -52,11 +52,24 @@ class RssController extends Controller
* *
* @return \Symfony\Component\HttpFoundation\Response * @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)); 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. * Shows entries associated to a tag for current user.
* *
@ -143,6 +156,10 @@ class RssController extends Controller
$qb = $repository->getBuilderForUnreadByUser($user->getId()); $qb = $repository->getBuilderForUnreadByUser($user->getId());
break; break;
case 'all':
$qb = $repository->getBuilderForAllByUser($user->getId());
break;
default: default:
throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type)); throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type));
} }

View file

@ -144,7 +144,7 @@ class TagController extends Controller
'form' => null, 'form' => null,
'entries' => $entries, 'entries' => $entries,
'currentPage' => $page, 'currentPage' => $page,
'tag' => $tag->getSlug(), 'tag' => $tag,
]); ]);
} }
} }

View file

@ -90,9 +90,10 @@ config:
token_reset: 'Nulstil token' token_reset: 'Nulstil token'
rss_links: 'RSS-Links' rss_links: 'RSS-Links'
rss_link: rss_link:
unread: 'ulæst' unread: 'Ulæst'
starred: 'favoritter' starred: 'Favoritter'
archive: 'arkiv' archive: 'Arkiv'
# all: 'All'
# rss_limit: 'Number of items in the feed' # rss_limit: 'Number of items in the feed'
form_user: form_user:
# two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connexion" # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connexion"

View file

@ -93,6 +93,7 @@ config:
unread: 'Ungelesene' unread: 'Ungelesene'
starred: 'Favoriten' starred: 'Favoriten'
archive: 'Archivierte' archive: 'Archivierte'
# all: 'All'
rss_limit: 'Anzahl der Einträge pro Feed' rss_limit: 'Anzahl der Einträge pro Feed'
form_user: 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" 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"

View file

@ -90,9 +90,10 @@ config:
token_reset: 'Regenerate your token' token_reset: 'Regenerate your token'
rss_links: 'RSS links' rss_links: 'RSS links'
rss_link: rss_link:
unread: 'unread' unread: 'Unread'
starred: 'starred' starred: 'Starred'
archive: 'archived' archive: 'Archived'
all: 'All'
rss_limit: 'Number of items in the feed' rss_limit: 'Number of items in the feed'
form_user: form_user:
two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connection." two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connection."

View file

@ -93,6 +93,7 @@ config:
unread: 'sin leer' unread: 'sin leer'
starred: 'favoritos' starred: 'favoritos'
archive: 'archivados' archive: 'archivados'
# all: 'All'
rss_limit: 'Límite de artículos en feed RSS' rss_limit: 'Límite de artículos en feed RSS'
form_user: 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." 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."

View file

@ -93,6 +93,7 @@ config:
unread: 'خوانده‌نشده' unread: 'خوانده‌نشده'
starred: 'برگزیده' starred: 'برگزیده'
archive: 'بایگانی' archive: 'بایگانی'
# all: 'All'
rss_limit: 'محدودیت آر-اس-اس' rss_limit: 'محدودیت آر-اس-اس'
form_user: form_user:
two_factor_description: "با فعال‌کردن تأیید ۲مرحله‌ای هر بار که اتصال تأییدنشده‌ای برقرار شد، به شما یک کد از راه ایمیل فرستاده می‌شود" two_factor_description: "با فعال‌کردن تأیید ۲مرحله‌ای هر بار که اتصال تأییدنشده‌ای برقرار شد، به شما یک کد از راه ایمیل فرستاده می‌شود"

View file

@ -88,11 +88,12 @@ config:
no_token: "Aucun jeton généré" no_token: "Aucun jeton généré"
token_create: "Créez votre jeton" token_create: "Créez votre jeton"
token_reset: "Réinitialisez votre jeton" token_reset: "Réinitialisez votre jeton"
rss_links: "Adresse de vos flux RSS" rss_links: "Adresses de vos flux RSS"
rss_link: rss_link:
unread: "non lus" unread: "Non lus"
starred: "favoris" starred: "Favoris"
archive: "lus" archive: "Lus"
all: "Tous"
rss_limit: "Nombre darticles dans le flux" rss_limit: "Nombre darticles dans le flux"
form_user: form_user:
two_factor_description: "Activer lauthentification double-facteur veut dire que vous allez recevoir un code par courriel à chaque nouvelle connexion non approuvée." two_factor_description: "Activer lauthentification double-facteur veut dire que vous allez recevoir un code par courriel à chaque nouvelle connexion non approuvée."

View file

@ -90,9 +90,10 @@ config:
token_reset: 'Rigenera il tuo token' token_reset: 'Rigenera il tuo token'
rss_links: 'Collegamenti RSS' rss_links: 'Collegamenti RSS'
rss_link: rss_link:
unread: 'non letti' unread: 'Non letti'
starred: 'preferiti' starred: 'Preferiti'
archive: 'archiviati' archive: 'Archiviati'
# all: 'All'
rss_limit: 'Numero di elementi nel feed' rss_limit: 'Numero di elementi nel feed'
form_user: form_user:
two_factor_description: "Abilitando l'\autenticazione a due fattori riceverai una e-mail con un codice per ogni nuova connesione non verificata" two_factor_description: "Abilitando l'\autenticazione a due fattori riceverai una e-mail con un codice per ogni nuova connesione non verificata"

View file

@ -88,11 +88,12 @@ config:
no_token: 'Pas cap de geton generat' no_token: 'Pas cap de geton generat'
token_create: 'Creatz vòstre geton' token_create: 'Creatz vòstre geton'
token_reset: 'Reïnicializatz 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: rss_link:
unread: 'pas legits' unread: 'Pas legits'
starred: 'favorits' starred: 'Favorits'
archive: 'legits' archive: 'Legits'
# all: 'All'
rss_limit: "Nombre d'articles dins un flux RSS" rss_limit: "Nombre d'articles dins un flux RSS"
form_user: 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." 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."

View file

@ -90,9 +90,10 @@ config:
token_reset: 'Zresetuj swojego tokena' token_reset: 'Zresetuj swojego tokena'
rss_links: 'RSS links' rss_links: 'RSS links'
rss_link: rss_link:
unread: 'nieprzeczytane' unread: 'Nieprzeczytane'
starred: 'oznaczone gwiazdką' starred: 'Oznaczone gwiazdką'
archive: 'archiwum' archive: 'Archiwum'
# all: 'All'
rss_limit: 'Link do RSS' rss_limit: 'Link do RSS'
form_user: form_user:
two_factor_description: "Włączenie autoryzacji dwuetapowej oznacza, że będziesz otrzymywał maile z kodem przy każdym nowym, niezaufanym połączeniu" two_factor_description: "Włączenie autoryzacji dwuetapowej oznacza, że będziesz otrzymywał maile z kodem przy każdym nowym, niezaufanym połączeniu"

View file

@ -90,9 +90,10 @@ config:
token_reset: 'Gerar novamente seu token' token_reset: 'Gerar novamente seu token'
rss_links: 'Links RSS' rss_links: 'Links RSS'
rss_link: rss_link:
unread: 'não lido' unread: 'Não lido'
starred: 'destacado' starred: 'Destacado'
archive: 'arquivado' archive: 'Arquivado'
# all: 'All'
rss_limit: 'Número de itens no feed' rss_limit: 'Número de itens no feed'
form_user: 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.' 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.'

View file

@ -90,9 +90,10 @@ config:
token_reset: 'Resetează-ți token-ul' token_reset: 'Resetează-ți token-ul'
rss_links: 'Link-uri RSS' rss_links: 'Link-uri RSS'
rss_link: rss_link:
unread: 'unread' unread: 'Unread'
starred: 'starred' starred: 'Starred'
archive: 'archived' archive: 'Archived'
# all: 'All'
rss_limit: 'Limită RSS' rss_limit: 'Limită RSS'
form_user: form_user:
# two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connexion" # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connexion"

View file

@ -90,9 +90,10 @@ config:
token_reset: 'Belirteci (token) sıfırla' token_reset: 'Belirteci (token) sıfırla'
rss_links: 'RSS akış bağlantıları' rss_links: 'RSS akış bağlantıları'
rss_link: rss_link:
unread: 'okunmayan' unread: 'Okunmayan'
starred: 'favoriler' starred: 'Favoriler'
archive: 'arşiv' archive: 'Arşiv'
# all: 'All'
rss_limit: 'RSS içeriğinden talep edilecek makale limiti' rss_limit: 'RSS içeriğinden talep edilecek makale limiti'
form_user: 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." 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."

View file

@ -82,7 +82,7 @@
<fieldset class="w500p inline"> <fieldset class="w500p inline">
<div class="row"> <div class="row">
<h3>{{ 'config.form_settings.android_configuration'|trans }}</h3> <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/> <br/>
<img id="androidQrcode" /> <img id="androidQrcode" />
<script> <script>
@ -106,7 +106,7 @@
<fieldset class="w500p inline"> <fieldset class="w500p inline">
<div class="row"> <div class="row">
<label>Rss token</label> <label>{{ 'config.form_rss.token_label'|trans }}</label>
{% if rss.token %} {% if rss.token %}
{{ rss.token }} {{ rss.token }}
{% else %} {% else %}
@ -128,9 +128,10 @@
<div class="row"> <div class="row">
<label>{{ 'config.form_rss.rss_links'|trans }}</label> <label>{{ 'config.form_rss.rss_links'|trans }}</label>
<ul> <ul>
<li><a href="{{ path('unread_rss', {'username': rss.username, 'token': rss.token}) }}">unread</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}) }}">fav</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}) }}">archives</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> </ul>
</div> </div>
</fieldset> </fieldset>

View file

@ -1,5 +1,12 @@
{% extends "WallabagCoreBundle::layout.html.twig" %} {% 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 %} {% block title %}
{% set filter = '' %} {% set filter = '' %}
{% if tag is defined %} {% if tag is defined %}
@ -12,12 +19,15 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% set currentRoute = app.request.attributes.get('_route') %}
{% set listMode = app.user.config.listMode %} {% set listMode = app.user.config.listMode %}
<div class="results"> <div class="results">
<div class="nb-results">{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}</div> <div class="nb-results">{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}</div>
<div class="pagination"> <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> <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 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> <i class="btn-clickable filter-btn material-icons md-24 js-filters-action">filter_list</i>
{% if entries.getNbPages > 1 %} {% if entries.getNbPages > 1 %}
@ -76,7 +86,6 @@
<!-- Export --> <!-- Export -->
<aside id="download-form"> <aside id="download-form">
{% set currentRoute = app.request.attributes.get('_route') %}
{% set currentTag = '' %} {% set currentTag = '' %}
{% if tag is defined %} {% if tag is defined %}
{% set currentTag = tag %} {% set currentTag = tag %}

View file

@ -9,7 +9,12 @@
<ul> <ul>
{% for tag in tags %} {% 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 %} {% endfor %}
</ul> </ul>

View file

@ -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 %}

View file

@ -157,6 +157,7 @@
<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('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('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('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> </ul>
</div> </div>
</div> </div>

View file

@ -1,9 +1,16 @@
{% extends "WallabagCoreBundle::layout.html.twig" %} {% 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 %} {% block title %}
{% set filter = '' %} {% set filter = '' %}
{% if tag is defined %} {% if tag is defined %}
{% set filter = tag %} {% set filter = tag.slug %}
{% endif %} {% endif %}
{% if searchTerm is defined and searchTerm is not empty %} {% if searchTerm is defined and searchTerm is not empty %}
{% set filter = searchTerm %} {% set filter = searchTerm %}
@ -13,10 +20,14 @@
{% block content %} {% block content %}
{% set listMode = app.user.config.listMode %} {% set listMode = app.user.config.listMode %}
{% set currentRoute = app.request.attributes.get('_route') %}
<div class="results clearfix"> <div class="results clearfix">
<div class="nb-results left"> <div class="nb-results left">
{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }} {{ '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> <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> </div>
{% if entries.getNbPages > 1 %} {% if entries.getNbPages > 1 %}
{{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }} {{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }}
@ -46,10 +57,9 @@
<!-- Export --> <!-- Export -->
<div id="export" class="side-nav right-aligned"> <div id="export" class="side-nav right-aligned">
{% set currentRoute = app.request.attributes.get('_route') %}
{% set currentTag = '' %} {% set currentTag = '' %}
{% if tag is defined %} {% if tag is defined %}
{% set currentTag = tag %} {% set currentTag = tag.slug %}
{% endif %} {% endif %}
{% if currentRoute == 'homepage' %} {% if currentRoute == 'homepage' %}
{% set currentRoute = 'unread' %} {% set currentRoute = 'unread' %}

View file

@ -15,7 +15,7 @@
<li title="{{tag.label}} ({{ tag.nbEntries }})" id="tag-{{ tag.id }}" class="col l2 m2 s5"> <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> <a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.nbEntries }})</a>
{% if app.user.config.rssToken %} {% 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 %} {% endif %}
</li> </li>
{% endfor %} {% endfor %}