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)
|
publictag = PublicTag.get(PublicTag.userkey == userkey, PublicTag.tag == tag)
|
||||||
except PublicTag.DoesNotExist:
|
except PublicTag.DoesNotExist:
|
||||||
publictag = None
|
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})
|
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>')
|
@app.route('/<userkey>/tag/<tag>')
|
||||||
|
|||||||
@@ -14,6 +14,16 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
All
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
-
|
||||||
|
<th>
|
||||||
|
{{ total }}
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
{% for tag in tags %}
|
{% for tag in tags %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
@@ -27,6 +37,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
{{ tag['total'] }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user