From e6c081512b910561cdc5118adcec5b23f94dd67b Mon Sep 17 00:00:00 2001 From: owocki Date: Mon, 22 Jun 2020 12:01:52 -0600 Subject: [PATCH 01/75] Fix for - grant contributions being pending - leaderboard undefined var - ability to change kudos info all at once --- app/dashboard/tip_views.py | 4 ++++ app/dataviz/templates/dataviz/mesh.html | 4 ++-- app/grants/models.py | 19 ++++++++++--------- app/kudos/admin.py | 10 +++++----- app/marketing/views.py | 2 +- app/retail/templates/admin/change_form.html | 1 + 6 files changed, 23 insertions(+), 17 deletions(-) diff --git a/app/dashboard/tip_views.py b/app/dashboard/tip_views.py index a8afab3ae99..5fa24cb1842 100644 --- a/app/dashboard/tip_views.py +++ b/app/dashboard/tip_views.py @@ -87,6 +87,10 @@ def request_money(request): 'requester': request.user.profile, } fund_request = FundRequest.objects.create(**kwargs) + if network == 'ETH': + if not profile.preferred_payout_address: + profile.preferred_payout_address = address + profile.save() #save preferred payout addr messages.success(request, f'Stay tuned, {profile.handle} has been notified by email.') else: messages.error(request, f'The user {username} doesn\'t exists.') diff --git a/app/dataviz/templates/dataviz/mesh.html b/app/dataviz/templates/dataviz/mesh.html index 6bef263ea9f..13df6ad06a6 100644 --- a/app/dataviz/templates/dataviz/mesh.html +++ b/app/dataviz/templates/dataviz/mesh.html @@ -406,7 +406,7 @@ {% for option in days %} {% endfor %} - + (Beg OD) to + (End OD) Rotate: Left Mouse Button and Move
diff --git a/app/grants/models.py b/app/grants/models.py index e12ec9e31bd..5026a5f18d7 100644 --- a/app/grants/models.py +++ b/app/grants/models.py @@ -1164,15 +1164,16 @@ def update_tx_status(self): return # handle replace of tx_id - tx_status, _ = get_tx_status(self.tx_id, self.subscription.network, self.created_on) - if tx_status in ['pending', 'dropped', 'unknown', '']: - new_tx = getReplacedTX(self.tx_id) - if new_tx: - self.tx_id = new_tx - else: - # TODO: do stuff related to long running pending txns - pass - return + if self.tx_id: + tx_status, _ = get_tx_status(self.tx_id, self.subscription.network, self.created_on) + if tx_status in ['pending', 'dropped', 'unknown', '']: + new_tx = getReplacedTX(self.tx_id) + if new_tx: + self.tx_id = new_tx + else: + # TODO: do stuff related to long running pending txns + pass + return # handle replace of split_tx_id if self.split_tx_id: split_tx_status, _ = get_tx_status(self.split_tx_id, self.subscription.network, self.created_on) diff --git a/app/kudos/admin.py b/app/kudos/admin.py index 20023e45283..7d4e8ff29c1 100644 --- a/app/kudos/admin.py +++ b/app/kudos/admin.py @@ -47,6 +47,10 @@ def response_change(self, request, obj): notify_kudos_rejected(obj) self.message_user(request, f"Notified user of rejection") return redirect('/_administrationkudos/tokenrequest/?approved=f&rejection_reason=') + if "_change_owner" in request.POST: + obj.to_address = '0x6239FF1040E412491557a7a02b2CBcC5aE85dc8F' + obj.save() + self.message_user(request, f"Changed owner to gitcoin") if "_mint_kudos" in request.POST: from kudos.tasks import mint_token_request try: @@ -55,11 +59,6 @@ def response_change(self, request, obj): except Exception as e: self.message_user(request, str(e)) return redirect('/_administrationkudos/tokenrequest/?approved=f&rejection_reason=') - - if "_change_owner" in request.POST: - obj.to_address = '0x6239FF1040E412491557a7a02b2CBcC5aE85dc8F' - obj.save() - self.message_user(request, f"Changed owner to gitcoin") return redirect(obj.admin_url) def preview(self, instance): @@ -125,6 +124,7 @@ def response_change(self, request, obj): ) self.message_user(request, f"Created Bulk Transfer Coupon with default settings") return redirect(btc.admin_url) + return redirect(obj.admin_url) class TransferAdmin(admin.ModelAdmin): diff --git a/app/marketing/views.py b/app/marketing/views.py index 7a83655564d..78b764045b5 100644 --- a/app/marketing/views.py +++ b/app/marketing/views.py @@ -863,7 +863,7 @@ def leaderboard(request, key=''): which_leaderboard = f"{cadence}_{key}" all_ranks = LeaderboardRank.objects.filter(leaderboard=which_leaderboard, product=product) if keyword_search: - all_ranks = ranks.filter(tech_keywords__icontains=keyword_search) + all_ranks = all_ranks.filter(tech_keywords__icontains=keyword_search) amount = all_ranks.values_list('amount').annotate(Max('amount')).order_by('-amount') ranks = all_ranks.filter(active=True) diff --git a/app/retail/templates/admin/change_form.html b/app/retail/templates/admin/change_form.html index 417bd6ab595..c7813c381c3 100644 --- a/app/retail/templates/admin/change_form.html +++ b/app/retail/templates/admin/change_form.html @@ -23,6 +23,7 @@ {% elif 'grants/contribution' in request.build_absolute_uri %} {% elif 'kudos/tokenrequest' in request.build_absolute_uri %} + From 6b52fc4c37e963bbf24fe8a3a3c11b053190cef4 Mon Sep 17 00:00:00 2001 From: owocki Date: Mon, 22 Jun 2020 12:58:15 -0600 Subject: [PATCH 02/75] fix for broken ether transfers, before it was not correctly clearing bulk ether transfers --- app/economy/tx.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/app/economy/tx.py b/app/economy/tx.py index 6cba4cf9108..367a4ed3f55 100644 --- a/app/economy/tx.py +++ b/app/economy/tx.py @@ -142,16 +142,15 @@ def grants_transaction_validator(contribution): transaction_hash = transaction_receipt.transactionHash.hex() transaction = check_transaction(transaction_hash) if transaction.value > 0.001: - token_transfer = { - 'to': transaction.to, - 'token_name': 'ETH', - 'token_address': '0x0', - 'token_amount_int': Decimal(transaction.value), - 'token_amount_decimal': Decimal(transaction.value / 10 **18), - 'decimals': 18, - } + recipient_address = Web3.toChecksumAddress(contribution.subscription.grant.admin_address) + transfers = get_token_originators(recipient_address, '0x0', from_address=from_address, return_what='transfers') + for transfer in transfers: + delta = abs(abs(contribution.subscription.amount_per_period_minus_gas_price) - abs(transfer['token_amount_decimal'])) + if delta < 0.001: + token_transfer = transfer maybeprint(148, round(time.time(),2)) if not token_originators: + token_originators = get_token_originators(from_address, '0x0', from_address=None, return_what='originators') maybeprint(150, round(time.time(),2)) @@ -282,10 +281,10 @@ def get_token_originators(to_address, token, from_address='', return_what='trans endpoint = 'token-transfers' if token != '0x0' else 'ether-transfers' url = f'https://api.aleth.io/v1/{endpoint}?filter[to]=' + address + '&filter[token]=' + token + '&page%5Blimit%5D=100' - if from_address: - url += '&filter[from]=' + from_address if token == '0x0': url = f'https://api.aleth.io/v1/{endpoint}?filter[account]=' + address + '&page%5Blimit%5D=100' + if from_address: + url += '&filter[from]=' + from_address transfers = requests.get( url, From 9ca2bd5afa3bcd2376b223ea78ce681a8bab0ecb Mon Sep 17 00:00:00 2001 From: owocki Date: Mon, 22 Jun 2020 13:06:13 -0600 Subject: [PATCH 03/75] one more fix for validating eth transfesr --- app/economy/tx.py | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/app/economy/tx.py b/app/economy/tx.py index 367a4ed3f55..7564ce6920c 100644 --- a/app/economy/tx.py +++ b/app/economy/tx.py @@ -143,7 +143,7 @@ def grants_transaction_validator(contribution): transaction = check_transaction(transaction_hash) if transaction.value > 0.001: recipient_address = Web3.toChecksumAddress(contribution.subscription.grant.admin_address) - transfers = get_token_originators(recipient_address, '0x0', from_address=from_address, return_what='transfers') + transfers = get_token_originators(recipient_address, '0x0', from_address=from_address, return_what='transfers', tx_id=tx) for transfer in transfers: delta = abs(abs(contribution.subscription.amount_per_period_minus_gas_price) - abs(transfer['token_amount_decimal'])) if delta < 0.001: @@ -166,7 +166,7 @@ def grants_transaction_validator(contribution): maybeprint(160, round(time.time(),2)) # get token transfers if not token_transfer: - transfers = get_token_originators(recipient_address, token_address, from_address=from_address, return_what='transfers') + transfers = get_token_originators(recipient_address, token_address, from_address=from_address, return_what='transfers', tx_id=tx) if transfers: token_transfer = transfers maybeprint(169, round(time.time(),2)) @@ -253,7 +253,7 @@ def get_token_recipient_senders(recipient_address, token_address): auth = settings.ALETHIO_KEY headers = {'Authorization': f'Bearer {auth}'} -def get_token_originators(to_address, token, from_address='', return_what='transfers'): +def get_token_originators(to_address, token, from_address='', return_what='transfers', tx_id=''): address = to_address #is_address = requests.get('https://api.aleth.io/v1/accounts/' + address, headers=headers).status_code @@ -296,16 +296,25 @@ def get_token_originators(to_address, token, from_address='', return_what='trans if return_what == 'transfers': for transfer in transfers.get('data', {}): - if transfer.get('type') == 'TokenTransfer': - # todo: check txid to make sure it matches (to prevent multiple transfers from this address to this address from falsy validating positively) - return { - 'token_amount_decimal': Decimal(int(transfer['attributes']['value']) / 10 ** transfer['attributes']['decimals']), - 'token_name': transfer['attributes']['symbol'], - 'to': address, - 'token_address': token, - 'token_amount_int': int(transfer['attributes']['value']), - 'decimals': transfer['attributes']['decimals'], - } + if tx_id and tx_id.lower() == trasnfer.get('id').lower(): + if transfer.get('type') == 'TokenTransfer': + return { + 'token_amount_decimal': Decimal(int(transfer['attributes']['value']) / 10 ** transfer['attributes']['decimals']), + 'token_name': transfer['attributes']['symbol'], + 'to': address, + 'token_address': token, + 'token_amount_int': int(transfer['attributes']['value']), + 'decimals': transfer['attributes']['decimals'], + } + if transfer.get('type') == 'EtherTransfer': + return { + 'token_amount_decimal': Decimal(int(transfer['attributes']['value']) / 10 ** 18), + 'token_name': 'ETH', + 'to': address, + 'token_address': '0x0', + 'token_amount_int': int(transfer['attributes']['value']), + 'decimals': 18, + } return None # TokenTransfer events, value field From f02e9f4442acf3e7c4fe6d4711558e86396c0818 Mon Sep 17 00:00:00 2001 From: owocki Date: Mon, 22 Jun 2020 13:07:01 -0600 Subject: [PATCH 04/75] straggler" gs gp --- app/economy/tx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/economy/tx.py b/app/economy/tx.py index 7564ce6920c..e6c1916af97 100644 --- a/app/economy/tx.py +++ b/app/economy/tx.py @@ -296,7 +296,7 @@ def get_token_originators(to_address, token, from_address='', return_what='trans if return_what == 'transfers': for transfer in transfers.get('data', {}): - if tx_id and tx_id.lower() == trasnfer.get('id').lower(): + if tx_id and tx_id.lower() == transfer.get('id').lower(): if transfer.get('type') == 'TokenTransfer': return { 'token_amount_decimal': Decimal(int(transfer['attributes']['value']) / 10 ** transfer['attributes']['decimals']), From 61ea23e44d7bee5cfe16272269ca17168962c932 Mon Sep 17 00:00:00 2001 From: owocki Date: Mon, 22 Jun 2020 13:09:22 -0600 Subject: [PATCH 05/75] token transfer validator --- app/economy/tx.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/economy/tx.py b/app/economy/tx.py index e6c1916af97..0099b288ecd 100644 --- a/app/economy/tx.py +++ b/app/economy/tx.py @@ -143,11 +143,9 @@ def grants_transaction_validator(contribution): transaction = check_transaction(transaction_hash) if transaction.value > 0.001: recipient_address = Web3.toChecksumAddress(contribution.subscription.grant.admin_address) - transfers = get_token_originators(recipient_address, '0x0', from_address=from_address, return_what='transfers', tx_id=tx) - for transfer in transfers: - delta = abs(abs(contribution.subscription.amount_per_period_minus_gas_price) - abs(transfer['token_amount_decimal'])) - if delta < 0.001: - token_transfer = transfer + transfer = get_token_originators(recipient_address, '0x0', from_address=from_address, return_what='transfers', tx_id=tx) + if transfer: + token_transfer = transfer maybeprint(148, round(time.time(),2)) if not token_originators: From 60e2a58ba1bdad18709b8df28c07a7a4083d319d Mon Sep 17 00:00:00 2001 From: owocki Date: Mon, 22 Jun 2020 13:13:36 -0600 Subject: [PATCH 06/75] txid comparisons --- app/economy/tx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/economy/tx.py b/app/economy/tx.py index 0099b288ecd..529c950e49e 100644 --- a/app/economy/tx.py +++ b/app/economy/tx.py @@ -294,7 +294,7 @@ def get_token_originators(to_address, token, from_address='', return_what='trans if return_what == 'transfers': for transfer in transfers.get('data', {}): - if tx_id and tx_id.lower() == transfer.get('id').lower(): + if tx_id and tx_id.lower() in str(transfer).lower(): if transfer.get('type') == 'TokenTransfer': return { 'token_amount_decimal': Decimal(int(transfer['attributes']['value']) / 10 ** transfer['attributes']['decimals']), From a9a81c6d0aa0eb075bd0b9a57498227974f6fa9e Mon Sep 17 00:00:00 2001 From: owocki Date: Mon, 22 Jun 2020 13:22:49 -0600 Subject: [PATCH 07/75] more validation fix --- app/economy/tx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/economy/tx.py b/app/economy/tx.py index 529c950e49e..16de3503c50 100644 --- a/app/economy/tx.py +++ b/app/economy/tx.py @@ -190,7 +190,7 @@ def grants_transaction_validator(contribution): from_address = Web3.toChecksumAddress(contribution.subscription.contributor_address) recipient_address = Web3.toChecksumAddress(contribution.subscription.grant.admin_address) token_address = Web3.toChecksumAddress(contribution.subscription.token_address) - _transfers = get_token_originators(recipient_address, token_address, from_address=from_address, return_what='transfers') + _transfers = get_token_originators(recipient_address, token_address, from_address=from_address, return_what='transfers', tx_id=tx) failsafe = _transfers['token_name'] == contribution.subscription.token_symbol if failsafe: validation['comment'] = f"Token Transfer Passed on the second try" From 44123adbb3e87d2586d5283cc006545793e3e93f Mon Sep 17 00:00:00 2001 From: owocki Date: Mon, 22 Jun 2020 13:48:10 -0600 Subject: [PATCH 08/75] do a much better job validating transfers by selecting the right ones --- app/economy/tx.py | 35 +++++++++++++-------------- app/grants/admin.py | 2 +- app/retail/templates/admin/index.html | 3 +++ 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/app/economy/tx.py b/app/economy/tx.py index 16de3503c50..f94c259df60 100644 --- a/app/economy/tx.py +++ b/app/economy/tx.py @@ -143,7 +143,7 @@ def grants_transaction_validator(contribution): transaction = check_transaction(transaction_hash) if transaction.value > 0.001: recipient_address = Web3.toChecksumAddress(contribution.subscription.grant.admin_address) - transfer = get_token_originators(recipient_address, '0x0', from_address=from_address, return_what='transfers', tx_id=tx) + transfer = get_token_originators(recipient_address, '0x0', from_address=from_address, return_what='transfers', tx_id=tx, amount=contribution.subscription.amount_per_period_minus_gas_price) if transfer: token_transfer = transfer maybeprint(148, round(time.time(),2)) @@ -164,7 +164,7 @@ def grants_transaction_validator(contribution): maybeprint(160, round(time.time(),2)) # get token transfers if not token_transfer: - transfers = get_token_originators(recipient_address, token_address, from_address=from_address, return_what='transfers', tx_id=tx) + transfers = get_token_originators(recipient_address, token_address, from_address=from_address, return_what='transfers', tx_id=tx, amount=contribution.subscription.amount_per_period_minus_gas_price) if transfers: token_transfer = transfers maybeprint(169, round(time.time(),2)) @@ -190,7 +190,7 @@ def grants_transaction_validator(contribution): from_address = Web3.toChecksumAddress(contribution.subscription.contributor_address) recipient_address = Web3.toChecksumAddress(contribution.subscription.grant.admin_address) token_address = Web3.toChecksumAddress(contribution.subscription.token_address) - _transfers = get_token_originators(recipient_address, token_address, from_address=from_address, return_what='transfers', tx_id=tx) + _transfers = get_token_originators(recipient_address, token_address, from_address=from_address, return_what='transfers', tx_id=tx, amount=contribution.subscription.amount_per_period_minus_gas_price) failsafe = _transfers['token_name'] == contribution.subscription.token_symbol if failsafe: validation['comment'] = f"Token Transfer Passed on the second try" @@ -251,7 +251,7 @@ def get_token_recipient_senders(recipient_address, token_address): auth = settings.ALETHIO_KEY headers = {'Authorization': f'Bearer {auth}'} -def get_token_originators(to_address, token, from_address='', return_what='transfers', tx_id=''): +def get_token_originators(to_address, token, from_address='', return_what='transfers', tx_id='', amount=None): address = to_address #is_address = requests.get('https://api.aleth.io/v1/accounts/' + address, headers=headers).status_code @@ -294,24 +294,23 @@ def get_token_originators(to_address, token, from_address='', return_what='trans if return_what == 'transfers': for transfer in transfers.get('data', {}): - if tx_id and tx_id.lower() in str(transfer).lower(): - if transfer.get('type') == 'TokenTransfer': + this_is_the_one = tx_id and tx_id.lower() in str(transfer).lower() + _decimals = transfer.get('attributes', {}).get('decimals', 18) + _symbol = transfer.get('attributes', {}).get('symbol', 'ETH') + _value = transfer.get('attributes', {}).get('value', 0) + _value_decimal = Decimal(int(_value) / 10 ** _decimals) + if amount: + delta = abs(float(abs(_value_decimal)) - float(abs(amount))) + this_is_the_one = delta < 0.001 + if this_is_the_one: + if transfer.get('type') in ['TokenTransfer', 'EtherTransfer']: return { - 'token_amount_decimal': Decimal(int(transfer['attributes']['value']) / 10 ** transfer['attributes']['decimals']), - 'token_name': transfer['attributes']['symbol'], + 'token_amount_decimal': _value_decimal, + 'token_name': _symbol, 'to': address, 'token_address': token, 'token_amount_int': int(transfer['attributes']['value']), - 'decimals': transfer['attributes']['decimals'], - } - if transfer.get('type') == 'EtherTransfer': - return { - 'token_amount_decimal': Decimal(int(transfer['attributes']['value']) / 10 ** 18), - 'token_name': 'ETH', - 'to': address, - 'token_address': '0x0', - 'token_amount_int': int(transfer['attributes']['value']), - 'decimals': 18, + 'decimals': _decimals, } return None diff --git a/app/grants/admin.py b/app/grants/admin.py index d4ccd0cda88..5ab4c107a42 100644 --- a/app/grants/admin.py +++ b/app/grants/admin.py @@ -233,7 +233,7 @@ def error_email_copy_not_active(self, instance): class ContributionAdmin(GeneralAdmin): """Define the Contribution administration layout.""" raw_id_fields = ['subscription'] - list_display = ['id', 'profile', 'created_on', 'grant', 'github_created_on', 'from_ip_address', 'txn_url', 'amount', 'token', 'tx_cleared', 'success'] + list_display = ['id', 'profile', 'created_on', 'grant', 'github_created_on', 'from_ip_address', 'etherscan_links', 'amount', 'token', 'tx_cleared', 'success'] readonly_fields = ['etherscan_links', 'amount_per_period_to_gitcoin', 'amount_per_period_minus_gas_price', 'amount_per_period'] def txn_url(self, obj): diff --git a/app/retail/templates/admin/index.html b/app/retail/templates/admin/index.html index d52ad243e91..8121093765e 100644 --- a/app/retail/templates/admin/index.html +++ b/app/retail/templates/admin/index.html @@ -92,6 +92,9 @@

