mirror of
https://github.com/basicswap/basicswap.git
synced 2025-01-03 09:19:26 +00:00
Add favicon and css, inc version.
This commit is contained in:
parent
0c9429bfa5
commit
1ba2ad6f0b
9 changed files with 54 additions and 9 deletions
|
@ -2,3 +2,4 @@ include *.md LICENSE
|
|||
|
||||
recursive-include doc *
|
||||
recursive-include basicswap/templates *
|
||||
recursive-include basicswap/static *
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
name = "basicswap"
|
||||
|
||||
__version__ = "0.0.7"
|
||||
__version__ = "0.0.8"
|
||||
|
|
|
@ -794,6 +794,12 @@ class HttpHandler(BaseHTTPRequestHandler):
|
|||
summary=summary
|
||||
), 'UTF-8')
|
||||
|
||||
def page_404(self, url_split):
|
||||
template = env.get_template('404.html')
|
||||
return bytes(template.render(
|
||||
title=self.server.title,
|
||||
), 'UTF-8')
|
||||
|
||||
def putHeaders(self, status_code, content_type):
|
||||
self.send_response(status_code)
|
||||
if self.server.allow_cors:
|
||||
|
@ -820,6 +826,28 @@ class HttpHandler(BaseHTTPRequestHandler):
|
|||
if self.server.swap_client.debug is True:
|
||||
traceback.print_exc()
|
||||
return js_error(self, str(ex))
|
||||
|
||||
if len(url_split) > 1 and url_split[1] == 'static':
|
||||
try:
|
||||
static_path = os.path.join(os.path.dirname(__file__), 'static')
|
||||
|
||||
if url_split[2] == 'favicon-32.png':
|
||||
self.putHeaders(status_code, 'image/png')
|
||||
with open(os.path.join(static_path, 'favicon-32.png'), 'rb') as fp:
|
||||
return fp.read()
|
||||
elif url_split[2] == 'style.css':
|
||||
self.putHeaders(status_code, 'text/css')
|
||||
with open(os.path.join(static_path, 'style.css'), 'rb') as fp:
|
||||
return fp.read()
|
||||
else:
|
||||
self.putHeaders(status_code, 'text/html')
|
||||
return self.page_404(url_split)
|
||||
except Exception as ex:
|
||||
self.putHeaders(status_code, 'text/html')
|
||||
if self.server.swap_client.debug is True:
|
||||
traceback.print_exc()
|
||||
return self.page_error(str(ex))
|
||||
|
||||
try:
|
||||
self.putHeaders(status_code, 'text/html')
|
||||
if len(url_split) > 1:
|
||||
|
|
BIN
basicswap/static/favicon-32.png
Normal file
BIN
basicswap/static/favicon-32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 715 B |
10
basicswap/static/style.css
Normal file
10
basicswap/static/style.css
Normal file
|
@ -0,0 +1,10 @@
|
|||
|
||||
.padded_row td
|
||||
{
|
||||
padding-top:1.5em;
|
||||
}
|
||||
|
||||
.bold
|
||||
{
|
||||
font-weight:bold;
|
||||
}
|
6
basicswap/templates/404.html
Normal file
6
basicswap/templates/404.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
{% include 'header.html' %}
|
||||
|
||||
<p>404 Page Not Found</p>
|
||||
|
||||
<p><a href="/">home</a></p>
|
||||
</body></html>
|
|
@ -4,6 +4,8 @@
|
|||
{% if refresh %}
|
||||
<meta http-equiv="refresh" content="{{ refresh }}">
|
||||
{% endif %}
|
||||
<link type="text/css" media="all" href="/static/style.css" rel="stylesheet">
|
||||
<link rel=icon sizes="32x32" type="image/png" href="/static/favicon-32.png">
|
||||
<title>{{ title }}</title>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<option{% if data.addr_from=="-1" %} selected{% endif %} value="-1">-- New Address --</option>
|
||||
</select></td></tr>
|
||||
|
||||
<tr><td>Coin From</td><td>
|
||||
<tr class="padded_row"><td class="bold">Coin From</td><td>
|
||||
<select name="coin_from_" disabled><option value="-1">-- Select Coin --</option>
|
||||
{% for c in coins %}
|
||||
<option{% if data.coin_from==c[0] %} selected{% endif %} value="{{ c[0] }}">{{ c[1] }}</option>
|
||||
|
@ -35,7 +35,7 @@
|
|||
<tr><td>Lock Tx Spend Fee</td><td>{{ data.amt_from_lock_spend_tx_fee }} {{ data.tla_from }}</td></tr>
|
||||
{% endif %}
|
||||
|
||||
<tr><td>Coin To</td><td>
|
||||
<tr class="padded_row"><td class="bold">Coin To</td><td>
|
||||
<select name="coin_to_" disabled><option value="-1">-- Select Coin --</option>
|
||||
{% for c in coins %}
|
||||
<option{% if data.coin_to==c[0] %} selected{% endif %} value="{{ c[0] }}">{{ c[1] }}</option>
|
||||
|
@ -54,7 +54,7 @@
|
|||
</select></td></tr>
|
||||
{% endif %}
|
||||
|
||||
<tr><td>Contract locked (hrs)</td><td><input type="number" name="lockhrs" min="1" max="64" value="{{ data.lockhrs }}" readonly></td>{% if data.swap_style != 'xmr' %}<td colspan=2>Participate txn will be locked for half the time.</td>{% endif %}</tr>
|
||||
<tr class="padded_row"><td>Contract locked (hrs)</td><td><input type="number" name="lockhrs" min="1" max="64" value="{{ data.lockhrs }}" readonly></td>{% if data.swap_style != 'xmr' %}<td colspan=2>Participate txn will be locked for half the time.</td>{% endif %}</tr>
|
||||
<tr><td>Auto Accept Bids</td><td colspan=3><input type="checkbox" name="autoaccept_" value="aa" {% if data.autoaccept==true %} checked="true"{% endif %} disabled></td></tr>
|
||||
</table>
|
||||
|
||||
|
@ -71,5 +71,4 @@
|
|||
{% endif %}
|
||||
</form>
|
||||
|
||||
<p><a href="/">home</a></p>
|
||||
</body></html>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<option{% if data.addr_from=="-1" %} selected{% endif %} value="-1">-- New Address --</option>
|
||||
</select></td></tr>
|
||||
|
||||
<tr><td>Coin From</td><td>
|
||||
<tr class="padded_row"><td class="bold">Coin From</td><td>
|
||||
<select name="coin_from_" disabled><option value="-1">-- Select Coin --</option>
|
||||
{% for c in coins %}
|
||||
<option{% if data.coin_from==c[0] %} selected{% endif %} value="{{ c[0] }}">{{ c[1] }}</option>
|
||||
|
@ -33,7 +33,7 @@
|
|||
</select></td></tr>
|
||||
{% endif %}
|
||||
|
||||
<tr><td>Coin To</td><td>
|
||||
<tr class="padded_row"><td class="bold">Coin To</td><td>
|
||||
<select name="coin_to_" disabled><option value="-1">-- Select Coin --</option>
|
||||
{% for c in coins %}
|
||||
<option{% if data.coin_to==c[0] %} selected{% endif %} value="{{ c[0] }}">{{ c[1] }}</option>
|
||||
|
@ -51,7 +51,7 @@
|
|||
</select></td></tr>
|
||||
{% endif %}
|
||||
|
||||
<tr><td>Contract locked (hrs)</td><td><input type="number" name="lockhrs" min="1" max="64" value="{{ data.lockhrs }}"></td><td colspan=2>Participate txn will be locked for half the time.</td></tr>
|
||||
<tr class="padded_row"><td>Contract locked (hrs)</td><td><input type="number" name="lockhrs" min="1" max="64" value="{{ data.lockhrs }}"></td><td colspan=2>Participate txn will be locked for half the time.</td></tr>
|
||||
<tr><td>Auto Accept Bids</td><td colspan=3><input type="checkbox" name="autoaccept" value="aa" {% if data.autoaccept==true %} checked="true"{% endif %}></td></tr>
|
||||
</table>
|
||||
|
||||
|
@ -63,5 +63,4 @@
|
|||
<input type="hidden" name="coin_to" value="{{ data.coin_to }}">
|
||||
</form>
|
||||
|
||||
<p><a href="/">home</a></p>
|
||||
</body></html>
|
||||
|
|
Loading…
Reference in a new issue