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
Show file tree
Hide file tree
Changes from 22 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 by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintignore
Expand Up @@ -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/*
16 changes: 2 additions & 14 deletions app/app/settings.py
Expand Up @@ -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',
]

Expand Down Expand Up @@ -190,9 +190,7 @@
STATIC_HOST = env('STATIC_HOST', default='')
STATIC_URL = STATIC_HOST + env('STATIC_URL', default='/static/')

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

THUMBNAIL_ALIASES = {
'': {
Expand Down Expand Up @@ -408,16 +406,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:
Expand Down
File renamed without changes.
26 changes: 14 additions & 12 deletions app/app/urls.py
Expand Up @@ -29,11 +29,11 @@
import dashboard.embed
import dashboard.helpers
import dashboard.ios
import dashboard.tip_views
import dashboard.views
import dataviz.d3_views
import dataviz.views
import enssubdomain.views
import ethos.views
import external_bounties.views
import faucet.views
import gitcoinbot.views
Expand Down Expand Up @@ -80,6 +80,7 @@
url(r'^new/?', dashboard.views.new_bounty, name='new_funding_short'),
path('issue/fulfill', dashboard.views.fulfill_bounty, name='fulfill_bounty'),
path('issue/accept', dashboard.views.accept_bounty, name='process_funding'),
path('issue/payout', dashboard.views.bulk_payout_bounty, name='bulk_payout_bounty'),
path('issue/increase', dashboard.views.increase_bounty, name='increase_bounty'),
path('issue/cancel', dashboard.views.cancel_bounty, name='kill_bounty'),

Expand Down Expand Up @@ -120,11 +121,18 @@
url(r'^funding/details/?', dashboard.views.bounty_details, name='funding_details'),

# Tips
url(r'^tip/receive/?', dashboard.views.receive_tip, name='receive_tip'),
url(r'^tip/send/2/?', dashboard.views.send_tip_2, name='send_tip_2'),
url(r'^tip/send/?', dashboard.views.send_tip, name='send_tip'),
url(r'^send/?', dashboard.views.send_tip, name='tip'),
url(r'^tip/?', dashboard.views.send_tip, name='tip'),
url(
r'^tip/receive/v2/(?P<pk>.*)/(?P<txid>.*)/(?P<network>.*)?',
dashboard.tip_views.receive_tip_v2,
name='receive_tip'
),
url(r'^tip/receive/?', dashboard.tip_views.receive_tip_legacy, name='receive_tip_legacy'),
url(r'^tip/send/4/?', dashboard.tip_views.send_tip_4, name='send_tip_4'),
url(r'^tip/send/3/?', dashboard.tip_views.send_tip_3, name='send_tip_3'),
url(r'^tip/send/2/?', dashboard.tip_views.send_tip_2, name='send_tip_2'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@owocki @SaptakS @mbeacom should we rename this into something more meaning full ? ( we can do it in a follow up PR)
/2, /3 seems cryptic :P

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the numbers are the step numbers.. sequential numbers seem straightforward to me..

url(r'^tip/send/?', dashboard.tip_views.send_tip, name='send_tip'),
url(r'^send/?', dashboard.tip_views.send_tip, name='tip'),
url(r'^tip/?', dashboard.tip_views.send_tip, name='tip'),

# Legal
url(r'^terms/?', dashboard.views.terms, name='_terms'),
Expand All @@ -143,12 +151,6 @@
url(r'^tools/?', dashboard.views.toolbox, name='tools'),
url(r'^gas/?', dashboard.views.gas, name='gas'),

# redeem coin
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'),
Expand Down
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;
Expand Down
21 changes: 11 additions & 10 deletions app/assets/yge/css/main.css → app/assets/onepager/css/main.css
Expand Up @@ -22,15 +22,15 @@ body {
line-height: 1;
font-family: futura-pt, sans-serif !important;
-webkit-text-size-adjust: none;
overflow: scroll;
overflow: hidden;
width: 100%;
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;
Expand All @@ -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;
Expand Down Expand Up @@ -788,7 +788,8 @@ dl dd {
-ms-perspective: 1000px;
perspective: 1000px;
position: relative;
min-height: 100%;
height: 100%;
overflow-y: scroll;
padding: 1.5em;
z-index: 2;
}
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
136 changes: 136 additions & 0 deletions app/assets/onepager/js/quarantine/confetti.js
@@ -0,0 +1,136 @@

var doconfetti = function(){

(function() {
var COLORS, Confetti, NUM_CONFETTI, PI_2, canvas, confetti, context, drawCircle, i, range, resizeWindow, xpos;

NUM_CONFETTI = 350;

COLORS = [[85, 71, 106], [174, 61, 99], [219, 56, 83], [244, 92, 68], [248, 182, 70]];

PI_2 = 2 * Math.PI;

canvas = document.getElementById("world");

context = canvas.getContext("2d");

window.w = 0;

window.h = 0;

resizeWindow = function() {
window.w = canvas.width = window.innerWidth;
return window.h = canvas.height = window.innerHeight;
};

window.addEventListener('resize', resizeWindow, false);

setTimeout(resizeWindow, 0);

range = function(a, b) {
return (b - a) * Math.random() + a;
};

drawCircle = function(x, y, r, style) {
context.beginPath();
context.arc(x, y, r, 0, PI_2, false);
context.fillStyle = style;
return context.fill();
};

xpos = 0.5;

document.onmousemove = function(e) {
return xpos = e.pageX / w;
};

window.requestAnimationFrame = (function() {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback) {
return window.setTimeout(callback, 1000 / 60);
};
})();

Confetti = (function() {
function Confetti() {
this.style = COLORS[~~range(0, 5)];
this.rgb = "rgba(" + this.style[0] + "," + this.style[1] + "," + this.style[2];
this.r = ~~range(2, 6);
this.r2 = 2 * this.r;
this.replace();
}

Confetti.prototype.replace = function() {
this.opacity = 0;
this.dop = 0.03 * range(1, 4);
this.x = range(-this.r2, w - this.r2);
this.y = range(-20, h - this.r2);
this.xmax = w - this.r;
this.ymax = h - this.r;
this.vx = range(0, 2) + 8 * xpos - 5;
return this.vy = 0.7 * this.r + range(-1, 1);
};

Confetti.prototype.draw = function() {
var ref;
this.x += this.vx;
this.y += this.vy;
this.opacity += this.dop;
if (this.opacity > 1) {
this.opacity = 1;
this.dop *= -1;
}
if (this.opacity < 0 || this.y > this.ymax) {
this.replace();
}
if (!((0 < (ref = this.x) && ref < this.xmax))) {
this.x = (this.x + this.xmax) % this.xmax;
}
return drawCircle(~~this.x, ~~this.y, this.r, this.rgb + "," + this.opacity + ")");
};

return Confetti;

})();

confetti = (function() {
var j, ref, results;
results = [];
for (i = j = 1, ref = NUM_CONFETTI; 1 <= ref ? j <= ref : j >= ref; i = 1 <= ref ? ++j : --j) {
results.push(new Confetti);
}
return results;
})();

window.step = function() {
var c, j, len, results;
requestAnimationFrame(step);
context.clearRect(0, 0, w, h);
results = [];
for (j = 0, len = confetti.length; j < len; j++) {
c = confetti[j];
results.push(c.draw());
}
return results;
};

step();

}).call(this);

};

var stopConfetti = function(){
var element = $("world");
element.parentNode.removeChild(element);
setTimeout(function(){
},100);
};


var startConfetti = function(){
doconfetti();
setTimeout(function(){
stopConfetti();
}, 4000);
};

Expand Up @@ -109,7 +109,7 @@ window.onload = function() {
_alert({ message: gettext('Invalid Link. Please check your link and try again') }, 'warning');
return;
}
$('send_eth').innerHTML = "<img src='/static/yge/images/loading_v2.gif' style='max-width: 70px; max-height: 70px;'><br><h4>Submitting to the blockchain..</h4>";
$('send_eth').innerHTML = "<img src='/static/onepager/images/loading_v2.gif' style='max-width: 70px; max-height: 70px;'><br><h4>Submitting to the blockchain..</h4>";
loading_button(jQuery('#receive'));
// set up callback to sendRawTransaction
var callback = function(error, result) {
Expand All @@ -121,7 +121,7 @@ window.onload = function() {
} else {
startConfetti();
mixpanel.track('Tip Receive Success', {});
$('send_eth').innerHTML = '<h1>Success 🚀!</h1> <a href="https://' + etherscanDomain() + '/tx/' + result + '">See your transaction on the blockchain here</a>.<br><br><strong>Status:</strong> <span id="status">Confirming Transaction … <br><img src="/static/yge/images/loading_v2.gif" style="max-width: 30px; max-height: 30px;"></span><br><br><span id="mighttake">It might take a few minutes to sync, depending upon: <br> - network congestion<br> - network fees that sender allocated to transaction.<br>You may close this browser window.<br></span><br><a href="/" class="button button--primary">⬅ Back To Gitcoin.co</a>';
$('send_eth').innerHTML = '<h1>Success 🚀!</h1> <a href="https://' + etherscanDomain() + '/tx/' + result + '">See your transaction on the blockchain here</a>.<br><br><strong>Status:</strong> <span id="status">Confirming Transaction … <br><img src="/static/onepager/images/loading_v2.gif" style="max-width: 30px; max-height: 30px;"></span><br><br><span id="mighttake">It might take a few minutes to sync, depending upon: <br> - network congestion<br> - network fees that sender allocated to transaction.<br>You may close this browser window.<br></span><br><a href="/" class="button button--primary">⬅ Back To Gitcoin.co</a>';
const url = '/tip/receive';

fetch(url, {
Expand Down Expand Up @@ -201,4 +201,4 @@ window.onload = function() {
});
});
};
};
};
9 changes: 9 additions & 0 deletions app/assets/onepager/js/receive.js
@@ -0,0 +1,9 @@
/* eslint-disable no-console */
window.onload = function() {
waitforWeb3(function() {
if (document.web3network != document.network) {
_alert({ message: gettext('You are not on the right web3 network. Please switch to ') + document.network }, 'error');
}
$('#network').val(document.web3network);
});
};