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:
@@ -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>')
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user