Fixed bug in nojs config setting, updated pages to use new favicon and proper headers

main
Ben Busby 2020-04-07 14:12:16 -06:00
parent 5687c87a65
commit 2411f9de8d
5 changed files with 45 additions and 23 deletions

View File

@ -133,7 +133,7 @@ def search():
href = parse_qs(href.query)['q'][0] href = parse_qs(href.query)['q'][0]
# Add no-js option # 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 = soup.new_tag('a')
nojs_link['href'] = '/window?location=' + href nojs_link['href'] = '/window?location=' + href
nojs_link['style'] = 'display:block;width:100%;' nojs_link['style'] = 'display:block;width:100%;'
@ -149,7 +149,7 @@ def search():
except Exception: except Exception:
pass pass
return render_template('display.html', response=soup) return render_template('display.html', query=q, response=soup)
@app.route('/config', methods=['POST']) @app.route('/config', methods=['POST'])
@ -173,7 +173,7 @@ def url():
if len(q) > 0 and 'http' in q: if len(q) > 0 and 'http' in q:
return redirect(q) return redirect(q)
else: else:
return render_template('error.html') return render_template('error.html', query=q)
@app.route('/imgres') @app.route('/imgres')

BIN
app/static/img/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1 +1,12 @@
<html>
<head>
<link rel="shortcut icon" href="/static/img/favicon.ico" type="image/x-icon">
<link rel="icon" href="/static/img/favicon.ico" type="image/x-icon">
<link rel="search" href="/static/opensearch.xml" type="application/opensearchdescription+xml" title="Shoogle Search">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ query }} - Shoogle Search</title>
</head>
<body>
{{ response|safe }} {{ response|safe }}
</body>
</html>

View File

@ -1 +1,5 @@
error parsing url <h1>Error</h1>
<hr>
<p>
Error parsing "{{ query }}"
</p>

View File

@ -1,9 +1,13 @@
<html>
<head>
<link rel="shortcut icon" href="/static/img/favicon.ico" type="image/x-icon">
<link rel="icon" href="/static/img/favicon.ico" type="image/x-icon">
<script type="text/javascript" src="/static/js/controller.js"></script>
<link rel="search" href="/static/opensearch.xml" type="application/opensearchdescription+xml" title="Shoogle Search"> <link rel="search" href="/static/opensearch.xml" type="application/opensearchdescription+xml" title="Shoogle Search">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/static/js/controller.js"></script>
<link rel="stylesheet" href="/static/css/main.css"> <link rel="stylesheet" href="/static/css/main.css">
</head>
<body>
<div class="search-container"> <div class="search-container">
<img class="logo" src="/static/img/logo.png"> <img class="logo" src="/static/img/logo.png">
<div class="search-fields"> <div class="search-fields">
@ -17,3 +21,6 @@
<button type="submit" id="config-submit">Save</button> <button type="submit" id="config-submit">Save</button>
</div> </div>
</div> </div>
</body>
</html>