-
-
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
Adding overage alert to advanced payout. #2386
Changes from 4 commits
07a04a4
2996a15
6594e32
345e5dc
33abb80
b3f01e5
4304e8e
adf13df
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 |
---|---|---|
@@ -0,0 +1,122 @@ | ||
#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; | ||
} | ||
} | ||
|
||
#transaction_registry { | ||
width: 100%; | ||
} | ||
|
||
#transaction_registry tr td { | ||
padding: 10px; | ||
border: #333 solid 1px; | ||
} | ||
|
||
#trans_preview { | ||
padding: 5px; | ||
border-radius: 3px; | ||
background-color: #fafafa; | ||
position: absolute; | ||
top: 5rem; | ||
right: -20rem; | ||
} | ||
|
||
#trans_preview h5 { | ||
color: #08cf7b; | ||
} | ||
|
||
#primary_form { | ||
margin: 0px 25%; | ||
} | ||
|
||
@media (max-width: 1100px) { | ||
#primary_form { | ||
margin: 0px 15%; | ||
} | ||
} | ||
|
||
@media (max-width: 900px) { | ||
#primary_form { | ||
margin: 0px 5%; | ||
} | ||
} | ||
|
||
@media (max-width: 750px) { | ||
#trans_preview { | ||
position: unset; | ||
top: 200px; | ||
left: 72%; | ||
width: 100%; | ||
} | ||
#primary_form { | ||
margin: 0px auto; | ||
} | ||
} | ||
|
||
tr div { | ||
border-radius: 3px; | ||
padding: 5px; | ||
} | ||
|
||
.error { | ||
border: 1px solid red !important; | ||
} | ||
|
||
.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. Same ^ |
||
width: calc(100% - 40px); | ||
float: left; | ||
margin-left: 15px; | ||
padding-right: 15px; | ||
padding-top: 6.5px; | ||
} | ||
|
||
.overageAlert>div:first-child>img { | ||
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. Same ^ |
||
width: 17px; | ||
margin-top: 10px; | ||
} | ||
|
||
.overagePreview { | ||
color: #E66700; | ||
padding-bottom: 5px; | ||
display: none; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,7 +162,7 @@ $(document).ready(function($) { | |
<tr> | ||
<td class="pl-0 pb-0"> | ||
<div class="pl-0"> | ||
<select id="username" onchange="update_registry()" class="username-search custom-select" style="width: 100%; margin-left: auto; margin-right: auto;"></select> | ||
<select onchange="update_registry()" class="username-search custom-select" style="width: 100%; margin-left: auto; margin-right: auto;"></select> | ||
Anish-Agnihotri marked this conversation as resolved.
Show resolved
Hide resolved
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. Add |
||
</div> | ||
</td> | ||
<td class="pb-0"><div class="percent" contenteditable="true">` + percent + `</div></td> | ||
|
@@ -185,12 +185,12 @@ $(document).ready(function($) { | |
}); | ||
|
||
var get_total_cost = function() { | ||
var num_rows = $('#payout_table tbody').find('tr').length; | ||
var num_rows = $('#payout_table').find('tr').length; | ||
Anish-Agnihotri marked this conversation as resolved.
Show resolved
Hide resolved
|
||
var total = 0; | ||
var i = 1; | ||
Anish-Agnihotri marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
for (i = 1; i < num_rows; i += 1) { | ||
Anish-Agnihotri marked this conversation as resolved.
Show resolved
Hide resolved
|
||
var $row = $('#payout_table tobdy').find('tr:nth-child(' + i + ')'); | ||
var $row = $('#payout_table').find('tr:nth-child(' + i + ')'); | ||
var amount = parseFloat($row.find('.amount').text()); | ||
var username = $row.find('.username-search').text(); | ||
var is_error = !$.isNumeric(amount) || amount <= 0 || username == '' || username == '@'; | ||
|
@@ -209,10 +209,24 @@ var update_registry = 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); | ||
var addr = web3.eth.coinbase.substring(38); | ||
|
||
$('#total_cost').html(tc + ' ' + denomination); | ||
$('#total_net').html(net + ' ' + denomination); | ||
|
||
if (over > 0) { | ||
$('.overageAlert').css('display', 'inline-block'); | ||
$('.overagePreview').css('display', 'inline-block'); | ||
$('#total_overage').html(over + ' ' + denomination); | ||
$('#address_ending').html(addr + ' '); | ||
$('#preview_ending').html(addr + ' '); | ||
$('#preview_overage').html(over + ' ' + denomination); | ||
} else { | ||
$('.overageAlert').css('display', 'none'); | ||
$('.overagePreview').css('display', 'none'); | ||
} | ||
|
||
let transactions = []; | ||
|
||
for (let j = 1; j <= num_rows; j++) { | ||
|
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.
Cosmetic / Space to breath 😄
.overageAlert > div:first-child