aboutsummaryrefslogtreecommitdiff
path: root/src/web/views
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-09-20 15:08:47 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-09-20 15:08:47 +0200
commite60087e68546a8a9b483e09a78f4389fcc9ebc4e (patch)
treeacd780e7255d7de48a5519bc815c0e90f08d98b3 /src/web/views
parentDraft for a public user profile page. (diff)
downloadnewspipe-e60087e68546a8a9b483e09a78f4389fcc9ebc4e.tar.gz
newspipe-e60087e68546a8a9b483e09a78f4389fcc9ebc4e.tar.bz2
newspipe-e60087e68546a8a9b483e09a78f4389fcc9ebc4e.zip
Few improvemnts for the tag cloud of the user's profile pages.
Diffstat (limited to 'src/web/views')
-rw-r--r--src/web/views/user.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/web/views/user.py b/src/web/views/user.py
index bd12010c..01e26325 100644
--- a/src/web/views/user.py
+++ b/src/web/views/user.py
@@ -27,12 +27,16 @@ def profile_public(nickname=None):
user = user_contr.get(nickname=nickname)
if not user.is_public_profile:
return redirect(url_for('home'))
- art_contr = ArticleController(user.id)
+
+ word_size = 6
+ articles = ArticleController(user.id).read().all()
+ 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=user.feeds,
- unread_article_count=art_contr.count_by_category(readed=False),
- article_count=art_contr.count_by_category())
+ tag_cloud=tag_cloud)
@user_bp.route('/management', methods=['GET', 'POST'])
@login_required
bgstack15