aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r
diff options
context:
space:
mode:
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r--pyaggr3g470r/templates/duplicates.html14
-rw-r--r--pyaggr3g470r/templates/inactives.html25
-rw-r--r--pyaggr3g470r/views.py9
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
bgstack15