From 38825876b64cdd08495f515a5d503f3da89385c2 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 8 Apr 2020 14:20:07 -0700 Subject: initial implementation of filters --- fatcat_covid19/webface.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'fatcat_covid19/webface.py') diff --git a/fatcat_covid19/webface.py b/fatcat_covid19/webface.py index 662a2f0..aa604df 100644 --- a/fatcat_covid19/webface.py +++ b/fatcat_covid19/webface.py @@ -83,15 +83,17 @@ def page_home(): def fulltext_search(): query = request.args.get('q') + filter_type = request.args.get('filter_type') or None + filter_time = request.args.get('filter_time') or None offset = request.args.get('offset', '0') offset = max(0, int(offset)) if offset.isnumeric() else 0 if 'q' in request.args.keys(): - found = do_fulltext_search(query, offset=offset) - return render_template('fulltext_search.html', found=found, query=query) + found = do_fulltext_search(query, offset=offset, filter_type=filter_type, filter_time=filter_time) + return render_template('fulltext_search.html', found=found, query=query, filter_type=filter_type, filter_time=filter_time) else: - return render_template('fulltext_search.html', query=query) + return render_template('fulltext_search.html', query=query, filter_type=filter_type, filter_time=filter_time) @bp.route('/about', methods=['GET']) def page_about(): -- cgit v1.2.3