ux improvements

main
lza_menace 3 years ago
parent 37e9a114a3
commit 01075c6bc4

@ -20,6 +20,7 @@ MAX_CONTENT_LENGTH = 32 * 1024 * 1024
TEMPLATES_AUTO_RELOAD = getenv('TEMPLATES_AUTO_RELOAD', True)
# Contract
CONTRACT_TESTNET = getenv('TESTNET', True)
CONTRACT_ADDRESS = '0x9797afc5d0258704109f71109188fdcba19c24c2' # Fuji
CONTRACT_ABI = [
{

@ -1,6 +1,8 @@
from flask import Blueprint
from arrow import get as arrow_get
from suchwowx import config
bp = Blueprint('filters', 'filters')
@ -15,3 +17,13 @@ def shorten_address(a):
@bp.app_template_filter('humanize')
def humanize(d):
return arrow_get(d).humanize()
@bp.app_template_filter()
def show_snowtrace(s) -> str:
"""
Return proper links to Etherscan based upon the currently configured network.
"""
if config.CONTRACT_TESTNET:
return f'https://testnet.snowtrace.io/search?f=0&q={s}'
else:
return f'https://snowtrace.io/search?f=0&q={s}'

@ -24,8 +24,8 @@
{% endif %}
</div>
<div class="media-content">
<p class="title is-4">{{ meme.user.handle }}</p>
<p class="subtitle is-6">{{ meme.user.public_address | shorten_address }}</p>
<p class="title is-4"><a href="{{ url_for('user.show', handle=meme.user.handle) }}">{{ meme.user.handle }}</a></p>
<p class="subtitle is-6"><a href="{{ meme.user.public_address | show_snowtrace }}" target="_blank">{{ meme.user.public_address | shorten_address }}</a></p>
</div>
</div>

@ -26,24 +26,35 @@
</br></br>
<p><strong>From Local Database</strong></p>
<p>
Handle: <input id="handleInput" type="text" placeholder="{{ user.handle }}" value="{{ user.handle }}"></input>
Handle:
{% if is_user %}
<input id="handleInput" type="text" placeholder="{{ user.handle }}" value="{{ user.handle }}"></input>
<a onclick="publishHandleAVAX()" class="publishAVAX">Publish AVAX</a>
{% else %}
<strong>{{ user.handle }}</strong>
{% endif %}
</p>
<p>
Wownero Address: <input id="wowneroAddressInput" type="text" placeholder="{{ user.wownero_address }}" value="{{ user.wownero_address }}"></input>
Wownero Address:
{% if is_user %}
<input id="wowneroAddressInput" type="text" placeholder="{{ user.wownero_address }}" value="{{ user.wownero_address }}"></input>
<a onclick="publishWowneroAddress()" class="publishAVAX">Publish AVAX</a>
{% else %}
<strong>{{ user.wownero_address }}</strong>
{% endif %}
</p>
<p>
Metadata IPFS Hash: <input id="metadataIPFSHashInput" type="text" placeholder="{{ user.ipfs_hash }}" value="{{ user.ipfs_hash }}"></input>
Metadata IPFS Hash:
{% if is_user %}
<input id="metadataIPFSHashInput" type="text" placeholder="{{ user.ipfs_hash }}" value="{{ user.ipfs_hash }}"></input>
<a onclick="publishMetadataIPFSHash()" class="publishAVAX">Publish AVAX</a>
{% else %}
<strong>{{ user.ipfs_hash }}</strong>
{% endif %}
</p>
{% if is_user %}
<p><a onclick="saveDB()" class="ml-2 button is-primary">Save DB</a></p>
{% endif %}
<p>Register Date: <strong>{{ user.register_date }}</strong></p>
<p>Login Date: <strong>{{ user.last_login_date }}</strong></p>
<p>Moderator: <strong>{{ user.is_moderator() }}</strong></p>

Loading…
Cancel
Save