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

Cleaner stats table, now with starred and deleted too

This commit is contained in:
2016-08-13 20:33:17 +02:00
parent 2e031db2a7
commit 390cc0137a
2 changed files with 16 additions and 27 deletions

View File

@@ -426,9 +426,12 @@ 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})
totaltags = len(alltags)
totalbookmarks = Bookmark.select().where(Bookmark.userkey == userkey).count()
totalbookmarks = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.status == Bookmark.VISIBLE).count()
totalpublic = PublicTag.select().where(PublicTag.userkey == userkey).count()
return render_template('tags.html', tags=alltags, totaltags=totaltags, totalpublic=totalpublic, totalbookmarks=totalbookmarks, userkey=userkey)
totaldeleted = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.status == Bookmark.DELETED).count()
totalstarred = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.starred == True).count()
return render_template('tags.html', tags=alltags, totaltags=totaltags, totalpublic=totalpublic, totalbookmarks=totalbookmarks,
totaldeleted=totaldeleted, totalstarred=totalstarred, userkey=userkey)
@app.route('/<userkey>/tag/<tag>')

View File

@@ -5,37 +5,23 @@
<div class="row">
<div class="col s12">
<table>
<table class="centered">
<thead>
<tr>
<th>&nbsp;</th>
<th>Total</th>
<th><i class="material-icons" title="Unique labels">label</i></th>
<th><i class="material-icons green-text" title="Public tag pages">present_to_all</i></th>
<th><i class="material-icons" title="Total bookmarks">turned_in</i></th>
<th><i class="material-icons yellow-text" title="Starred bookmarks">star</i></th>
<th><i class="material-icons red-text" title="Deleted bookmarks">delete</i></th>
</tr>
</thead>
<tbody>
<tr>
<td>
Different tags
</td>
<td>
{{ totaltags }}
</td>
</tr>
<tr>
<td>
Public tag pages
</td>
<td>
{{ totalpublic }}
</td>
</tr>
<tr>
<td>
Bookmarks
</td>
<td>
{{ totalbookmarks }}
</td>
<td>{{ totaltags }}</td>
<td>{{ totalpublic }}</td>
<td>{{ totalbookmarks }}</td>
<td>{{ totalstarred }}</td>
<td>{{ totaldeleted }}</td>
</tr>
</tbody>
</table>