From c94a05150f22d0fef073efdd1ef6f1debb51dbab Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Mon, 23 Mar 2015 19:21:30 +0100 Subject: Fixed a minor bug in the '/feed' page. --- pyaggr3g470r/templates/feed.html | 14 +++---- .../translations/fr/LC_MESSAGES/messages.mo | Bin 15318 -> 15239 bytes .../translations/fr/LC_MESSAGES/messages.po | 43 ++++++++++----------- pyaggr3g470r/views/feed.py | 8 ++-- 4 files changed, 31 insertions(+), 34 deletions(-) (limited to 'pyaggr3g470r') diff --git a/pyaggr3g470r/templates/feed.html b/pyaggr3g470r/templates/feed.html index 4b050573..c7dfecc2 100644 --- a/pyaggr3g470r/templates/feed.html +++ b/pyaggr3g470r/templates/feed.html @@ -9,11 +9,14 @@

- {{ _('This feed contains') }} {{ feed.articles.all()|count }} {{ _('articles') }} - {% if nb_articles != 0 %} - ({{ ((feed.articles.all()|count * 100 ) / nb_articles) | round(2, 'floor') }}% {{ _('of the database') }}).
+ {{ _('This feed contains') }} {{ feed.articles.all()|count }} {{ _('articles') }}.
+ {{ _('Address of the feed') }}: {{ feed.link }}
+ {% if feed.site_link != "" %} + {{ _('Address of the site') }}: {{ feed.site_link }}
{% endif %} +
+ {% if feed.last_retrieved %} {{ _("Last download:") }} {{ feed.last_retrieved | datetime }}
{% endif %} @@ -28,11 +31,6 @@ {{ _("Here's the last error encountered while retrieving this feed:") }}

{{ feed.last_error }}

{% endif %} - {{ _('Address of the feed') }}: {{ feed.link }}
- {% if feed.site_link != "" %} - {{ _('Address of the site') }}: {{ feed.site_link }}
- {% endif %} - {% if feed.articles.all()|count != 0 %} {{ _('The last article was posted') }} {{ elapsed.days }} {{ _('day(s) ago.') }}
{{ _('Daily average') }}: {{ average }}, {{ _('between the') }} {{ first_post_date | datetime }} {{ _('and the') }} {{ end_post_date | datetime }}. diff --git a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo index 8f232509..9f133872 100644 Binary files a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo and b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo differ diff --git a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po index fdf98b3b..4a22ef8c 100644 --- a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po +++ b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2015-03-17 18:22+0100\n" -"PO-Revision-Date: 2015-03-17 18:22+0100\n" +"POT-Creation-Date: 2015-03-23 19:20+0100\n" +"PO-Revision-Date: 2015-03-23 19:21+0100\n" "Last-Translator: Cédric Bonhomme \n" "Language-Team: fr \n" "Language: fr\n" @@ -319,22 +319,26 @@ msgstr "Ce flux contient" msgid "articles" msgstr "articles" -#: pyaggr3g470r/templates/feed.html:14 -msgid "of the database" -msgstr "de la base de données" +#: pyaggr3g470r/templates/feed.html:13 +msgid "Address of the feed" +msgstr "Adresse du flux" -#: pyaggr3g470r/templates/feed.html:18 +#: pyaggr3g470r/templates/feed.html:15 +msgid "Address of the site" +msgstr "Adresse du site" + +#: pyaggr3g470r/templates/feed.html:21 msgid "Last download:" msgstr "Dernier téléchargement:" -#: pyaggr3g470r/templates/feed.html:22 +#: pyaggr3g470r/templates/feed.html:25 msgid "" "That feed has encountered too much consecutive errors and won't be retrieved " "anymore." msgstr "" "Ce flux a rencontré trop d'erreurs consécutives et ne sera plus récupéré." -#: pyaggr3g470r/templates/feed.html:24 +#: pyaggr3g470r/templates/feed.html:27 msgid "" "The download of this feed has encountered some problems. However its error " "counter will be reinitialized at the next successful retrieving." @@ -343,35 +347,27 @@ msgstr "" "compteur d'erreurs sera réinitialisé lors de la prochaine récupération " "réussie." -#: pyaggr3g470r/templates/feed.html:28 +#: pyaggr3g470r/templates/feed.html:31 msgid "Here's the last error encountered while retrieving this feed:" msgstr "Voici la dernière erreur survenue lors de la récupération ce flux:" -#: pyaggr3g470r/templates/feed.html:31 -msgid "Address of the feed" -msgstr "Adresse du flux" - -#: pyaggr3g470r/templates/feed.html:33 -msgid "Address of the site" -msgstr "Adresse du site" - -#: pyaggr3g470r/templates/feed.html:37 +#: pyaggr3g470r/templates/feed.html:35 msgid "The last article was posted" msgstr "Le dernier article a été posté il y a" -#: pyaggr3g470r/templates/feed.html:37 +#: pyaggr3g470r/templates/feed.html:35 msgid "day(s) ago." msgstr "jours." -#: pyaggr3g470r/templates/feed.html:38 +#: pyaggr3g470r/templates/feed.html:36 msgid "Daily average" msgstr "Moyenne journalière" -#: pyaggr3g470r/templates/feed.html:38 +#: pyaggr3g470r/templates/feed.html:36 msgid "between the" msgstr "entre le" -#: pyaggr3g470r/templates/feed.html:38 +#: pyaggr3g470r/templates/feed.html:36 msgid "and the" msgstr "et le" @@ -894,6 +890,9 @@ msgstr "activé avec succès." msgid "successfully disabled." msgstr "désactivé avec succès." +#~ msgid "of the database" +#~ msgstr "de la base de données" + #~ msgid "Email notification" #~ msgstr "Notification par email" diff --git a/pyaggr3g470r/views/feed.py b/pyaggr3g470r/views/feed.py index 2e39ee4b..4fe4e5da 100644 --- a/pyaggr3g470r/views/feed.py +++ b/pyaggr3g470r/views/feed.py @@ -3,6 +3,7 @@ from datetime import datetime from flask import Blueprint, g, render_template +from sqlalchemy import desc from pyaggr3g470r import controllers, utils from pyaggr3g470r.decorators import pyagg_default_decorator, \ @@ -25,9 +26,9 @@ def feed(feed_id=None): "Presents detailed information about a feed." feed = controllers.FeedController(g.user.id).get(id=feed_id) word_size = 6 - articles = controllers.ArticleController(g.user.id)\ - .read(feed_id=feed_id).all() - nb_articles = controllers.ArticleController(g.user.id).read().count() + articles = controllers.ArticleController(g.user.id) \ + .read(feed_id=feed_id) \ + .order_by(desc("Article.date")).all() top_words = utils.top_words(articles, n=50, size=int(word_size)) tag_cloud = utils.tag_cloud(top_words) @@ -49,5 +50,4 @@ def feed(feed_id=None): feed=feed, tag_cloud=tag_cloud, first_post_date=first_article, end_post_date=last_article, - nb_articles=nb_articles, average=average, delta=delta, elapsed=elapsed) -- cgit