From bb258a2a681b6bd3465257d26ba116adf3c1203e Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Sat, 13 Aug 2016 16:18:51 +0200 Subject: [PATCH] Better total stats, now also info about nr bookmarks --- digimarks.py | 5 +++-- templates/tags.html | 37 +++++++++++++++++++++++++++---------- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/digimarks.py b/digimarks.py index 85a4322..83bed0d 100644 --- a/digimarks.py +++ b/digimarks.py @@ -425,8 +425,9 @@ def tags(userkey): total = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.tags.contains(tag), Bookmark.status == Bookmark.VISIBLE).count() alltags.append({'tag': tag, 'publictag': publictag, 'total': total}) - total = len(alltags) - return render_template('tags.html', tags=alltags, total=total, userkey=userkey) + totaltags = len(alltags) + totalbookmarks = Bookmark.select().where(Bookmark.userkey == userkey).count() + return render_template('tags.html', tags=alltags, totaltags=totaltags, totalbookmarks=totalbookmarks, userkey=userkey) @app.route('//tag/') diff --git a/templates/tags.html b/templates/tags.html index b28d32e..82d7035 100644 --- a/templates/tags.html +++ b/templates/tags.html @@ -5,6 +5,33 @@
+ + + + + + + + + + + + + + + + + +
 Total
+ Different tags + + {{ totaltags }} +
+ Total bookmarks + + {{ totalbookmarks }} +
+ @@ -14,16 +41,6 @@ - - - - {% for tag in tags %}
- All - - - - - {{ total }} -