{% trans 'Debugging Tasks' %}

+

{% trans 'Administrative Tasks' %}

From 910d437fd3bf30d761f5d883eb2873280c10d338 Mon Sep 17 00:00:00 2001 From: owocki Date: Mon, 22 Jun 2020 14:02:19 -0600 Subject: [PATCH 09/75] https://gitcoincore.slack.com/archives/CAXQ7PT60/p1592847090125400 --- app/assets/v2/js/status.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/assets/v2/js/status.js b/app/assets/v2/js/status.js index d28c645ed2e..1d0ff5cbed7 100644 --- a/app/assets/v2/js/status.js +++ b/app/assets/v2/js/status.js @@ -166,9 +166,8 @@ $(document).ready(function() { } else if (site && site.length > 1 && no_lb) { const url = site[0]; - const getMetadata = fetchData('service/metadata/?url=' + url); - - $.when(getMetadata).then(function(response) { + let metadata_callback = function(response) { + document[url] = response; if (response) { const desc = response.description && response.description.length > 200 ? @@ -196,7 +195,14 @@ $(document).ready(function() { $('#thumbnail-desc').text(''); embedded_resource = ''; } - }); + }; + // cache calls for the same URL on the document + if(typeof document[url] == 'undefined'){ + const getMetadata = fetchData('service/metadata/?url=' + url); + $.when(getMetadata).then(metadata_callback); + } else { + metadata_callback(document[url]); + } } else { $('#thumbnail-desc').text(''); if (no_lb) { From 0ab873343893658985e62a5b1b73c4f5dc7c2339 Mon Sep 17 00:00:00 2001 From: owocki Date: Mon, 22 Jun 2020 14:25:12 -0600 Subject: [PATCH 10/75] make fix + add staff link on contributions --- app/assets/v2/js/status.js | 4 +++- app/grants/templates/grants/transaction.html | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/assets/v2/js/status.js b/app/assets/v2/js/status.js index 1d0ff5cbed7..f3b152a5b71 100644 --- a/app/assets/v2/js/status.js +++ b/app/assets/v2/js/status.js @@ -197,8 +197,10 @@ $(document).ready(function() { } }; // cache calls for the same URL on the document - if(typeof document[url] == 'undefined'){ + + if (typeof document[url] == 'undefined') { const getMetadata = fetchData('service/metadata/?url=' + url); + $.when(getMetadata).then(metadata_callback); } else { metadata_callback(document[url]); diff --git a/app/grants/templates/grants/transaction.html b/app/grants/templates/grants/transaction.html index 29c48e68863..4e0e4ec3f2d 100644 --- a/app/grants/templates/grants/transaction.html +++ b/app/grants/templates/grants/transaction.html @@ -42,6 +42,11 @@
{% endif %} + {% if is_staff %} + + {% endif %}

