diff --git a/digimarks.py b/digimarks.py index 1997bf5..4f60f23 100644 --- a/digimarks.py +++ b/digimarks.py @@ -415,7 +415,16 @@ def deletingbookmark(userkey, urlhash): def tags(userkey): """ Overview of all tags used by user """ tags = get_cached_tags(userkey) - return render_template('tags.html', tags=tags, userkey=userkey) + #publictags = PublicTag.select().where(Bookmark.userkey == userkey) + alltags = [] + for tag in tags: + try: + 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 + alltags.append({'tag': tag, 'publictag': publictag, 'total': total}) + return render_template('tags.html', tags=alltags, userkey=userkey) @app.route('//tag/') diff --git a/templates/tags.html b/templates/tags.html index e9f3a82..ff89cdc 100644 --- a/templates/tags.html +++ b/templates/tags.html @@ -4,11 +4,34 @@ {% block pagecontent %}
- {% for tag in tags %} -
- {{ tag }} +
+ + + + + + + + + + {% for tag in tags %} + + + + + + {% endfor %} + +
TagPublic linkNumber of bookmarks
+ {{ tag['tag'] }} + + {% if tag['publictag'] %} + Public link + {% else %} + - + {% endif %} + +
- {% endfor %} -
{% endblock %}