add blockchain explorer and supporting tag so we can search transaction ids

pull/3/head
lance 5 years ago
parent cf95765783
commit acf2220301

@ -1,4 +1,3 @@
from math import ceil
from django import template
from django.conf import settings

@ -0,0 +1,10 @@
from django import template
from django.conf import settings
register = template.Library()
@register.filter(is_safe=True)
def search_block_explorer(param):
search_url = f'{settings.BLOCK_EXPLORER}search?value={param}'
return search_url

@ -1,3 +1,4 @@
{% load search_block_explorer %}
{% if request.user == sale.bid.bidder %}
<p class="sale-info">Hey {{ sale.bid.bidder.username }},</p>
<p class="sale-info">It sounds like your order was successful. The seller will be sent their funds from the transaction out of the escrow wallet. You are good to go!</p>
@ -21,7 +22,7 @@
<p class="sale-info"><strong>Network Fee (XMR)</strong>: {{ sale.network_fee_xmr }}</p>
<p class="sale-info"><strong>Total Payout (XMR)</strong>: {{ total_seller_payout }}</p>
<p class="sale-info"><strong>Payout Address</strong>: {{ sale.item.payout_address }}</p>
<p class="sale-info"><strong>Payout Transaction ID</strong>: {{ sale.seller_payout_transaction }}</p>
<p class="sale-info"><strong>Payout Transaction ID</strong>: <a href="{{ sale.seller_payout_transaction | search_block_explorer }}" target="_blank">{{ sale.seller_payout_transaction }}</a></p>
<br>
<p class="sale-info">If you found the site useful and had a good experience, please consider sending a tip to the developer address provided at the bottom of the page.</p>
<p class="sale-info">Thanks for using {{ site_meta.name }}!</p>

@ -29,6 +29,11 @@ ESCROW_PERIOD_DAYS = os.environ.get('ESCROW_PERIOD_DAYS', 30)
PLATFORM_FEE_PERCENT = os.environ.get('PLATFORM_FEE_PERCENT', 0)
BLOCK_CONFIRMATIONS_RCV = os.environ.get('BLOCK_CONFIRMATIONS_RCV', 3)
if DEBUG:
BLOCK_EXPLORER = 'https://community.xmr.to/explorer/stagenet/'
else:
BLOCK_EXPLORER = 'https://community.xmr.to/explorer/mainnet/'
# Application definition