diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-11-28 15:24:18 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-11-28 15:24:18 +0100 |
commit | ed06b9a5cca186146548472c8f88f8dd2b63eee1 (patch) | |
tree | 18411300b06f4914e99ea1ffb2d6242e9984a285 /pyaggr3g470r | |
parent | Speed improvements: combinations generates less pair than product... (diff) | |
download | newspipe-ed06b9a5cca186146548472c8f88f8dd2b63eee1.tar.gz newspipe-ed06b9a5cca186146548472c8f88f8dd2b63eee1.tar.bz2 newspipe-ed06b9a5cca186146548472c8f88f8dd2b63eee1.zip |
Added duplicates.html template.
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r-- | pyaggr3g470r/templates/duplicates.html | 14 | ||||
-rw-r--r-- | pyaggr3g470r/templates/inactives.html | 25 | ||||
-rw-r--r-- | pyaggr3g470r/views.py | 9 |
3 files changed, 37 insertions, 11 deletions
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 %} +<div class="container"> + {% if duplicates != [] %} + <ul class="list-group"> + {% for pair in duplicates %} + <li><a href="/article/{{ pair[0].id }}">{{ pair[0].title }}</a> - <a href="/article/{{ pair[1].id }}">{{ pair[1].title }}</a></li> + {% endfor %} + </ul> + {% else %} + <p>{{ _('No duplicates.') }}<p> + {% endif %} +</div><!-- /.container --> +{% 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 %} <div class="container"> - {% if duplicates != [] %} - <ul class="list-group"> - {% for pair in duplicates %} - <li><a href="/article/{{ pair[0].id }}">{{ pair[0].title }}</a> - <a href="/article/{{ pair[1].id }}">{{ pair[1].title }}</a></li> - {% endfor %} - </ul> - {% else %} - <p>{{ _('No duplicates.') }}<p> - {% endif %} + <div class="jumbotron"> + <form method=get action="/inactives"> + <p>{{ _('Days of inactivity') }}:</p> + <input type="number" name="nb_days" class="form-control" value="{{ nb_days }}" min="0" max="1000000" step="1" size="4" style="text-align: center" /> + </form> + <br /> + {% if inactives != [] %} + <ul class="list-group"> + {% for item in inactives %} + <li class="list-group-item"><a href="/feed/{{ item[0].id }}">{{ item[0].title }}</a> - {{ item[1].days }} {{ _('days') }}</li> + {% endfor %} + </ul> + {% else %} + <p>{{ _('No inactive feeds.') }}<p> + {% endif %} + </div> </div><!-- /.container --> {% 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/<int:feed_id>', 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 |