Claim address updates
-Claimed addresses now replace actual wallet addresses across all pages of the site -Add new claim_address setting to enable/disable claiming of addresses -Add ability to un-claim an address by signing a blank message
This commit is contained in:
+21
-19
@@ -10,27 +10,29 @@ block content
|
||||
.col-xs-12.col-md-12
|
||||
.card.card-default.border-0.card-address-summary.cardSpacer
|
||||
.card-header(style='position:relative;')
|
||||
strong #{address.a_id}
|
||||
if settings.labels[address.a_id]
|
||||
if settings.labels[address.a_id].type
|
||||
label.d-none.d-sm-block.badge.float-right(class='badge-'+settings.labels[address.a_id].type, style='margin-left:15px;margin-bottom:0;')
|
||||
=settings.labels[address.a_id].label
|
||||
if settings.labels[address.a_id].url
|
||||
a(href=settings.labels[address.a_id].url, target='_blank', alt='Visit site', title='Visit site', data-toggle='tooltip', data-placement='top')
|
||||
span.fa.fa-question-circle(style='margin-left:5px;')
|
||||
else
|
||||
label.d-none.d-sm-block.badge.badge-default.float-right(style='margin-left:15px;margin-bottom:0;')
|
||||
=settings.labels[address.a_id].label
|
||||
if settings.labels[address.a_id].url
|
||||
a(href=settings.labels[address.a_id].url, target='_blank', alt='Visit site', title='Visit site', data-toggle='tooltip', data-placement='top')
|
||||
span.fa.fa-question-circle(style='margin-left:5px;')
|
||||
if settings.display.claim_address == false || address.name == null || address.name == ''
|
||||
strong #{address.a_id}
|
||||
else
|
||||
strong #{address.name}
|
||||
if settings.labels[address.a_id]
|
||||
if settings.labels[address.a_id].type
|
||||
label.d-none.d-sm-block.badge.float-right(class='badge-'+settings.labels[address.a_id].type, style='margin-left:15px;margin-bottom:0;')
|
||||
=settings.labels[address.a_id].label
|
||||
if settings.labels[address.a_id].url
|
||||
a(href=settings.labels[address.a_id].url, target='_blank', alt='Visit site', title='Visit site', data-toggle='tooltip', data-placement='top')
|
||||
span.fa.fa-question-circle(style='margin-left:5px;')
|
||||
else
|
||||
if address.name !== "" && typeof address.name !== "undefined"
|
||||
label.badge.badge-pill.float-right.d-none.d-sm-block(style='margin-left:15px;')
|
||||
=address.name
|
||||
label.d-none.d-sm-block.badge.badge-default.float-right(style='margin-left:15px;margin-bottom:0;')
|
||||
=settings.labels[address.a_id].label
|
||||
if settings.labels[address.a_id].url
|
||||
a(href=settings.labels[address.a_id].url, target='_blank', alt='Visit site', title='Visit site', data-toggle='tooltip', data-placement='top')
|
||||
span.fa.fa-question-circle(style='margin-left:5px;')
|
||||
else if settings.display.claim_address == true
|
||||
a.badge.badge-pill.float-right.d-none.d-sm-block(href="/address/"+ address.a_id +"/claim" style="font-size:smaller;padding-bottom:0;")
|
||||
if address.name == null || address.name == ''
|
||||
=" Is this yours? Claim it now for free!"
|
||||
else
|
||||
a.badge.badge-pill.float-right.d-none.d-sm-block(href="/address/"+ address.a_id +"/claim" style="font-size:smaller;padding-bottom:0;")
|
||||
=" Is this yours? Claim it now for free!"
|
||||
=" Update claimed address"
|
||||
table.table.table-bordered.table-striped.summary-table.mobile-border-right
|
||||
- var theadClasses = [];
|
||||
if settings.display.table_header_bgcolor != null && settings.display.table_header_bgcolor != ''
|
||||
|
||||
+13
-9
@@ -6,10 +6,10 @@ block content
|
||||
function displayAsText(str) {
|
||||
return str.replace(/</g, '<').replace(/>/g, '>');
|
||||
}
|
||||
function showClaimAlert(claimClass, warnMsg) {
|
||||
function showClaimAlert(claimClass, warnMsg, removedClaim) {
|
||||
if ($('#claimAlert').length == 0)
|
||||
$('<div id="claimAlert"></div>').insertBefore('#claimForm');
|
||||
$('#claimAlert').html('<div class="alert alert-' + claimClass + '"><div class="font-weight-bold" style="padding-bottom:10px;">' + (claimClass == 'success' ? 'Address claimed successfully' : (claimClass == 'danger' ? 'Failed to claim address' : 'Required field missing')) + '</div> ' + (claimClass == 'success' ? 'This address will now be referred to as <strong>"' + displayAsText($('#message').val()) + '"</strong> throughout the website' : warnMsg) + '.</div>');
|
||||
$('#claimAlert').html('<div class="alert alert-' + claimClass + '"><div class="font-weight-bold" style="padding-bottom:10px;">' + (claimClass == 'success' ? (removedClaim ? 'Address claim removed successfully' : 'Address claimed successfully') : (claimClass == 'danger' ? 'Failed to claim address' : 'Required field missing')) + '</div> ' + (claimClass == 'success' ? 'This address will now be referred to as <strong>' + (removedClaim ? $('input#address').val() : displayAsText($('#message').val())) + '</strong> throughout the website' : warnMsg) + '.</div>');
|
||||
}
|
||||
|
||||
$('#claimForm').on('submit', function (e) {
|
||||
@@ -19,11 +19,8 @@ block content
|
||||
var signature = $('input#signature').val();
|
||||
var url = '/address/'+address+'/claim';
|
||||
|
||||
if (message == null || message.trim().length == 0) {
|
||||
showClaimAlert('warning', 'Please enter the name you would like your address to be referred to on this site');
|
||||
$('input#message').focus();
|
||||
} else if (signature == null || signature.trim().length == 0) {
|
||||
showClaimAlert('warning', 'Please enter the signature value from your wallet software');
|
||||
if (signature == null || signature.trim().length == 0) {
|
||||
showClaimAlert('warning', 'Please enter the signature value from your wallet software', false);
|
||||
$('input#signature').focus();
|
||||
} else {
|
||||
$.ajax({
|
||||
@@ -35,7 +32,7 @@ block content
|
||||
'signature': signature
|
||||
},
|
||||
success: function (data) {
|
||||
showClaimAlert((data.status == 'success' ? 'success' : 'danger'), data.message);
|
||||
showClaimAlert((data.status == 'success' ? 'success' : 'danger'), data.message, (data.status == 'success' && message == ''));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -50,7 +47,10 @@ block content
|
||||
.col-xs-12.col-md-12.cardSpacer
|
||||
.card.card-default.border-0.card-address-summary.cardSpacer
|
||||
.card-header(style='position:relative;')
|
||||
strong=address.a_id
|
||||
if typeof address.name == null || address.name == ''
|
||||
strong #{address.a_id}
|
||||
else
|
||||
strong #{address.name}
|
||||
if settings.labels[address.a_id]
|
||||
if settings.labels[address.a_id].type
|
||||
label.d-none.d-sm-block.badge.float-right(class='badge-'+settings.labels[address.a_id].type, style='margin-left:15px;margin-bottom:0;')
|
||||
@@ -125,6 +125,10 @@ block content
|
||||
span Finally, click the
|
||||
span.font-weight-bold Submit
|
||||
span button below to claim your address, which will display your custom display name instead of the default wallet address on this site.
|
||||
br
|
||||
div
|
||||
span.font-weight-bold NOTE:
|
||||
span You can update your claimed address at any time, as often as you wish. To remove a previously claimed display name, simply sign a blank message to return the address back to its original value.
|
||||
form#claimForm
|
||||
.form-group
|
||||
fieldset.entryField
|
||||
|
||||
@@ -22,7 +22,10 @@
|
||||
td.text-center
|
||||
=count
|
||||
td
|
||||
a.breakWord(href='/address/'+item.a_id) #{item.a_id}
|
||||
if settings.display.claim_address == false || item.name == null || item.name == ''
|
||||
a.breakWord(href='/address/' + item.a_id) #{item.a_id}
|
||||
else
|
||||
a.breakWord(href='/address/' + item.a_id) #{item.name}
|
||||
include ./rl_labels.pug
|
||||
td #{itemFixedParts[0]}.
|
||||
span.decimal #{itemFixedParts[1]}
|
||||
|
||||
@@ -10,8 +10,4 @@ if settings.labels[item.a_id]
|
||||
=settings.labels[item.a_id].label
|
||||
if settings.labels[item.a_id].url
|
||||
a(href=settings.labels[item.a_id].url, target='_blank', alt='Visit site', title='Visit site', data-toggle='tooltip', data-placement='top')
|
||||
span.fa.fa-question-circle(style='margin-left:5px;')
|
||||
else
|
||||
if item.name !== "" && typeof item.name !== "undefined"
|
||||
label(class='badge badge-default float-right d-none d-md-block', style='margin-left:15px;margin-bottom:0;')
|
||||
=item.name
|
||||
span.fa.fa-question-circle(style='margin-left:5px;')
|
||||
@@ -20,7 +20,10 @@
|
||||
td.text-center
|
||||
=count
|
||||
td
|
||||
a.breakWord(href='/address/'+item.a_id) #{item.a_id}
|
||||
if settings.display.claim_address == false || item.name == null || item.name == ''
|
||||
a.breakWord(href='/address/' + item.a_id) #{item.a_id}
|
||||
else
|
||||
a.breakWord(href='/address/' + item.a_id) #{item.name}
|
||||
include ./rl_labels.pug
|
||||
td #{itemFixedParts[0]}.
|
||||
span.decimal #{itemFixedParts[1]}
|
||||
+12
-3
@@ -80,7 +80,10 @@ block content
|
||||
td
|
||||
if r.addresses != 'private_tx'
|
||||
a.loading.breakWord(href='/address/' + r.addresses)
|
||||
=r.addresses
|
||||
if r.claim_name == null || r.claim_name == ''
|
||||
=r.addresses
|
||||
else
|
||||
=r.claim_name
|
||||
else
|
||||
=settings.locale.hidden_sender
|
||||
td.bg-danger.d-xs-none #{ramountParts[0]}.
|
||||
@@ -107,7 +110,10 @@ block content
|
||||
if r.addresses != 'private_tx'
|
||||
td
|
||||
a.loading.breakWord(href='/address/' + r.addresses)
|
||||
=r.addresses
|
||||
if r.claim_name == null || r.claim_name == ''
|
||||
=r.addresses
|
||||
else
|
||||
=r.claim_name
|
||||
td.bg-success #{ramountParts[0]}.
|
||||
span.decimal #{ramountParts[1]}
|
||||
else if r.amount > 0
|
||||
@@ -124,6 +130,9 @@ block content
|
||||
tr
|
||||
td
|
||||
a.loading.breakWord(href='/address/' + r.addresses)
|
||||
=r.addresses
|
||||
if r.claim_name == null || r.claim_name == ''
|
||||
=r.addresses
|
||||
else
|
||||
=r.claim_name
|
||||
td.bg-success #{ramountParts[0]}.
|
||||
span.decimal #{ramountParts[1]}
|
||||
Reference in New Issue
Block a user