From 85d4466de5be378fad52de58e41be22ca7c5f057 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Fri, 19 Aug 2016 14:10:21 +0200 Subject: [PATCH] Filter on bookmarks with a note --- digimarks.py | 7 +++++++ templates/bookmarks.html | 3 +++ 2 files changed, 10 insertions(+) diff --git a/digimarks.py b/digimarks.py index 9420f4c..7cb70c5 100644 --- a/digimarks.py +++ b/digimarks.py @@ -287,6 +287,10 @@ def bookmarks(userkey, filtermethod = None, sortmethod = None): if filtermethod and filtermethod.lower() == 'broken': filter_broken = True + filter_note = False + if filtermethod and filtermethod.lower() == 'note': + filter_note = True + if filter_text: bookmarks = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.title.contains(filter_text), Bookmark.status == Bookmark.VISIBLE).order_by(Bookmark.created_date.desc()) @@ -296,6 +300,9 @@ def bookmarks(userkey, filtermethod = None, sortmethod = None): elif filter_broken: bookmarks = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.http_status != 200).order_by(Bookmark.created_date.desc()) + elif filter_note: + bookmarks = Bookmark.select().where(Bookmark.userkey == userkey, + Bookmark.note != '').order_by(Bookmark.created_date.desc()) else: bookmarks = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.status == Bookmark.VISIBLE).order_by(Bookmark.created_date.desc()) diff --git a/templates/bookmarks.html b/templates/bookmarks.html index 283e923..c51f407 100644 --- a/templates/bookmarks.html +++ b/templates/bookmarks.html @@ -53,6 +53,9 @@
report_problem
+
+ comment +
{% for tag in tags %}
{{ tag }}