diff --git a/app/routes.py b/app/routes.py index 94ff473..c7aaea7 100644 --- a/app/routes.py +++ b/app/routes.py @@ -133,7 +133,7 @@ def search(): href = parse_qs(href.query)['q'][0] # Add no-js option - if user_config['nojs']: + if 'nojs' in user_config and user_config['nojs']: nojs_link = soup.new_tag('a') nojs_link['href'] = '/window?location=' + href nojs_link['style'] = 'display:block;width:100%;' @@ -149,7 +149,7 @@ def search(): except Exception: pass - return render_template('display.html', response=soup) + return render_template('display.html', query=q, response=soup) @app.route('/config', methods=['POST']) @@ -173,7 +173,7 @@ def url(): if len(q) > 0 and 'http' in q: return redirect(q) else: - return render_template('error.html') + return render_template('error.html', query=q) @app.route('/imgres') diff --git a/app/static/img/favicon.ico b/app/static/img/favicon.ico new file mode 100644 index 0000000..52b927e Binary files /dev/null and b/app/static/img/favicon.ico differ diff --git a/app/templates/display.html b/app/templates/display.html index 5d6b14e..f0f7499 100644 --- a/app/templates/display.html +++ b/app/templates/display.html @@ -1 +1,12 @@ -{{ response|safe }} + + + + + + + {{ query }} - Shoogle Search + + + {{ response|safe }} + + diff --git a/app/templates/error.html b/app/templates/error.html index 82b0b1a..003623d 100644 --- a/app/templates/error.html +++ b/app/templates/error.html @@ -1 +1,5 @@ -error parsing url +

Error

+
+

+ Error parsing "{{ query }}" +

diff --git a/app/templates/index.html b/app/templates/index.html index 2e8a29a..695a4c4 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -1,19 +1,26 @@ + + + + + + + + + + +
+ +
+ + +
+
+
+ + + +
+
+ + - - - - - -
- -
- - -
-
-
- - - -
-