mirror of
https://github.com/aquatix/digimarks.git
synced 2025-12-06 20:55:10 +01:00
Filter on bookmarks with a note
This commit is contained in:
@@ -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())
|
||||
|
||||
|
||||
@@ -53,6 +53,9 @@
|
||||
<div class="chip">
|
||||
<a href="{{ url_for('bookmarks', userkey=userkey, filtermethod='broken') }}"><i class="tiny material-icons red-text">report_problem</i></a>
|
||||
</div>
|
||||
<div class="chip">
|
||||
<a href="{{ url_for('bookmarks', userkey=userkey, filtermethod='note') }}"><i class="tiny material-icons">comment</i></a>
|
||||
</div>
|
||||
{% for tag in tags %}
|
||||
<div class="chip">
|
||||
<a href="{{ url_for('tag', userkey=userkey, tag=tag) }}">{{ tag }}</a>
|
||||
|
||||
Reference in New Issue
Block a user