From 78e22dae3683a30bba75e78104b5da88efccab9f Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Fri, 2 Nov 2018 15:50:12 +0100 Subject: Offers more filtering possibilities on the popular feeds view for the user --- src/web/templates/popular.html | 35 ++++++++++++++++++++++------------- src/web/views/views.py | 5 ++++- 2 files changed, 26 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/web/templates/popular.html b/src/web/templates/popular.html index aae50a8c..4b207903 100644 --- a/src/web/templates/popular.html +++ b/src/web/templates/popular.html @@ -1,18 +1,27 @@ {% extends "layout.html" %} {% block content %}
-

{{ _('Popular feeds') }}

- +
+
+

{{ _('Popular feeds') }}

+ all ‧ last year ‧ last month +
+
+
+
+ +
+
{% endblock %} diff --git a/src/web/views/views.py b/src/web/views/views.py index ff442319..57f790b1 100644 --- a/src/web/views/views.py +++ b/src/web/views/views.py @@ -56,7 +56,10 @@ def popular(): # try to get the 'recent' popular websites, created after # 'not_created_before' # ie: not_added_before = date_last_added_feed - nb_days - nb_days = int(request.args.get('nb_days', 1000)) + try: + nb_days = int(request.args.get('nb_days', 365)) + except ValueError: + nb_days = 10000 last_added_feed = FeedController().read().\ order_by(desc('created_date')).limit(1).all() if last_added_feed: -- cgit