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

pull/9/head
Ben Busby 4 years ago
parent 5687c87a65
commit 2411f9de8d

@ -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')

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -1 +1,12 @@
{{ response|safe }}
<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 }}
</body>
</html>

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

@ -1,19 +1,26 @@
<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">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/static/css/main.css">
</head>
<body>
<div class="search-container">
<img class="logo" src="/static/img/logo.png">
<div class="search-fields">
<input type="text" id="search-bar">
<button type="submit" id="search-submit">Search</button>
</div>
<br/>
<div class="config-fields">
<label for="config-near">Near: </label>
<input type="text" name="config-near" id="config-near" placeholder="City Name">
<button type="submit" id="config-submit">Save</button>
</div>
</div>
</body>
</html>
<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">
<script src="/static/js/controller.js"></script>
<link rel="stylesheet" href="/static/css/main.css">
<div class="search-container">
<img class="logo" src="/static/img/logo.png">
<div class="search-fields">
<input type="text" id="search-bar">
<button type="submit" id="search-submit">Search</button>
</div>
<br/>
<div class="config-fields">
<label for="config-near">Near: </label>
<input type="text" name="config-near" id="config-near" placeholder="City Name">
<button type="submit" id="config-submit">Save</button>
</div>
</div>

Loading…
Cancel
Save