From 2411f9de8d7fae65ce3a619fabaf51dc01955b6f Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Tue, 7 Apr 2020 14:12:16 -0600 Subject: [PATCH] Fixed bug in nojs config setting, updated pages to use new favicon and proper headers --- app/routes.py | 6 +++--- app/static/img/favicon.ico | Bin 0 -> 1150 bytes app/templates/display.html | 13 ++++++++++- app/templates/error.html | 6 +++++- app/templates/index.html | 43 +++++++++++++++++++++---------------- 5 files changed, 45 insertions(+), 23 deletions(-) create mode 100644 app/static/img/favicon.ico 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 0000000000000000000000000000000000000000..52b927e3f8bb23dcdc7aa8bf96a6dd687c362895 GIT binary patch literal 1150 zcmZ{j?Mu^96vyu>l8Qij(QA8A1ikV9v874wL6=Rc<>s6lttX}D2U{4GN#HEB+SCkE zdtenMnw7E)=T;VEijh!k?A!NT_mi=3TiL$LzYO7Le zC!vX!WjhC@xVB}}GJ2l(@a(avhH{&U<1P{)&q=B}*_t3O#@Ng?9YaR4fi#o9q)@j!H`~x$=RwoH+B9Qap`VW7Hfz0|^FOO;>vvml z(Hq2UB8kEKz3^64r|IkRRodm-JIKd;t@s-pDXYS%Iya^#KOvJ&BhnEz_BTyUDRGgE z=(#U6Ryxpj@+=0rdhjURja#QLVf@uwWV2a3jSir3Zw)-mh5k|_scEmF4OpCrJs!m3 z`~qg;pEbW1e?fkuvDXM#o%$Q%pCiWcy`hiZxr_N9bGUu3RqBMMs#{}DkJTK)_taN(UAqaX znc*kz_uAU=E%^n(>Vt**mmYJHw2yV09397-;TLEqx3AQnXN8exF-(k%>Dn4`IZFMc zPq&dVH}@%dOYMdu{kXvMmNS={i>>|4<-+{q)Jd;P4^)sP`EEFL1G6(JEX@7XNY8Y( zUe|k~kCB)3>Hb{riGDrtktM0camQhVf-MLgZPD*yC^4GJHDb#6e%^dRw=)UtXNln(SGz5 HjcES?o;5P$ literal 0 HcmV?d00001 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 @@ + + + + + + + + + + +
+ +
+ + +
+
+
+ + + +
+
+ + - - - - - -
- -
- - -
-
-
- - - -
-