Skip to content
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

refactor YGE code (done) & start on bulk payouts (done) #1666

Merged
merged 30 commits into from Jul 13, 2018
Merged
Changes from 3 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
cb15b64
destroys a lot of the YGE code
owocki Jul 9, 2018
3d5b768
rename yge to onepager
owocki Jul 9, 2018
dbc0620
starts to rebuild the send page
owocki Jul 9, 2018
9c8df3a
adds some scripts back as quarantines
owocki Jul 9, 2018
00e3ac5
new send flow is working
owocki Jul 9, 2018
77311df
starts to build the receive tx flow
owocki Jul 9, 2018
4029451
eth tips working
owocki Jul 10, 2018
b9181f0
receive now works for tokens
owocki Jul 10, 2018
2b65453
linter
owocki Jul 10, 2018
943f659
starts bulk payout
owocki Jul 10, 2018
6add975
Merge branch 'master' into kevin/yge_demolition_and_bulk_payout
owocki Jul 11, 2018
d832210
linter
owocki Jul 11, 2018
d3daae6
ui for bulk payouts
owocki Jul 11, 2018
6f0ad07
tests
owocki Jul 11, 2018
fa27f77
happy linter. happy
owocki Jul 11, 2018
4fd0340
i18n, and a few cleanups here and there
owocki Jul 11, 2018
410eb59
final touches, satisfy linter
owocki Jul 12, 2018
f419554
yge deprecation
owocki Jul 12, 2018
4350279
Makes the css for the gas settings correct
SaptakS Jul 12, 2018
dc4831a
Fixes the scroll in the onepager with the animation in bg
SaptakS Jul 12, 2018
88d1081
Prettifies Payout Preview in bulk bounty
SaptakS Jul 12, 2018
6fddd05
Align the payout
SaptakS Jul 12, 2018
e541eb8
payment success view
owocki Jul 12, 2018
9f69dc4
Merge branch 'kevin/yge_demolition_and_bulk_payout' of github.com:git…
owocki Jul 12, 2018
9c2d629
Merge branch 'master' into kevin/yge_demolition_and_bulk_payout
owocki Jul 12, 2018
1ea4821
copy
owocki Jul 12, 2018
d2bcb51
back button
owocki Jul 12, 2018
47c3c5d
Merge branch 'master' into kevin/yge_demolition_and_bulk_payout
owocki Jul 13, 2018
00d9b5e
saptak/aditya QA
owocki Jul 13, 2018
b27ab00
alis feedback
owocki Jul 13, 2018
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -6,6 +6,6 @@ app/assets/v2/js/jsrender.js
app/assets/v2/js/showdown.js
app/assets/v2/js/tooltip.js

app/assets/yge/youvegoteth/confetti.js
app/assets/onepager/js/confetti.js

app/assets/v2/js/dataviz/*
@@ -58,7 +58,7 @@
'storages', 'social_django', 'cookielaw', 'django.contrib.humanize', 'django.contrib.sitemaps',
'django.contrib.sites', 'django_extensions', 'easy_thumbnails', 'app', 'avatar', 'retail', 'rest_framework',
'bootstrap3', 'marketing', 'economy', 'dashboard', 'enssubdomain', 'faucet', 'tdi', 'gas', 'github', 'legacy',
'chartit', 'email_obfuscator', 'linkshortener', 'credits', 'gitcoinbot', 'external_bounties', 'dataviz', 'ethos',
'chartit', 'email_obfuscator', 'linkshortener', 'credits', 'gitcoinbot', 'external_bounties', 'dataviz',
'impersonate',
]

@@ -191,7 +191,7 @@
STATIC_URL = STATIC_HOST + env('STATIC_URL', default='/static/')

THUMBNAIL_PROCESSORS = easy_thumbnails_defaults.THUMBNAIL_PROCESSORS + (
'ethos.thumbnail_processors.circular_processor',
'app.thumbnail_processors.circular_processor',
)

THUMBNAIL_ALIASES = {
@@ -408,16 +408,6 @@
COLO_ACCOUNT_ADDRESS = env('COLO_ACCOUNT_ADDRESS', default='') # TODO
COLO_ACCOUNT_PRIVATE_KEY = env('COLO_ACCOUNT_PRIVATE_KEY', default='') # TODO

# EthOS
ETHOS_CONTRACT_ADDRESS = env('ETHOS_CONTRACT_ADDRESS', default='') # TODO
ETHOS_ACCOUNT_ADDRESS = env('ETHOS_ACCOUNT_ADDRESS', default='') # TODO
ETHOS_ACCOUNT_PRIVATE_KEY = env('ETHOS_ACCOUNT_PRIVATE_KEY', default='') # TODO

ETHOS_TWITTER_CONSUMER_KEY = env('ETHOS_TWITTER_CONSUMER_KEY', default='') # TODO
ETHOS_TWITTER_CONSUMER_SECRET = env('ETHOS_TWITTER_CONSUMER_SECRET', default='') # TODO
ETHOS_TWITTER_ACCESS_TOKEN = env('ETHOS_TWITTER_ACCESS_TOKEN', default='') # TODO
ETHOS_TWITTER_ACCESS_SECRET = env('ETHOS_TWITTER_ACCESS_SECRET', default='') # TODO

# Silk Profiling and Performance Monitoring
ENABLE_SILK = env.bool('ENABLE_SILK', default=False)
if ENABLE_SILK:
@@ -24,4 +24,4 @@ def circular_processor(image, circle=False, **kwargs):
from .utils import get_circular_image
if circle:
image = get_circular_image(image)
return image
return image
@@ -33,7 +33,6 @@
import dataviz.d3_views
import dataviz.views
import enssubdomain.views
import ethos.views
import external_bounties.views
import faucet.views
import gitcoinbot.views
@@ -142,12 +141,6 @@
url(r'^tools/?', dashboard.views.toolbox, name='tools'),
url(r'^gas/?', dashboard.views.gas, name='gas'),

# redeem coin

This comment has been minimized.

Copy link
@owocki

owocki Jul 12, 2018

Author Member

whats fun is that we could now programatically create tips and use those to redeem coin airdrops

This comment has been minimized.

Copy link
@owocki

owocki Jul 12, 2018

Author Member

or even extend the current receive flow to accept 721s

url(r'^coin/redeem/(.*)/?', dashboard.views.redeem_coin, name='redeem'),

# EthOS
path('ethos/', include('ethos.urls', namespace='ethos')),

# images
re_path(r'^funding/embed/?', dashboard.embed.embed, name='embed'),
re_path(r'^funding/avatar/?', avatar.views.handle_avatar, name='avatar'),
File renamed without changes.
@@ -1,7 +1,7 @@
/* Basic */

