aboutsummaryrefslogtreecommitdiff
path: root/src/web/views
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2018-10-27 00:34:08 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2018-10-27 00:34:08 +0200
commit488327324ab2f65fa8e0bc49a1d13efb505bba21 (patch)
treea56fbd64da4607ef4f94e354ea7605fdc6e0de2e /src/web/views
parentMerge branch 'master' of github.com:newspipe/newspipe (diff)
downloadnewspipe-488327324ab2f65fa8e0bc49a1d13efb505bba21.tar.gz
newspipe-488327324ab2f65fa8e0bc49a1d13efb505bba21.tar.bz2
newspipe-488327324ab2f65fa8e0bc49a1d13efb505bba21.zip
Filter feeds per category on the user profile page.
Diffstat (limited to 'src/web/views')
-rw-r--r--src/web/views/user.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/web/views/user.py b/src/web/views/user.py
index 1460c708..c9c23ca7 100644
--- a/src/web/views/user.py
+++ b/src/web/views/user.py
@@ -25,6 +25,7 @@ def profile_public(nickname=None):
"""
Display the public profile of the user.
"""
+ category_id = int(request.args.get('category_id', 0))
user_contr = UserController()
user = user_contr.get(nickname=nickname)
if not user.is_public_profile:
@@ -34,6 +35,8 @@ def profile_public(nickname=None):
filters = {}
filters['private'] = False
+ if category_id:
+ filters['category_id'] = category_id
feeds = FeedController(user.id).read(**filters).all()
"""word_size = 6
@@ -43,7 +46,8 @@ def profile_public(nickname=None):
top_words = misc_utils.top_words(articles, n=50, size=int(word_size))
tag_cloud = misc_utils.tag_cloud(top_words)"""
- return render_template('profile_public.html', user=user, feeds=feeds)
+ return render_template('profile_public.html', user=user, feeds=feeds,
+ selected_category_id=category_id)
@user_bp.route('/management', methods=['GET', 'POST'])
bgstack15