diff options
author | Bryan Newbold <bnewbold@archive.org> | 2020-04-08 14:20:07 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2020-04-08 14:20:07 -0700 |
commit | 38825876b64cdd08495f515a5d503f3da89385c2 (patch) | |
tree | 5943301977a24a56251c03cf479d0e58565f7975 /fatcat_covid19/webface.py | |
parent | 8be6905af1d3637742b76b8f0de44471b2b90759 (diff) | |
download | fatcat-covid19-38825876b64cdd08495f515a5d503f3da89385c2.tar.gz fatcat-covid19-38825876b64cdd08495f515a5d503f3da89385c2.zip |
initial implementation of filters
Diffstat (limited to 'fatcat_covid19/webface.py')
-rw-r--r-- | fatcat_covid19/webface.py | 8 |
1 files changed, 5 insertions, 3 deletions
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(): |