body {
background-image: url('/static/yge/images/bg.jpg');
background-image: url('/static/onepager/images/bg.jpg');
background-repeat: no-repeat;
background-size: cover;
background-position: bottom center;
File renamed without changes.
@@ -27,10 +27,10 @@ body {
height: 100%;
color: #000000;
background-color: #0d023b;
background-image: url('/static/yge/images/overlay.png'), -moz-linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35)), url('/static/v2/images/header-bg.png');
background-image: url('/static/yge/images/overlay.png'), -webkit-linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35)), url('/static/v2/images/header-bg.png');
background-image: url('/static/yge/images/overlay.png'), -ms-linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35)), url('/static/v2/images/header-bg.png');
background-image: url('/static/yge/images/overlay.png'), linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35)), url('/static/v2/images/header-bg.png');
background-image: url('/static/onepager/images/overlay.png'), -moz-linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35)), url('/static/v2/images/header-bg.png');
background-image: url('/static/onepager/images/overlay.png'), -webkit-linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35)), url('/static/v2/images/header-bg.png');
background-image: url('/static/onepager/images/overlay.png'), -ms-linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35)), url('/static/v2/images/header-bg.png');
background-image: url('/static/onepager/images/overlay.png'), linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35)), url('/static/v2/images/header-bg.png');
background-repeat: no-repeat;
background-size: 110%;
background-position: center center;
@@ -48,10 +48,10 @@ body::after {
opacity: 0;
z-index: 1;
background-color: #ffffff;
background-image: url('/static/yge/images/overlay.png'), -moz-linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35));
background-image: url('/static/yge/images/overlay.png'), -webkit-linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35));
background-image: url('/static/yge/images/overlay.png'), -ms-linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35));
background-image: url('/static/yge/images/overlay.png'), linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35));
background-image: url('/static/onepager/images/overlay.png'), -moz-linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35));
background-image: url('/static/onepager/images/overlay.png'), -webkit-linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35));
background-image: url('/static/onepager/images/overlay.png'), -ms-linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35));
background-image: url('/static/onepager/images/overlay.png'), linear-gradient(60deg, rgba(255, 165, 150, 0.5) 5%, rgba(0, 228, 255, 0.35));
background-repeat: repeat, no-repeat;
background-size: 100px 100px, cover;
background-position: top left, center center;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
File renamed without changes.
@@ -0,0 +1,146 @@
/* eslint-disable no-console */

$(document).ready(function() {

// jquery bindings
$("#advanced_toggle").click(function(){

This comment has been minimized.

Copy link
@stickler-ci

stickler-ci Jul 9, 2018

Strings must use singlequote. (quotes)
Missing space before opening brace. (space-before-blocks)

advancedToggle();
});
$('#amount').on('keyup blur change', updateEstimate);
$('#token').on('change', updateEstimate);
$('#token').on('change', promptForAuth);
$("#send").click(function(e){

This comment has been minimized.

Copy link
@stickler-ci

stickler-ci Jul 9, 2018

Strings must use singlequote. (quotes)
Missing space before opening brace. (space-before-blocks)

return send(e);
});

});

