From 6ce4e978c9faf739706a1199d1d53973785bad57 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Fri, 12 Jun 2015 14:29:47 +0200 Subject: No need to display the /duplicates page when there is no duplicate. --- messages.pot | 76 ++++++++++---------- pyaggr3g470r/templates/duplicates.html | 54 +++++++------- .../translations/fr/LC_MESSAGES/messages.mo | Bin 15979 -> 15993 bytes .../translations/fr/LC_MESSAGES/messages.po | 78 ++++++++++----------- pyaggr3g470r/views/views.py | 4 ++ 5 files changed, 106 insertions(+), 106 deletions(-) diff --git a/messages.pot b/messages.pot index c212dd32..aee4a812 100644 --- a/messages.pot +++ b/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2015-06-03 08:37+0200\n" +"POT-Creation-Date: 2015-06-12 14:26+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -224,8 +224,8 @@ msgid "from" msgstr "" #: pyaggr3g470r/templates/article.html:11 +#: pyaggr3g470r/templates/duplicates.html:22 #: pyaggr3g470r/templates/duplicates.html:23 -#: pyaggr3g470r/templates/duplicates.html:24 #: pyaggr3g470r/templates/home.html:83 msgid "Delete this article" msgstr "" @@ -259,19 +259,15 @@ msgstr "" msgid "Share on" msgstr "" -#: pyaggr3g470r/templates/duplicates.html:5 +#: pyaggr3g470r/templates/duplicates.html:4 msgid "Duplicates in the feed" msgstr "" -#: pyaggr3g470r/templates/duplicates.html:12 -#: pyaggr3g470r/templates/duplicates.html:15 +#: pyaggr3g470r/templates/duplicates.html:11 +#: pyaggr3g470r/templates/duplicates.html:14 msgid "Delete all in this column" msgstr "" -#: pyaggr3g470r/templates/duplicates.html:31 -msgid "No duplicates in the feed" -msgstr "" - #: pyaggr3g470r/templates/edit_feed.html:13 #: pyaggr3g470r/templates/edit_feed.html:16 #: pyaggr3g470r/templates/layout.html:55 pyaggr3g470r/templates/layout.html:58 @@ -656,7 +652,7 @@ msgid "You are going to delete this account." msgstr "" #: pyaggr3g470r/templates/admin/dashboard.html:45 -#: pyaggr3g470r/views/views.py:724 +#: pyaggr3g470r/views/views.py:727 msgid "Add a new user" msgstr "" @@ -760,7 +756,7 @@ msgstr "" msgid "Search:" msgstr "" -#: pyaggr3g470r/views/views.py:351 pyaggr3g470r/views/views.py:518 +#: pyaggr3g470r/views/views.py:351 pyaggr3g470r/views/views.py:521 msgid "Downloading articles..." msgstr "" @@ -778,102 +774,106 @@ msgstr "" msgid "This article do not exist." msgstr "" -#: pyaggr3g470r/views/views.py:464 pyaggr3g470r/views/views.py:475 +#: pyaggr3g470r/views/views.py:451 +msgid "No duplicates in the feed \"{}\"\"." +msgstr "" + +#: pyaggr3g470r/views/views.py:467 pyaggr3g470r/views/views.py:478 msgid "Error when exporting articles." msgstr "" -#: pyaggr3g470r/views/views.py:481 +#: pyaggr3g470r/views/views.py:484 msgid "Export format not supported." msgstr "" -#: pyaggr3g470r/views/views.py:510 pyaggr3g470r/views/views.py:526 -#: pyaggr3g470r/views/views.py:535 +#: pyaggr3g470r/views/views.py:513 pyaggr3g470r/views/views.py:529 +#: pyaggr3g470r/views/views.py:538 msgid "File not allowed." msgstr "" -#: pyaggr3g470r/views/views.py:516 +#: pyaggr3g470r/views/views.py:519 msgid "feeds imported." msgstr "" -#: pyaggr3g470r/views/views.py:520 +#: pyaggr3g470r/views/views.py:523 msgid "Impossible to import the new feeds." msgstr "" -#: pyaggr3g470r/views/views.py:530 +#: pyaggr3g470r/views/views.py:533 msgid "Account imported." msgstr "" -#: pyaggr3g470r/views/views.py:532 +#: pyaggr3g470r/views/views.py:535 msgid "Impossible to import the account." msgstr "" -#: pyaggr3g470r/views/views.py:572 pyaggr3g470r/views/views.py:702 -#: pyaggr3g470r/views/views.py:712 pyaggr3g470r/views/views.py:752 +#: pyaggr3g470r/views/views.py:575 pyaggr3g470r/views/views.py:705 +#: pyaggr3g470r/views/views.py:715 pyaggr3g470r/views/views.py:755 msgid "User" msgstr "" -#: pyaggr3g470r/views/views.py:573 pyaggr3g470r/views/views.py:702 +#: pyaggr3g470r/views/views.py:576 pyaggr3g470r/views/views.py:705 msgid "successfully updated." msgstr "" -#: pyaggr3g470r/views/views.py:593 +#: pyaggr3g470r/views/views.py:596 msgid "Your account has been deleted." msgstr "" -#: pyaggr3g470r/views/views.py:595 pyaggr3g470r/views/views.py:738 -#: pyaggr3g470r/views/views.py:754 pyaggr3g470r/views/views.py:782 +#: pyaggr3g470r/views/views.py:598 pyaggr3g470r/views/views.py:741 +#: pyaggr3g470r/views/views.py:757 pyaggr3g470r/views/views.py:785 msgid "This user does not exist." msgstr "" -#: pyaggr3g470r/views/views.py:612 +#: pyaggr3g470r/views/views.py:615 msgid "Articles deleted." msgstr "" -#: pyaggr3g470r/views/views.py:626 +#: pyaggr3g470r/views/views.py:629 msgid "Your account has been confirmed." msgstr "" -#: pyaggr3g470r/views/views.py:628 +#: pyaggr3g470r/views/views.py:631 msgid "Impossible to confirm this account." msgstr "" -#: pyaggr3g470r/views/views.py:650 +#: pyaggr3g470r/views/views.py:653 msgid "New password sent to your address." msgstr "" -#: pyaggr3g470r/views/views.py:652 +#: pyaggr3g470r/views/views.py:655 msgid "Problem while sending your new password." msgstr "" -#: pyaggr3g470r/views/views.py:677 +#: pyaggr3g470r/views/views.py:680 msgid "Problem while sending email" msgstr "" -#: pyaggr3g470r/views/views.py:712 +#: pyaggr3g470r/views/views.py:715 msgid "successfully created." msgstr "" -#: pyaggr3g470r/views/views.py:721 +#: pyaggr3g470r/views/views.py:724 msgid "Edit the user" msgstr "" -#: pyaggr3g470r/views/views.py:752 +#: pyaggr3g470r/views/views.py:755 msgid "successfully deleted." msgstr "" -#: pyaggr3g470r/views/views.py:773 pyaggr3g470r/views/views.py:779 +#: pyaggr3g470r/views/views.py:776 pyaggr3g470r/views/views.py:782 msgid "Account of the user" msgstr "" -#: pyaggr3g470r/views/views.py:773 +#: pyaggr3g470r/views/views.py:776 msgid "successfully activated." msgstr "" -#: pyaggr3g470r/views/views.py:775 +#: pyaggr3g470r/views/views.py:778 msgid "Problem while sending activation email" msgstr "" -#: pyaggr3g470r/views/views.py:779 +#: pyaggr3g470r/views/views.py:782 msgid "successfully disabled." msgstr "" diff --git a/pyaggr3g470r/templates/duplicates.html b/pyaggr3g470r/templates/duplicates.html index 4d7ac650..32fbdf9a 100644 --- a/pyaggr3g470r/templates/duplicates.html +++ b/pyaggr3g470r/templates/duplicates.html @@ -1,34 +1,30 @@ {% extends "layout.html" %} {% block content %}
- {% if duplicates != [] %} -

