feat: Add more address and logo options
This commit is contained in:
parent
c69a600aa1
commit
cd1253d0fd
@ -56,21 +56,35 @@ def render(data,db_object):
|
|||||||
hns_icon = "assets/img/HNSW.png"
|
hns_icon = "assets/img/HNSW.png"
|
||||||
btc_icon = "assets/img/BTCW.png"
|
btc_icon = "assets/img/BTCW.png"
|
||||||
eth_icon = "assets/img/ETHW.png"
|
eth_icon = "assets/img/ETHW.png"
|
||||||
|
hns_icon_invert = "assets/img/HNS.png"
|
||||||
|
btc_icon_invert = "assets/img/BTC.png"
|
||||||
|
eth_icon_invert = "assets/img/ETH.png"
|
||||||
location_icon = "assets/img/mapw.png"
|
location_icon = "assets/img/mapw.png"
|
||||||
email_icon = "assets/img/emailw.png"
|
email_icon = "assets/img/emailw.png"
|
||||||
else:
|
else:
|
||||||
hns_icon = "assets/img/HNS.png"
|
hns_icon = "assets/img/HNS.png"
|
||||||
btc_icon = "assets/img/BTC.png"
|
btc_icon = "assets/img/BTC.png"
|
||||||
eth_icon = "assets/img/ETH.png"
|
eth_icon = "assets/img/ETH.png"
|
||||||
|
hns_icon_invert = "assets/img/HNSW.png"
|
||||||
|
btc_icon_invert = "assets/img/BTCW.png"
|
||||||
|
eth_icon_invert = "assets/img/ETHW.png"
|
||||||
location_icon = "assets/img/map.png"
|
location_icon = "assets/img/map.png"
|
||||||
email_icon = "assets/img/email.png"
|
email_icon = "assets/img/email.png"
|
||||||
|
hns_address = hns
|
||||||
|
btc_address = btc
|
||||||
|
eth_address = eth
|
||||||
if hns != "":
|
if hns != "":
|
||||||
hns = "<img src='" + hns_icon + "' width='20px' height='20px' style='margin-right: 5px;'>" + hns
|
hns = "<img src='" + hns_icon + "' width='20px' height='20px' style='margin-right: 5px;'>" + hns
|
||||||
if btc != "":
|
if btc != "":
|
||||||
btc = "<img src='" + btc_icon + "' width='20px' height='25px' style='margin-right: 5px;'>" + btc
|
btc = "<img src='" + btc_icon + "' width='20px' height='25px' style='margin-right: 5px;'>" + btc
|
||||||
if eth != "":
|
if eth != "":
|
||||||
eth = "<img src='" + eth_icon + "' width='20px' height='30px' style='margin-right: 5px;'>" + eth
|
eth = "<img src='" + eth_icon + "' width='20px' height='30px' style='margin-right: 5px;'>" + eth
|
||||||
|
if hns != "":
|
||||||
|
hns_invert = "<img src='" + hns_icon_invert + "' width='20px' height='20px' style='margin-right: 5px;'>" + hns_address
|
||||||
|
if btc != "":
|
||||||
|
btc_invert = "<img src='" + btc_icon_invert + "' width='20px' height='25px' style='margin-right: 5px;'>" + btc_address
|
||||||
|
if eth != "":
|
||||||
|
eth_invert = "<img src='" + eth_icon_invert + "' width='20px' height='30px' style='margin-right: 5px;'>" + eth_address
|
||||||
|
|
||||||
hide_addresses = False
|
hide_addresses = False
|
||||||
if hns == "" and btc == "" and eth == "":
|
if hns == "" and btc == "" and eth == "":
|
||||||
@ -95,17 +109,14 @@ def render(data,db_object):
|
|||||||
template = db_object['template']
|
template = db_object['template']
|
||||||
|
|
||||||
footer = render_template_string(FOOTER,main_domain=main_domain,fg_colour=fg_colour,hns_icon=hns_icon)
|
footer = render_template_string(FOOTER,main_domain=main_domain,fg_colour=fg_colour,hns_icon=hns_icon)
|
||||||
if hide_addresses:
|
return render_template_string(get_template(template,hide_addresses),bg_colour=bg_colour,text_colour=text_colour,
|
||||||
return render_template_string(get_template(template,True),bg_colour=bg_colour,text_colour=text_colour,
|
fg_colour=fg_colour, avatar=avatar,main_domain=main_domain,
|
||||||
fg_colour=fg_colour, avatar=avatar,main_domain=main_domain,
|
hnschat=hnschat,email=email,location=location, hns_icon=hns_icon,
|
||||||
hnschat=hnschat,email=email,location=location, hns_icon=hns_icon,
|
hns=hns,btc=btc,eth=eth,hns_invert=hns_invert,btc_invert=btc_invert,
|
||||||
hns=hns,btc=btc,eth=eth, data=html,footer=footer)
|
eth_invert=eth_invert,hns_address=hns_address,btc_address=btc_address,eth_address=eth_address,
|
||||||
else:
|
hns_icon_invert=hns_icon_invert,btc_icon=btc_icon,btc_icon_invert=btc_icon_invert,
|
||||||
return render_template_string(get_template(template),bg_colour=bg_colour,text_colour=text_colour,
|
eth_icon=eth_icon,eth_icon_invert=eth_icon_invert,
|
||||||
fg_colour=fg_colour, avatar=avatar,main_domain=main_domain,
|
data=html,footer=footer)
|
||||||
hnschat=hnschat,email=email,location=location, hns_icon=hns_icon,
|
|
||||||
hns=hns,btc=btc,eth=eth, data=html,footer=footer)
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return redirect("https://" + main_domain + '/empty_site?error='+str(e))
|
return redirect("https://" + main_domain + '/empty_site?error='+str(e))
|
||||||
|
|
||||||
|
12
template.py
12
template.py
@ -12,9 +12,9 @@ db_object = {
|
|||||||
'hnschat':"nathan.woodburn",
|
'hnschat':"nathan.woodburn",
|
||||||
'location': "Australia",
|
'location': "Australia",
|
||||||
'email': "test@email",
|
'email': "test@email",
|
||||||
'HNS': "hs1...",
|
'HNS': "hs1qh7c98nexsrzwrmnh2avved6awe59jzpr3xx2xf",
|
||||||
'BTC': "bc1...",
|
'BTC': "bc1qhs94zzcw64qnwq4hvk056rwxwvgrkd7tq7d4xw",
|
||||||
'ETH' : "0x...",
|
'ETH' : "0x6cB4B39bEc23a921C9a20D061Bf17d4640B0d39e",
|
||||||
'bg_colour': "#000000",
|
'bg_colour': "#000000",
|
||||||
'fg_colour': "#ffffff",
|
'fg_colour': "#ffffff",
|
||||||
'text_colour': "#152D45",
|
'text_colour': "#152D45",
|
||||||
@ -46,6 +46,12 @@ def send_assets(path):
|
|||||||
return send_from_directory('templates/assets', path)
|
return send_from_directory('templates/assets', path)
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/.well-known/wallets/<path:path>')
|
||||||
|
def send_wallets(path):
|
||||||
|
if path in db_object:
|
||||||
|
return db_object[path]
|
||||||
|
else:
|
||||||
|
return "Not found"
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# Get second arg
|
# Get second arg
|
||||||
|
Loading…
Reference in New Issue
Block a user