1
0
mirror of https://github.com/aquatix/digimarks.git synced 2025-12-06 23:05:10 +01:00

Total amount of tags, number of bookmarks per tag

This commit is contained in:
2016-08-13 15:35:36 +02:00
parent 78bed962d0
commit 72ad3c0d04
2 changed files with 15 additions and 2 deletions

View File

@@ -422,9 +422,11 @@ def tags(userkey):
publictag = PublicTag.get(PublicTag.userkey == userkey, PublicTag.tag == tag)
except PublicTag.DoesNotExist:
publictag = None
total = 'n/a' # TODO: count number of bookmarks with this tag
total = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.tags.contains(tag), Bookmark.status == Bookmark.VISIBLE).count()
alltags.append({'tag': tag, 'publictag': publictag, 'total': total})
return render_template('tags.html', tags=alltags, userkey=userkey)
total = len(alltags)
return render_template('tags.html', tags=alltags, total=total, userkey=userkey)
@app.route('/<userkey>/tag/<tag>')

View File

@@ -14,6 +14,16 @@
</tr>
</thead>
<tbody>
<tr>
<th>
All
</th>
<th>
-
<th>
{{ total }}
</th>
</tr>
{% for tag in tags %}
<tr>
<td>
@@ -27,6 +37,7 @@
{% endif %}
</td>
<td>
{{ tag['total'] }}
</td>
</tr>
{% endfor %}