-
-
Notifications
You must be signed in to change notification settings - Fork 775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing advanced payout - Default to Bountied Amount for Payment, etc. #2365
Changes from 2 commits
37a439e
1bd6864
278847e
c388e52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ $(document).ready(function($) { | |
self.html(self.html().replace(/(<([^>]+)>)/ig, '')); | ||
}, 10); | ||
}); | ||
|
||
|
||
$(document).on('click', '#close_bounty', function(event) { | ||
update_registry(); | ||
|
@@ -68,8 +68,12 @@ $(document).ready(function($) { | |
|
||
$(document).on('click', '.remove', function(event) { | ||
event.preventDefault(); | ||
var position = ($(this).parents('tr').index()+2).toString(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Infix operators must be spaced. (space-infix-ops) |
||
|
||
$('#transaction_registry tr:nth-child(' + position + ')').remove(); | ||
$(this).parents('tr').remove(); | ||
$(this).focus(); | ||
update_registry(); | ||
}); | ||
|
||
var sendTransaction = function(i) { | ||
|
@@ -157,7 +161,7 @@ $(document).ready(function($) { | |
|
||
$('#acceptBounty').click(function(e) { | ||
e.preventDefault(); | ||
|
||
if (!$('#terms').is(':checked')) { | ||
_alert('Please accept the TOS.', 'error'); | ||
return; | ||
|
@@ -166,7 +170,16 @@ $(document).ready(function($) { | |
_alert('You do not have any transactions to payout. Please add payees to the form.', 'error'); | ||
return; | ||
} | ||
var usernames = $('.username'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. encourage moving to let / const as opposed to var ? |
||
|
||
for (var i = 0; i < usernames.length; i++) { | ||
var username = usernames[i].textContent.trim(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
if (username === null || username === '' || username === '@') { | ||
_alert('Please provide a valid recipient Github username', 'error'); | ||
return; | ||
} | ||
} | ||
sendTransaction(0); | ||
}); | ||
|
||
|
@@ -212,11 +225,25 @@ $(document).ready(function($) { | |
var denomination = $('#token_name').text(); | ||
var original_amount = $('#original_amount').val(); | ||
var net = round(original_amount - tc, 2); | ||
var over = round((original_amount - get_total_cost())*-1, 4); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Infix operators must be spaced. (space-infix-ops) |
||
var close_bounty = $('#close_bounty').is(':checked'); | ||
var addr = web3.eth.coinbase.substring(38); | ||
|
||
$('#total_overage').html(over + ' ' + denomination); | ||
$('#address_ending').html(addr + ' '); | ||
$('#preview_ending').html(addr + ' '); | ||
$('#preview_overage').html(over + ' ' + denomination); | ||
$('#total_cost').html(tc + ' ' + denomination); | ||
$('#total_net').html(net + ' ' + denomination); | ||
|
||
if (over > 0) { | ||
$('.overageAlert').css('display', 'inline-block'); | ||
$('.overagePreview').css('display', 'inline-block'); | ||
} else { | ||
$('.overageAlert').css('display', 'none'); | ||
$('.overagePreview').css('display', 'none'); | ||
} | ||
|
||
var transactions = []; | ||
|
||
first_transaction = { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,34 @@ | |
<head> | ||
{% include 'shared/head.html' %} | ||
{% include 'shared/cards.html' %} | ||
{% include 'shared/current_profile.html' %} | ||
<link rel="stylesheet" type="text/css" href="{% static "v2/css/tooltip_hover.css" %}"> | ||
<style type="text/css"> | ||
#tooltip--hover { | ||
min-height: 37%; | ||
top: 17rem; | ||
} | ||
|
||
@media only screen and (max-width: 1400px) { | ||
#tooltip--hover { | ||
top: 18.5rem; | ||
} | ||
} | ||
|
||
@media only screen and (max-width: 750px) { | ||
#tooltip--hover { | ||
min-height: 30%; | ||
} | ||
} | ||
|
||
@media only screen and (max-width: 400px) { | ||
#tooltip--hover { | ||
min-height: 33%; | ||
left: 70px; | ||
top: 20.5rem; | ||
} | ||
} | ||
</style> | ||
</head> | ||
|
||
<body class="interior {{ active }} g-font-muli"> | ||
|
@@ -71,19 +99,24 @@ <h3>{% trans "Advanced Payout" %}</h3> | |
<input type="hidden" id="original_amount" value="{{ bounty.value_true }}"> | ||
<span id="token_name">{{ bounty.token_name }}</span> | ||
</div> | ||
<div class="w-100 mt-2 terms_container"> | ||
<input name='close_bounty' id='close_bounty' type="checkbox" value=1 checked="checked" /> | ||
<label for=close_bounty>{% blocktrans %}Return the bounty stake to me, thereby closing the bounty.{% endblocktrans %}</label> | ||
<div class="w-100 overageAlert"> | ||
<div> | ||
<img src="{% static "v2/images/warning.svg" %}"> | ||
</div> | ||
<div> | ||
<p>{% trans "You have exceeded the bounty's funded amount. The difference of " %}<span id="total_overage"></span> {% trans "will be paid from your metamask wallet ending in ..." %}<span id="address_ending"></span></p> | ||
</div> | ||
</div> | ||
<div class="w-100 mt-2"> | ||
<label for=bountyFulfillment>{% trans "Payout" %}</label> | ||
<label id="tooltip">{% trans "Where is my Eth going? " %}<i class='fa fa-info-circle'></i></label> | ||
<div> | ||
<div class="w-100 mt-2" style="display: inline-block;"> | ||
{% include 'shared/bulk_payout_form.html' %} | ||
</div> | ||
<div class="mt-2" id="trans_preview"> | ||
<h5>{% trans 'Payout Preview' %}</h5> | ||
<p class="mb-0">{% trans 'Refunded' %}: <span id="total_returned">{{ bounty.value_true }} {{ bounty.token_name }}</span></p> | ||
<p class="mb-0 overagePreview"><strong><span id="preview_overage"></span>{% trans ' to be paid from wallet ending in ...' %}<span id="preview_ending"></span></strong></p> | ||
<p class="mb-0">{% trans 'Paid' %}: -<span id="total_cost"></span></p> | ||
<p class="mb-0">{% trans 'Net' %}: <span id="total_net"></span></p> | ||
<p class="mt-1 mb-0">{% trans 'Transactions:' %}</p> | ||
|
@@ -120,6 +153,15 @@ <h5>{% trans 'Payout Preview' %}</h5> | |
</a> | ||
</div> | ||
</div> | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove the extra line ? |
||
</div> | ||
<div id="tooltip--hover"> | ||
<span id="heading">{% trans "Where is my Eth Going?" %}</span><br> | ||
<span id="subheading">{% trans "Your funds are safe!" %}</span><br><br> | ||
<span id="hovertext"><strong>{% trans "Unverified Users" %}</strong> <em>{% trans "(no eth address associated)" %}</em><br> | ||
{% trans "A secure proxy address will hold the funds until the recipient claims them. This address is generated by gitcoin’s website, but we don't have its private keys, and the only person who can access the funds is the recipient." %}<br><br> | ||
<strong>{% trans "Verified Users" %}</strong><br> | ||
{% trans "We send the funds directly to the address associated with the user." %}</span> | ||
</div> | ||
</div> | ||
</div> | ||
|
@@ -181,7 +223,36 @@ <h5>{% trans 'Payout Preview' %}</h5> | |
.entry.active{ | ||
background-color: #bbb; | ||
} | ||
|
||
.overageAlert { | ||
background-color: #E66700; | ||
color: #FFF; | ||
border-radius: 5px; | ||
margin-top: 15px; | ||
margin-bottom: 5px; | ||
display: none; | ||
padding-left: 15px; | ||
} | ||
.overageAlert > div:first-child { | ||
width: 25px; | ||
float: left; | ||
padding-right: 10px; | ||
} | ||
.overageAlert> div:last-child { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
width: calc(100% - 40px); | ||
float: left; | ||
margin-left: 15px; | ||
padding-right: 15px; | ||
padding-top: 6.5px; | ||
} | ||
.overageAlert > div:first-child > img { | ||
width: 17px; | ||
margin-top: 10px; | ||
} | ||
.overagePreview { | ||
color: #E66700; | ||
padding-bottom: 5px; | ||
display: none; | ||
} | ||
</style> | ||
{% include 'shared/bottom_notification.html' %} | ||
{% include 'shared/analytics.html' %} | ||
|
@@ -201,5 +272,6 @@ <h5>{% trans 'Payout Preview' %}</h5> | |
<script src="{% static "v2/js/secrets.min.js" %}"></script> | ||
<script src="{% static "v2/js/ethereumjs-accounts.js" %}"></script> | ||
<script src="{% static "onepager/js/send.js" %}"></script> | ||
|
||
<script src="{% static "v2/js/truncate-hash.js" %}"></script> | ||
<script src="{% static "v2/js/user-search.js" %}"></script> | ||
</html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected blank line after variable declarations. (newline-after-var)
Infix operators must be spaced. (space-infix-ops)