From 2b789c7e93dcd9e0082945d70c74fc457d5a0c2f Mon Sep 17 00:00:00 2001 From: owocki Date: Mon, 22 Jun 2020 14:38:17 -0600 Subject: [PATCH 11/75] fixes grant profile --- .../profiles/tab_grant_contribs.html | 21 +++++++++++-------- app/dashboard/views.py | 1 + 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/dashboard/templates/profiles/tab_grant_contribs.html b/app/dashboard/templates/profiles/tab_grant_contribs.html index 09ca5529a47..7acb246c16e 100644 --- a/app/dashboard/templates/profiles/tab_grant_contribs.html +++ b/app/dashboard/templates/profiles/tab_grant_contribs.html @@ -25,18 +25,20 @@

Monthly Summary

{% include "profiles/earningsgraph.html" with graph_type="grants" %} + {% if subs.count %} + Add all to Cart + {% endif %} -

Subscriptions ({{profile.grant_contributor.count}})

+

Subscriptions ({{subs.count}})

- {% if not profile.grant_contributor.count %} -

+ {% if not subs.count %} +

No Grants Subscribed. Explore Grants > -

+

{% endif %} - {% for subscription in profile.grant_contributor.all %} + {% for subscription in subs.all %} {# FIXME: last_contribution_date is wrong. #}
@@ -69,12 +71,12 @@

{% endfor %} -

Grants Created ({{profile.grant_admin.count}})

+

Grants Created ({{profile.grant_admin.count}})

{% if not profile.grant_admin.count %} -

+

No Grants Created. Create a Grant > -

+

{% endif %} {% for transaction in profile.grant_admin.all %} @@ -83,6 +85,7 @@

{{ transaction.created_on|date:"Y-m-d" }}

+
@@ -104,7 +107,7 @@

{% endfor %} -

Grant Contribution History ({{history|length}})

+

Grant Contribution History ({{history|length}})

+ Add all to Cart diff --git a/app/dashboard/views.py b/app/dashboard/views.py index 63d0707b727..bc59c5113ed 100644 --- a/app/dashboard/views.py +++ b/app/dashboard/views.py @@ -2653,6 +2653,7 @@ def get_profile_tab(request, profile, tab, prev_context): for ele in contributions: history.append(ele.normalized_data) context['history'] = history + context['subs'] = profile.grant_contributor.filter(num_tx_approved__gt=1) elif tab == 'active': context['active_bounties'] = active_bounties elif tab == 'resume': From 690144e95d78adf33da6954fe7ea2860ee94cc4c Mon Sep 17 00:00:00 2001 From: owocki Date: Mon, 22 Jun 2020 14:49:33 -0600 Subject: [PATCH 12/75] removed addr on invoice so that users dont mistakenly send $$$ to it --- app/dashboard/templates/bounty/invoice.html | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/dashboard/templates/bounty/invoice.html b/app/dashboard/templates/bounty/invoice.html index 729c13d8607..a4c7d28d829 100644 --- a/app/dashboard/templates/bounty/invoice.html +++ b/app/dashboard/templates/bounty/invoice.html @@ -161,19 +161,13 @@ {% trans "Payment Method" %} - - {% trans "Account" %} # - - {% trans "Directly to counterparties via Ethereum Blockchain" %} + {% trans "Directly to counterparties via Blockchain" %} - - 0x2af47a65da8cd66729b4209c22017d6a5c2d2400 - {% endif %} From 03c6bdb4779bc0f7c279ef1acce06f947e35356d Mon Sep 17 00:00:00 2001 From: owocki Date: Mon, 22 Jun 2020 15:04:19 -0600 Subject: [PATCH 13/75] add twitter handle to grant details --- app/grants/templates/grants/detail/info.html | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/grants/templates/grants/detail/info.html b/app/grants/templates/grants/detail/info.html index cc173935848..c5db0a7deac 100644 --- a/app/grants/templates/grants/detail/info.html +++ b/app/grants/templates/grants/detail/info.html @@ -87,17 +87,25 @@

{% if is_team_member %} {% else %} - + {{ grant.reference_url }} {% endif %}

+ {% if grant.twitter_handle_1 %} + + {% endif %} @@ -121,7 +129,7 @@

- Grant accepts {{ grant.token_symbol }} + Grant Accepts {{ grant.token_symbol }}

{% endif %} From ac07d372085fa25d83b5bbd767b27f502bc6d150 Mon Sep 17 00:00:00 2001 From: owocki Date: Mon, 22 Jun 2020 15:43:11 -0600 Subject: [PATCH 14/75] keep the user on the checkout page until the posts have had time to complete https://github.com/gitcoinco/web/issues/6947 --- app/assets/v2/js/cart.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/assets/v2/js/cart.js b/app/assets/v2/js/cart.js index 2844a1a215d..d2ded55100d 100644 --- a/app/assets/v2/js/cart.js +++ b/app/assets/v2/js/cart.js @@ -642,14 +642,19 @@ Vue.component('grants-cart', { localStorage.setItem('contributions_were_successful', 'true'); localStorage.setItem('contributions_count', String(this.grantData.length)); var network = document.web3network; + let timeout_amount = 1500 + (CartData.loadCart().length * 500) + _alert('Saving contributions. Please do not leave this page.', 'success', 2000); setTimeout(function() { - if (network === 'rinkeby') { - window.location.href = `${window.location.origin}/grants/?network=rinkeby&category=`; - } else { - window.location.href = `${window.location.origin}/grants`; - } - }, 1500); + _alert('Contributions saved', 'success', 1000); + setTimeout(function(){ + if (network === 'rinkeby') { + window.location.href = `${window.location.origin}/grants/?network=rinkeby&category=`; + } else { + window.location.href = `${window.location.origin}/grants`; + } + }, 500); + }, timeout_amount); }) .on('error', (error, receipt) => { // If the transaction was rejected by the network with a receipt, the second parameter will be the receipt. From 74fc5e71cd8d78ab9a409daff35e03a9cecbddac Mon Sep 17 00:00:00 2001 From: owocki Date: Mon, 22 Jun 2020 16:11:24 -0600 Subject: [PATCH 15/75] fixes grants css --- app/retail/templates/shared/grant_thanks_modal.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/retail/templates/shared/grant_thanks_modal.html b/app/retail/templates/shared/grant_thanks_modal.html index efc1412e605..c0df4ce18ed 100644 --- a/app/retail/templates/shared/grant_thanks_modal.html +++ b/app/retail/templates/shared/grant_thanks_modal.html @@ -17,7 +17,7 @@ {% endcomment %} {% load i18n static %}