{{ _('Duplicates in the feed') }} {{ feed.title }}.

-

- - - - - - - - - - {% for pair in duplicates %} - - - - - - {% endfor %} - -
# - {{ _('Delete all in this column') }} - - {{ _('Delete all in this column') }} -
{{ loop.index }} {{ pair[0].title }} ({{ pair[0].retrieved_date }}) {{ pair[1].title }} ({{ pair[1].retrieved_date }})
-
- {% else %} -

{{ _('No duplicates in the feed') }} {{ feed.title }}.

- {% endif %} +

{{ _('Duplicates in the feed') }} {{ feed.title }}.

+

+ + + + + + + + + + {% for pair in duplicates %} + + + + + + {% endfor %} + +
# + {{ _('Delete all in this column') }} + + {{ _('Delete all in this column') }} +
{{ loop.index }} {{ pair[0].title }} ({{ pair[0].retrieved_date }}) {{ pair[1].title }} ({{ pair[1].retrieved_date }})
+
{% endblock %} diff --git a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo index bcf0bb0d..2c077eec 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 64247b97..a7371a32 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-06-03 08:37+0200\n" -"PO-Revision-Date: 2015-06-03 08:38+0100\n" +"POT-Creation-Date: 2015-06-12 14:26+0200\n" +"PO-Revision-Date: 2015-06-12 14:27+0100\n" "Last-Translator: Cedric Bonhomme \n" "Language-Team: fr \n" "Language: fr\n" @@ -246,8 +246,8 @@ msgid "from" msgstr "de" #: pyaggr3g470r/templates/article.html:11 +#: pyaggr3g470r/templates/duplicates.html:22 #: pyaggr3g470r/templates/duplicates.html:23 -#: pyaggr3g470r/templates/duplicates.html:24 #: pyaggr3g470r/templates/home.html:83 msgid "Delete this article" msgstr "Supprimer cet article" @@ -281,19 +281,15 @@ msgstr "Billet précédent:" msgid "Share on" msgstr "Partager sur" -#: pyaggr3g470r/templates/duplicates.html:5 +#: pyaggr3g470r/templates/duplicates.html:4 msgid "Duplicates in the feed" msgstr "Doublons dans le flux" -#: pyaggr3g470r/templates/duplicates.html:12 -#: pyaggr3g470r/templates/duplicates.html:15 +#: pyaggr3g470r/templates/duplicates.html:11 +#: pyaggr3g470r/templates/duplicates.html:14 msgid "Delete all in this column" msgstr "Supprimer tout dans cette colonne" -#: pyaggr3g470r/templates/duplicates.html:31 -msgid "No duplicates in the feed" -msgstr "Pas de doublon dans ce flux" - #: pyaggr3g470r/templates/edit_feed.html:13 #: pyaggr3g470r/templates/edit_feed.html:16 #: pyaggr3g470r/templates/layout.html:55 pyaggr3g470r/templates/layout.html:58 @@ -689,7 +685,7 @@ msgid "You are going to delete this account." msgstr "Vous allez supprimer ce compte." #: pyaggr3g470r/templates/admin/dashboard.html:45 -#: pyaggr3g470r/views/views.py:724 +#: pyaggr3g470r/views/views.py:727 msgid "Add a new user" msgstr "Ajouter un nouvel utilisateur" @@ -793,7 +789,7 @@ msgstr "Aucun texte à chercher a été soumis." msgid "Search:" msgstr "Recherche:" -#: pyaggr3g470r/views/views.py:351 pyaggr3g470r/views/views.py:518 +#: pyaggr3g470r/views/views.py:351 pyaggr3g470r/views/views.py:521 msgid "Downloading articles..." msgstr "Téléchargement des articles." @@ -813,102 +809,106 @@ msgstr "supprimé." msgid "This article do not exist." msgstr "Cet article n'existe pas." -#: pyaggr3g470r/views/views.py:464 pyaggr3g470r/views/views.py:475 +#: pyaggr3g470r/views/views.py:451 +msgid "No duplicates in the feed \"{}\"\"." +msgstr "Pas de doublon dans le flux \"{}\"\"." + +#: pyaggr3g470r/views/views.py:467 pyaggr3g470r/views/views.py:478 msgid "Error when exporting articles." msgstr "Erreur lors de l'export des articles." -#: pyaggr3g470r/views/views.py:481 +#: pyaggr3g470r/views/views.py:484 msgid "Export format not supported." msgstr "Ce format d'export n'est pas supporté." -#: pyaggr3g470r/views/views.py:510 pyaggr3g470r/views/views.py:526 -#: pyaggr3g470r/views/views.py:535 +#: pyaggr3g470r/views/views.py:513 pyaggr3g470r/views/views.py:529 +#: pyaggr3g470r/views/views.py:538 msgid "File not allowed." msgstr "Fichier non autorisé." -#: pyaggr3g470r/views/views.py:516 +#: pyaggr3g470r/views/views.py:519 msgid "feeds imported." msgstr "flux importés." -#: pyaggr3g470r/views/views.py:520 +#: pyaggr3g470r/views/views.py:523 msgid "Impossible to import the new feeds." msgstr "Impossible d'importer les nouveaux flux." -#: pyaggr3g470r/views/views.py:530 +#: pyaggr3g470r/views/views.py:533 msgid "Account imported." msgstr "Compte importé." -#: pyaggr3g470r/views/views.py:532 +#: pyaggr3g470r/views/views.py:535 msgid "Impossible to import the account." msgstr "Impossible d'importer le compte." -#: pyaggr3g470r/views/views.py:572 pyaggr3g470r/views/views.py:702 -#: pyaggr3g470r/views/views.py:712 pyaggr3g470r/views/views.py:752 +#: pyaggr3g470r/views/views.py:575 pyaggr3g470r/views/views.py:705 +#: pyaggr3g470r/views/views.py:715 pyaggr3g470r/views/views.py:755 msgid "User" msgstr "Utilisateur" -#: pyaggr3g470r/views/views.py:573 pyaggr3g470r/views/views.py:702 +#: pyaggr3g470r/views/views.py:576 pyaggr3g470r/views/views.py:705 msgid "successfully updated." msgstr "mis à jour avec succès." -#: pyaggr3g470r/views/views.py:593 +#: pyaggr3g470r/views/views.py:596 msgid "Your account has been deleted." msgstr "Votre compte a été supprimé." -#: pyaggr3g470r/views/views.py:595 pyaggr3g470r/views/views.py:738 -#: pyaggr3g470r/views/views.py:754 pyaggr3g470r/views/views.py:782 +#: pyaggr3g470r/views/views.py:598 pyaggr3g470r/views/views.py:741 +#: pyaggr3g470r/views/views.py:757 pyaggr3g470r/views/views.py:785 msgid "This user does not exist." msgstr "Cet utilisateur n'existe pas." -#: pyaggr3g470r/views/views.py:612 +#: pyaggr3g470r/views/views.py:615 msgid "Articles deleted." msgstr "Articles supprimés." -#: pyaggr3g470r/views/views.py:626 +#: pyaggr3g470r/views/views.py:629 msgid "Your account has been confirmed." msgstr "Votre compte a été confirmé." -#: pyaggr3g470r/views/views.py:628 +#: pyaggr3g470r/views/views.py:631 msgid "Impossible to confirm this account." msgstr "Impossible de confirmer ce compte." -#: pyaggr3g470r/views/views.py:650 +#: pyaggr3g470r/views/views.py:653 msgid "New password sent to your address." msgstr "Nouveau mot de passe envoyé à votre adresse." -#: pyaggr3g470r/views/views.py:652 +#: pyaggr3g470r/views/views.py:655 msgid "Problem while sending your new password." msgstr "Problème lors de l'envoi de votre nouveau mot de passe." -#: pyaggr3g470r/views/views.py:677 +#: pyaggr3g470r/views/views.py:680 msgid "Problem while sending email" msgstr "Problème lors de l'envoi de l'email" -#: pyaggr3g470r/views/views.py:712 +#: pyaggr3g470r/views/views.py:715 msgid "successfully created." msgstr "créé avec succès." -#: pyaggr3g470r/views/views.py:721 +#: pyaggr3g470r/views/views.py:724 msgid "Edit the user" msgstr "Éditer cet utilisateur" -#: pyaggr3g470r/views/views.py:752 +#: pyaggr3g470r/views/views.py:755 msgid "successfully deleted." msgstr "supprimé avec succès." -#: pyaggr3g470r/views/views.py:773 pyaggr3g470r/views/views.py:779 +#: pyaggr3g470r/views/views.py:776 pyaggr3g470r/views/views.py:782 msgid "Account of the user" msgstr "Compte de l'utilisateur" -#: pyaggr3g470r/views/views.py:773 +#: pyaggr3g470r/views/views.py:776 msgid "successfully activated." msgstr "activé avec succès." -#: pyaggr3g470r/views/views.py:775 +#: pyaggr3g470r/views/views.py:778 msgid "Problem while sending activation email" msgstr "Problème lors de l'envoi d'email d'activation" -#: pyaggr3g470r/views/views.py:779 +#: pyaggr3g470r/views/views.py:782 msgid "successfully disabled." msgstr "désactivé avec succès." diff --git a/pyaggr3g470r/views/views.py b/pyaggr3g470r/views/views.py index d83a9d35..f88e9fa4 100644 --- a/pyaggr3g470r/views/views.py +++ b/pyaggr3g470r/views/views.py @@ -447,6 +447,10 @@ def duplicates(feed_id=None): feed = Feed.query.filter(Feed.user_id == g.user.id, Feed.id == feed_id).first() duplicates = [] duplicates = utils.compare_documents(feed) + if len(duplicates) == 0: + flash(gettext('No duplicates in the feed "{}"".').format(feed.title), + 'info') + return redirect(redirect_url()) return render_template('duplicates.html', duplicates=duplicates, feed=feed) @app.route('/export', methods=['GET']) -- cgit