From 9212f9921aea09ea4d744a3e935676e52d4a72ef Mon Sep 17 00:00:00 2001 From: Ben Busby <33362396+benbusby@users.noreply.github.com> Date: Mon, 25 May 2020 10:53:15 -0600 Subject: [PATCH] Fixed #76 Added enter key submit on results page Added results type carryover for subsequent searches on results page Removed redundant header on image search results --- app/routes.py | 8 +++++++- app/templates/header.html | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/routes.py b/app/routes.py index c4f184f..3b99508 100644 --- a/app/routes.py +++ b/app/routes.py @@ -133,14 +133,20 @@ def search(): else: formatted_results = content_filter.clean(dirty_soup) + # Set search type to be used in the header template to allow for repeated searches + # in the same category + search_type = request_params.get('tbm') if 'tbm' in request_params else '' + return render_template( 'display.html', query=urlparse.unquote(q), + search_type=search_type, response=formatted_results, search_header=render_template( 'header.html', q=urlparse.unquote(q), - mobile=g.user_request.mobile)) + search_type=search_type, + mobile=g.user_request.mobile) if 'isch' not in search_type else '') @app.route('/config', methods=['GET', 'POST']) diff --git a/app/templates/header.html b/app/templates/header.html index e106ffe..8db1459 100644 --- a/app/templates/header.html +++ b/app/templates/header.html @@ -13,6 +13,7 @@