Skip to content

Commit

Permalink
Merge pull request #6449 from gitcoinco/stable
Browse files Browse the repository at this point in the history
stable -> master
  • Loading branch information
thelostone-mc authored Apr 16, 2020
2 parents ce0cb8f + ab16259 commit 9b7852d
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 11 deletions.
5 changes: 5 additions & 0 deletions app/assets/onepager/js/receive.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
window.addEventListener('load', function() {
setInterval(listen_for_web3_changes, 5000);
listen_for_web3_changes();
});

/* eslint-disable no-console */
var combine_secrets = function(secret1, secret2) {
var shares = [ secret1, secret2 ];
Expand Down
42 changes: 42 additions & 0 deletions app/assets/v2/js/pages/kudos_bulk_receive.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,46 @@ $(document).ready(function() {
}
});

$('#pay_gas').change(function() {
var checked = $(this).is(':checked');

if (!checked) {
return;
}
amount = 0.005 * 10 ** 18;
var to_address = '0x6239FF1040E412491557a7a02b2CBcC5aE85dc8F';

web3.eth.sendTransaction({
to: to_address,
value: amount
}, function(err, txid) {
indicateMetamaskPopup(1);
if (err) {
$('#pay_gas').prop('checked', false);
return;
}
$('#pay_gas').attr('disabled', true);
$('label[for=pay_gas]').text('Thank you!');
setTimeout(function() {
$('label[for=pay_gas]').text('Good Vibes unlocked!');
$('#pay_gas').fadeOut();
setTimeout(function() {
$('label[for=pay_gas]').text('🌈🌈🌈🌈🌈🌈🌈🌈🌈');
setTimeout(function() {
$('label[for=pay_gas]').text('🌈✨✨✨✨✨✨✨✨🌈');
setTimeout(function() {
$('label[for=pay_gas]').text('🌈✨✨💖💖💖💖💖✨✨🌈');
setTimeout(function() {
$('label[for=pay_gas]').text('🌈✨✨💖💖👍💖💖✨✨🌈');
setTimeout(function() {
$('label[for=pay_gas]').fadeOut();
}, 1000);
}, 1000);
}, 1000);
}, 1000);
}, 1000);
}, 1000);
});
});

});
5 changes: 5 additions & 0 deletions app/assets/v2/js/pages/kudos_receive.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
window.addEventListener('load', function() {
setInterval(listen_for_web3_changes, 5000);
listen_for_web3_changes();
});

/* eslint-disable no-console */
var combine_secrets = function(secret1, secret2) {
var shares = [ secret1, secret2 ];
Expand Down
19 changes: 16 additions & 3 deletions app/assets/v2/js/user_card.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
$('body').on('mouseover', '[data-usercard]', function(e) {
openContributorPopOver($(this).data('usercard'), $(this));
}).on('mouseleave', '[data-usercard]', function() {
var _this = this;

setTimeout(function(_this) {
if (!$('.popover-user-card:hover').length) {
$(_this).popover('hide');
}
}, 100);
});

$('body').on('show.bs.popover', '[data-usercard]', function() {
$('body [data-usercard]').not(this).popover('hide');
setTimeout(function() {
if (!$('.popover-user-card:hover').length) {
$(this).popover('hide');
}
}, 100);
});

let popoverData = [];
Expand Down Expand Up @@ -241,7 +254,9 @@ function openContributorPopOver(contributor, element) {
.then(response => {
popoverData.push({ [contributor]: response });
controller = null;
setupPopover(element, response);
if (element.is(':hover')) {
setupPopover(element, response);
}
})
.catch(err => {
return console.warn({ message: err });
Expand All @@ -257,7 +272,6 @@ function setupPopover(element, data) {
return DOMPurify.sanitize(content);
},
placement: 'auto',
// container: element,
trigger: 'manual',
delay: { 'show': 200, 'hide': 500 },
template: `
Expand Down Expand Up @@ -289,5 +303,4 @@ function setupPopover(element, data) {
$(element).popover('show');

addFollowAction();

}
12 changes: 8 additions & 4 deletions app/kudos/templates/transaction/receive_bulk.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,20 @@ <h3 class="text-center" style="margin: 0px auto;">👇 Redeem It Here 👇</h3>

<div class="form-check">
<input type="checkbox" name="save_addr" id="save_addr" value="1" class="form-check-input" {% if disable_inputs %}disabled=disabled{% endif %} >
<label for=save_addr>{% trans "Save this address as my direct payment address" %}</label>
<label for=save_addr>{% trans "Save this address as my direct payment address (Optional, but recommended)" %}</label>
</div>

<div class="form-check mb-3">
<div class="form-check">
<input type="checkbox" id="tos" value="1" class="form-check-input" required>
<label for="tos" class="form-check-label">{% trans "I understand &amp; agree to the" %} <a href="{% url "_terms" %}">{% trans "terms of service" %}</a>.</label>
<label for="tos" class="form-check-label">{% trans "I understand &amp; agree to the" %} <a href="{% url "_terms" %}">{% trans "terms of service" %} </a>. (Required)</label>
</div>

<div class="form-check mt-2">
<input type="checkbox" name="pay_gas" id="pay_gas" value="1" class="form-check-input" {% if disable_inputs %}disabled=disabled{% endif %}>
<label for=pay_gas>{% trans "Chip in 0.005 ETH in gas money" %} (Optional, but recommended)</label>
</div>

<div class="text-center">
<div class="text-center mt-3">
<input id="receive" type='submit' class="btn btn-gc-purple" value="🌈 {% trans "Redeem" %} Kudos 🏳️‍🌈" {% if disable_inputs %}disabled=disabled{% endif %} >
<br>
<br>
Expand Down
1 change: 1 addition & 0 deletions app/kudos/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,7 @@ def newkudos(request):
metadata={
'ip': get_ip(request),
'email': request.POST.get('email'),
'pay_gas': request.POST.get('pay_gas', 0),
}
)
new_kudos_request(obj)
Expand Down
5 changes: 2 additions & 3 deletions app/marketing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,10 @@ def get_stat(key):
return Stat.objects.filter(key=key).order_by('-created_on').first().val


def invite_to_slack(email):
def invite_to_slack(email, override=False):
# KO 2020/03 disabling slack invites
# per https://gitcoincore.slack.com/archives/CB1N0L6F7/p1585245243010100
return
if settings.DEBUG:
if settings.DEBUG or not override:
return {}
sc = SlackClient(settings.SLACK_TOKEN)
response = sc.api_call('users.admin.invite', email=email)
Expand Down
2 changes: 1 addition & 1 deletion app/retail/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ def slack(request):
try:
validate_email(email)
get_or_save_email_subscriber(email, 'slack', send_slack_invite=False)
response = invite_to_slack(email)
response = invite_to_slack(email, True)

if not response.get('ok'):
context['msg'] = response.get('error', _('Unknown error'))
Expand Down
2 changes: 2 additions & 0 deletions app/townsquare/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ def town_square(request):
'target': f'/activity?what={tab}&trending_only={trending_only}',
'tab': tab,
'tabs': tabs,
'max_length': max_length,
'max_length_offset': max_length_offset,
'SHOW_DRESSING': SHOW_DRESSING,
'hackathon_tabs': hackathon_tabs,
'REFER_LINK': f'https://gitcoin.co/townsquare/?cb=ref:{request.user.profile.ref_code}' if request.user.is_authenticated else None,
Expand Down

0 comments on commit 9b7852d

Please sign in to comment.