forked from nathanwoodburn/firewalletbrowser
feat: Finalize emoji rendering
This commit is contained in:
Binary file not shown.
20
main.py
20
main.py
@@ -429,12 +429,12 @@ def search():
|
||||
|
||||
if 'error' in domain:
|
||||
return render_template("search.html", account=account,
|
||||
|
||||
rendered=renderDomain(search_term),
|
||||
search_term=search_term, domain=domain['error'],plugins=plugins)
|
||||
|
||||
if domain['info'] is None:
|
||||
return render_template("search.html", account=account,
|
||||
|
||||
rendered=renderDomain(search_term),
|
||||
search_term=search_term,domain=search_term,
|
||||
state="AVAILABLE", next="Available Now",plugins=plugins)
|
||||
|
||||
@@ -478,7 +478,7 @@ def search():
|
||||
txs = render.txs(txs)
|
||||
|
||||
return render_template("search.html", account=account,
|
||||
|
||||
rendered=renderDomain(search_term),
|
||||
search_term=search_term,domain=domain['info']['name'],
|
||||
raw=domain,state=state, next=next, owner=owner,
|
||||
dns=dns, txs=txs,plugins=plugins)
|
||||
@@ -504,7 +504,7 @@ def manage(domain: str):
|
||||
domain_info = account_module.getDomain(domain)
|
||||
if 'error' in domain_info:
|
||||
return render_template("manage.html", account=account,
|
||||
|
||||
rendered=renderDomain(domain),
|
||||
domain=domain, error=domain_info['error'])
|
||||
|
||||
expiry = domain_info['info']['stats']['daysUntilExpire']
|
||||
@@ -541,7 +541,7 @@ def manage(domain: str):
|
||||
|
||||
|
||||
return render_template("manage.html", account=account,
|
||||
|
||||
rendered=renderDomain(domain),
|
||||
error=errorMessage, address=address,
|
||||
domain=domain,expiry=expiry, dns=dns,
|
||||
raw_dns=urllib.parse.quote(raw_dns),
|
||||
@@ -716,7 +716,7 @@ def editPage(domain: str):
|
||||
|
||||
|
||||
return render_template("edit.html", account=account,
|
||||
|
||||
rendered=renderDomain(domain),
|
||||
domain=domain, error=errorMessage,
|
||||
dns=dns,raw_dns=urllib.parse.quote(raw_dns))
|
||||
|
||||
@@ -862,7 +862,7 @@ def auction(domain):
|
||||
|
||||
if 'error' in domainInfo:
|
||||
return render_template("auction.html", account=account,
|
||||
|
||||
rendered=renderDomain(search_term),
|
||||
search_term=search_term, domain=domainInfo['error'],
|
||||
error=error)
|
||||
|
||||
@@ -873,7 +873,7 @@ def auction(domain):
|
||||
else:
|
||||
next_action = f'<a href="/auction/{domain}/open">Open Auction</a>'
|
||||
return render_template("auction.html", account=account,
|
||||
|
||||
rendered=renderDomain(search_term),
|
||||
search_term=search_term,domain=search_term,next_action=next_action,
|
||||
state="AVAILABLE", next="Open Auction",
|
||||
error=error)
|
||||
@@ -934,7 +934,7 @@ def auction(domain):
|
||||
|
||||
|
||||
return render_template("auction.html", account=account,
|
||||
|
||||
rendered=renderDomain(search_term),
|
||||
search_term=search_term,domain=domainInfo['info']['name'],
|
||||
raw=domainInfo,state=state, next=next,
|
||||
next_action=next_action, bids=bids,error=message)
|
||||
@@ -1598,7 +1598,7 @@ def renderDomain(name: str) -> str:
|
||||
rendered = name.encode("ascii").decode("idna")
|
||||
if rendered == name:
|
||||
return f"{name}/"
|
||||
return f"{rendered}/ ({name}/)"
|
||||
return f"{rendered}/ ({name})"
|
||||
|
||||
|
||||
except Exception as e:
|
||||
|
||||
10
render.py
10
render.py
@@ -3,6 +3,7 @@ import json
|
||||
import urllib.parse
|
||||
from flask import render_template
|
||||
from domainLookup import punycode_to_emoji
|
||||
from main import renderDomain
|
||||
import os
|
||||
|
||||
# Get Explorer URL
|
||||
@@ -24,10 +25,7 @@ def domains(domains, mobile=False):
|
||||
paid = paid / 1000000
|
||||
|
||||
# Handle punycodes
|
||||
name = domain['name']
|
||||
emoji = punycode_to_emoji(name)
|
||||
if emoji != name:
|
||||
name = f'{emoji} ({name})'
|
||||
name = renderDomain(domain['name'])
|
||||
|
||||
|
||||
link = f'/manage/{domain["name"]}'
|
||||
@@ -199,7 +197,7 @@ def bidDomains(bids,domains, sortbyDomains=False):
|
||||
|
||||
|
||||
html += "<tr>"
|
||||
html += f"<td><a class='text-decoration-none' style='color: var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color)));' href='/auction/{domain['name']}'>{domain['name']}</a></td>"
|
||||
html += f"<td><a class='text-decoration-none' style='color: var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color)));' href='/auction/{domain['name']}'>{renderDomain(domain['name'])}</a></td>"
|
||||
html += f"<td>{domain['state']}</td>"
|
||||
html += f"<td>{bidDisplay}</td>"
|
||||
html += f"<td>{domain['height']:,}</td>"
|
||||
@@ -215,7 +213,7 @@ def bidDomains(bids,domains, sortbyDomains=False):
|
||||
|
||||
bidDisplay = f'<b>{bidValue:,.2f} HNS</b> + {blind:,.2f} HNS blind'
|
||||
html += "<tr>"
|
||||
html += f"<td><a class='text-decoration-none' style='color: var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color)));' href='/auction/{domain['name']}'>{domain['name']}</a></td>"
|
||||
html += f"<td><a class='text-decoration-none' style='color: var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color)));' href='/auction/{domain['name']}'>{renderDomain(domain['name'])}</a></td>"
|
||||
html += f"<td>{domain['state']}</td>"
|
||||
html += f"<td>{bidDisplay}</td>"
|
||||
html += f"<td>{domain['height']:,}</td>"
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="stick-right">{{next_action|safe}}</div>
|
||||
<h4 class="card-title">{{domain}}/</h4>
|
||||
<h4 class="card-title">{{rendered}}</h4>
|
||||
<h6 class="text-muted card-subtitle mb-2">{{next}}</h6>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="card-title">{{domain}}/</h4>
|
||||
<h4 class="card-title">{{rendered}}</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="card-title">{{domain}}/<a class="btn btn-primary stick-right" role="button" href="/manage/{{domain}}/renew">Renew</a></h4>
|
||||
<h4 class="card-title">{{rendered}}<a class="btn btn-primary stick-right" role="button" href="/manage/{{domain}}/renew">Renew</a></h4>
|
||||
<h6 class="text-muted card-subtitle mb-2">Expires in {{expiry}} days</h6>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="d-none d-sm-none d-md-none d-lg-inline-block d-xl-inline-block card-title">{{domain}}/<span class="stick-right">{{next}}</span></h4>
|
||||
<h4 class="d-none d-sm-none d-md-none d-lg-inline-block d-xl-inline-block card-title">{{rendered}}<span class="stick-right">{{next}}</span></h4>
|
||||
<h4 class="d-print-none d-sm-inline-block d-md-inline-block d-lg-none d-xl-none d-xxl-none card-title">{{domain}}/<br><br><span class="stick-right">{{next}}</span></h4>
|
||||
<h6 class="text-muted card-subtitle mb-2"><br>{{state}}</h6>
|
||||
<h6 class="text-muted card-subtitle mb-2">Owner: {{owner}}</h6><a class="btn btn-primary" role="button" style="margin-right: 25px;" href="/manage/{{domain}}">Manage</a><a class="btn btn-primary" role="button" href="/auction/{{domain}}">Auction</a>
|
||||
|
||||
Reference in New Issue
Block a user