From 46aa230faed77f509d2236fbc35e7e62d396fff3 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Sat, 17 Mar 2018 15:01:44 +0100 Subject: [PATCH] Support read-only/editable and show/hide tags per view --- digimarks.py | 11 ++++++++++- templates/cards.html | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/digimarks.py b/digimarks.py index 4051f8b..dd702d9 100644 --- a/digimarks.py +++ b/digimarks.py @@ -476,7 +476,16 @@ def bookmarks(userkey, filtermethod = None, sortmethod = None): bookmarks = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.status == Bookmark.VISIBLE).order_by(Bookmark.created_date.desc()) theme = get_theme(userkey) - return render_template('bookmarks.html', bookmarks=bookmarks, userkey=userkey, tags=tags, filter_text=filter_text, message=message, theme=theme) + return render_template('bookmarks.html', + bookmarks=bookmarks, + userkey=userkey, + tags=tags, + filter_text=filter_text, + message=message, + theme=theme, + editable=True, # bookmarks can be edited + showtags=True, # tags should be shown with the bookmarks + ) diff --git a/templates/cards.html b/templates/cards.html index 21cc6ae..1a8bb34 100644 --- a/templates/cards.html +++ b/templates/cards.html @@ -34,10 +34,13 @@
Added @ {{ bookmark.created_date.strftime('%Y-%m-%d %H:%M') }}close + {% if editable %} + {% endif %} + {% if showtags %}
{% for tag in bookmark.tags_list %}
@@ -45,6 +48,7 @@
{% endfor %}
+ {% endif %}