From ed06b9a5cca186146548472c8f88f8dd2b63eee1 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Fri, 28 Nov 2014 15:24:18 +0100 Subject: Added duplicates.html template. --- pyaggr3g470r/templates/duplicates.html | 14 ++++++++++++++ pyaggr3g470r/templates/inactives.html | 25 ++++++++++++++++--------- pyaggr3g470r/views.py | 9 +++++++-- 3 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 pyaggr3g470r/templates/duplicates.html (limited to 'pyaggr3g470r') diff --git a/pyaggr3g470r/templates/duplicates.html b/pyaggr3g470r/templates/duplicates.html new file mode 100644 index 00000000..548f845d --- /dev/null +++ b/pyaggr3g470r/templates/duplicates.html @@ -0,0 +1,14 @@ +{% extends "layout.html" %} +{% block content %} +
+ {% if duplicates != [] %} + + {% else %} +

{{ _('No duplicates.') }}

+ {% endif %} +

+{% endblock %} diff --git a/pyaggr3g470r/templates/inactives.html b/pyaggr3g470r/templates/inactives.html index 548f845d..e6897281 100644 --- a/pyaggr3g470r/templates/inactives.html +++ b/pyaggr3g470r/templates/inactives.html @@ -1,14 +1,21 @@ {% extends "layout.html" %} {% block content %}
- {% if duplicates != [] %} - - {% else %} -

{{ _('No duplicates.') }}

- {% endif %} +

+
+

{{ _('Days of inactivity') }}:

+ +
+
+ {% if inactives != [] %} +
    + {% for item in inactives %} +
  • {{ item[0].title }} - {{ item[1].days }} {{ _('days') }}
  • + {% endfor %} +
+ {% else %} +

{{ _('No inactive feeds.') }}

+ {% endif %} +

{% endblock %} diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py index a19b67dd..c9acec2d 100644 --- a/pyaggr3g470r/views.py +++ b/pyaggr3g470r/views.py @@ -477,10 +477,15 @@ def inactives(): return render_template('inactives.html', inactives=inactives, nb_days=nb_days) @app.route('/duplicates/', methods=['GET']) +@login_required def duplicates(feed_id=None): + """ + Return duplicates article for a feed. + """ feed = Feed.query.filter(Feed.user_id == g.user.id, Feed.id == feed_id).first() - result = compare.compare_documents(feed) - return render_template('unread.html', duplicates=duplicates) + duplicates = [] + duplicates = compare.compare_documents(feed) + return render_template('duplicates.html', duplicates=duplicates) @app.route('/index_database', methods=['GET']) @login_required -- cgit