mirror of
https://github.com/aquatix/digimarks.git
synced 2025-12-06 23:05: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':
|
if filtermethod and filtermethod.lower() == 'broken':
|
||||||
filter_broken = True
|
filter_broken = True
|
||||||
|
|
||||||
|
filter_note = False
|
||||||
|
if filtermethod and filtermethod.lower() == 'note':
|
||||||
|
filter_note = True
|
||||||
|
|
||||||
if filter_text:
|
if filter_text:
|
||||||
bookmarks = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.title.contains(filter_text),
|
bookmarks = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.title.contains(filter_text),
|
||||||
Bookmark.status == Bookmark.VISIBLE).order_by(Bookmark.created_date.desc())
|
Bookmark.status == Bookmark.VISIBLE).order_by(Bookmark.created_date.desc())
|
||||||
@@ -296,6 +300,9 @@ def bookmarks(userkey, filtermethod = None, sortmethod = None):
|
|||||||
elif filter_broken:
|
elif filter_broken:
|
||||||
bookmarks = Bookmark.select().where(Bookmark.userkey == userkey,
|
bookmarks = Bookmark.select().where(Bookmark.userkey == userkey,
|
||||||
Bookmark.http_status != 200).order_by(Bookmark.created_date.desc())
|
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:
|
else:
|
||||||
bookmarks = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.status == Bookmark.VISIBLE).order_by(Bookmark.created_date.desc())
|
bookmarks = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.status == Bookmark.VISIBLE).order_by(Bookmark.created_date.desc())
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,9 @@
|
|||||||
<div class="chip">
|
<div class="chip">
|
||||||
<a href="{{ url_for('bookmarks', userkey=userkey, filtermethod='broken') }}"><i class="tiny material-icons red-text">report_problem</i></a>
|
<a href="{{ url_for('bookmarks', userkey=userkey, filtermethod='broken') }}"><i class="tiny material-icons red-text">report_problem</i></a>
|
||||||
</div>
|
</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 %}
|
{% for tag in tags %}
|
||||||
<div class="chip">
|
<div class="chip">
|
||||||
<a href="{{ url_for('tag', userkey=userkey, tag=tag) }}">{{ tag }}</a>
|
<a href="{{ url_for('tag', userkey=userkey, tag=tag) }}">{{ tag }}</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user