function advancedToggle() {
$('#advanced_toggle').css('display', 'none')

This comment has been minimized.

Copy link
@stickler-ci

stickler-ci Jul 9, 2018

Missing semicolon. (semi)

$('#advanced').css('display', 'block')

This comment has been minimized.

Copy link
@stickler-ci

stickler-ci Jul 9, 2018

Missing semicolon. (semi)

return false;
}

function validateEmail(email) {
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;

This comment has been minimized.

Copy link
@stickler-ci

stickler-ci Jul 9, 2018

Unnecessary escape character: [. (no-useless-escape)


return re.test(email);
}

function isNumeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}

This comment has been minimized.

Copy link
@stickler-ci

stickler-ci Jul 9, 2018

More than 2 blank lines not allowed. (no-multiple-empty-lines)



function send(e) {

mixpanel.track('Tip Step 2 Click', {});
e.preventDefault();
if (typeof web3 == 'undefined') {
_alert({ message: gettext('You must have a web3 enabled browser to do this. Please download Metamask.') }, 'warning');
return;
}
// setup
var fromAccount = web3.eth.accounts[0];

// get form data
var email = $('#email').val();
var github_url = $('#issueURL').val();
var from_name = $('#fromName').val();
var username = $('#username').val();

if (username.indexOf('@') == -1) {
username = '@' + username;
}
var _disableDeveloperTip = true;
var accept_tos = $('#tos').is(':checked');
var token = $('#token').val();
var fees = 0;
var expires = parseInt($('#expires').val());
var isSendingETH = (token == '0x0' || token == '0x0000000000000000000000000000000000000000');
var tokenDetails = tokenAddressToDetails(token);
var tokenName = 'ETH';
var weiConvert = 10 ** 9;

if (!isSendingETH) {
tokenName = tokenDetails.name;
weiConvert = Math.pow(10, tokenDetails.decimals);
}
var amount = $('#amount').val() * weiConvert;
var amountInEth = amount * 1.0 / weiConvert;
var comments_priv = $('#comments_priv').val();
var comments_public = $('#comments_public').val();
var from_email = $('#fromEmail').val();
// validation
var hasEmail = email != '';
var hasUsername = username != '';

// validation
if (hasEmail && !validateEmail(email)) {
_alert({ message: gettext('To Email is optional, but if you enter an email, you must enter a valid email!') }, 'warning');
return;
}
if (from_email != '' && !validateEmail(from_email)) {
_alert({ message: gettext('From Email is optional, but if you enter an email, you must enter a valid email!') }, 'warning');
return;
}
if (!isNumeric(amount) || amount == 0) {
_alert({ message: gettext('You must enter an number for the amount!') }, 'warning');
return;
}

var min_send_amt_wei = 0;
var min_amount = min_send_amt_wei * 1.0 / weiConvert;
var max_amount = 5;

if (!isSendingETH) {
max_amount = 1000;
}
if (amountInEth > max_amount) {
_alert({ message: gettext('You can only send a maximum of ' + max_amount + ' ' + tokenName + '.') }, 'warning');
return;
}
if (amountInEth < min_amount) {
_alert({ message: gettext('You can only send a minimum of ' + min_amount + ' ' + tokenName + '.') }, 'warning');
return;
}
if (username == '') {
_alert({ message: gettext('You must enter a username.') }, 'warning');
return;
}
if (!accept_tos) {
_alert({ message: gettext('You must accept the terms.') }, 'warning');
return;
}


alert("todo");

This comment has been minimized.

Copy link
@stickler-ci

stickler-ci Jul 9, 2018

Strings must use singlequote. (quotes)

}

var updateEstimate = function(e) {
var denomination = $('#token option:selected').text();
var amount = $('#amount').val();

getUSDEstimate(amount, denomination, function(usdAmount) {
if (usdAmount && usdAmount['full_text']) {
$('#usd_amount').html(usdAmount['full_text']);
} else {
$('#usd_amount').html('</br>');
}
})

This comment has been minimized.

Copy link
@stickler-ci

stickler-ci Jul 9, 2018

Missing semicolon. (semi)

};

// TODO: DRY
var promptForAuth = function(event) {
var denomination = $('#token option:selected').text();
var tokenAddress = $('#token option:selected').val();

if (denomination == 'ETH') {
$('input, textarea, select').prop('disabled', '');
} else {
var from = web3.eth.coinbase;
var to = contract().address;

This comment has been minimized.

Copy link
@stickler-ci

stickler-ci Jul 9, 2018

Expected blank line after variable declarations. (newline-after-var)

alert('todo');
}
};
File renamed without changes.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.