From 82eeab4b74bbdf9d461a4a586eb3e34b78debb15 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Tue, 30 May 2017 14:37:56 +0200 Subject: Improved UI for bookmarks. It is now possible to search bookmarks through titles and descriptions. --- src/web/views/bookmark.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/web/views') diff --git a/src/web/views/bookmark.py b/src/web/views/bookmark.py index 8736e1ca..69a094ac 100644 --- a/src/web/views/bookmark.py +++ b/src/web/views/bookmark.py @@ -58,6 +58,11 @@ def list_(per_page, status='all'): tag = request.args.get('tag', None) if tag: filters['tags_proxy__contains'] = tag + query = request.args.get('query', None) + if query: + query = '%' + query + '%' + filters['__or__'] = {'title__ilike': query, 'description__ilike': query} + if current_user.is_authenticated: # query for the bookmarks of the authenticated user -- cgit