diff --git a/app/dashboard/migrations/0069_profile_hide_wallet_address.py b/app/dashboard/migrations/0069_profile_hide_wallet_address.py new file mode 100644 index 00000000000..bd288ef276e --- /dev/null +++ b/app/dashboard/migrations/0069_profile_hide_wallet_address.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.4 on 2019-12-30 15:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('dashboard', '0068_auto_20191211_1458'), + ] + + operations = [ + migrations.AddField( + model_name='profile', + name='hide_wallet_address', + field=models.BooleanField(default=True, help_text='If this option is chosen, we will remove your wallet information all together'), + ), + ] diff --git a/app/dashboard/models.py b/app/dashboard/models.py index 3370559e49b..7daee18a852 100644 --- a/app/dashboard/models.py +++ b/app/dashboard/models.py @@ -2330,6 +2330,10 @@ class Profile(SuperModel): default=True, help_text='If this option is chosen, we will remove your profile information all_together', ) + hide_wallet_address = models.BooleanField( + default=True, + help_text='If this option is chosen, we will remove your wallet information all together', + ) trust_profile = models.BooleanField( default=False, help_text='If this option is chosen, the user is able to submit a faucet/ens domain registration even if they are new to github', diff --git a/app/dashboard/templates/profiles/header_details.html b/app/dashboard/templates/profiles/header_details.html index 254f964e848..06343418b1f 100644 --- a/app/dashboard/templates/profiles/header_details.html +++ b/app/dashboard/templates/profiles/header_details.html @@ -19,7 +19,8 @@

'> {% endif %}

-

{{ profile.handle }} +

+ {{ profile.handle }} {% if profile.custom_tagline %} - {{ profile.custom_tagline }} {% endif %} @@ -64,10 +65,25 @@

{% endif %} - -{% if 0 %} -TODO: Re-enable this when we have proper privacy in place a la https://github.com/gitcoinco/web/issues/5654 -{% if profile.preferred_payout_address %} +{% if not profile.hide_wallet_address %} + {% if profile.preferred_payout_address %} +
+ + {{ profile.preferred_payout_address }} + {% if is_my_profile %} + Update preferred address + {% endif %} +
+ {% else %} +
+ {% if is_my_profile %} + Add a preferred address + {% elif not profile.is_org %} + No preferred address + {% endif %} +
+ {% endif %} +{% elif user.has_done_business_with %}
{{ profile.preferred_payout_address }} @@ -75,16 +91,8 @@

Update preferred address {% endif %}

-{% else %} -
- {% if is_my_profile %} - Add a preferred address - {% elif not profile.is_org %} - No preferred address - {% endif %} -
-{% endif %} {% endif %} + {% if not profile.is_org %}
{% for i in ratings %} @@ -93,9 +101,9 @@

({{ avg_rating.total_rating }} {% trans "rating" %}{{avg_rating.total_rating | pluralize}})

{% endif %} + {% if profile.show_job_status %}
{{ profile.job_status_verbose }}
-{% endif %} - +{% endif %} \ No newline at end of file diff --git a/app/grants/templates/grants/activity.html b/app/grants/templates/grants/activity.html index 5cc4f1cb8ca..f6f67733a3e 100644 --- a/app/grants/templates/grants/activity.html +++ b/app/grants/templates/grants/activity.html @@ -34,8 +34,8 @@
{% if subscription.new_approve_tx_id %} - View Etherscan - {%endif%} + View Etherscan + {% endif %}
@@ -78,13 +78,23 @@ {% if not transaction.success %} (Failed) {% endif %}
- + {% if not profile.hide_wallet_address %} + + {% elif subscription.contributor_profile.has_done_business_with %} + + {% endif %}

@@ -135,15 +145,25 @@ {{subscription.num_tx_approved|floatformat}} time{{ subscription.num_tx_approved|pluralize }}

-
+ {% if not profile.hide_wallet_address %} +
{% if subscription.cancel_tx_id != '0x0' %} {% if transaction.cancel_tx_id %} View Etherscan - {%endif%} + {% endif %} {% endif %}
+ {% elif subscription.contributor_profile.has_done_business_with %} + + {% endif %}

diff --git a/app/grants/templates/grants/fund.html b/app/grants/templates/grants/fund.html index a4d67aad421..1194c780072 100644 --- a/app/grants/templates/grants/fund.html +++ b/app/grants/templates/grants/fund.html @@ -189,7 +189,7 @@

{% trans "Fund Grant" %}

-
+

{% trans "Support Gitcoin" %}

@@ -229,6 +229,12 @@

{% trans "Support Gitcoin" %}

+
+ + +
+ {% trans "If this option is chosen, your wallet addres will be hidden" %} +
diff --git a/app/grants/views.py b/app/grants/views.py index 145c5456f2c..239879f530f 100644 --- a/app/grants/views.py +++ b/app/grants/views.py @@ -609,6 +609,10 @@ def grant_fund(request, grant_id, grant_slug): return JsonResponse({ 'success': True, }) + + if 'hide_wallet_address' in request.POST: + profile.hide_wallet_address = bool(request.POST.get('hide_wallet_address', False)) + profile.save() if 'signature' in request.POST: sub_new_approve_tx_id = request.POST.get('sub_new_approve_tx_id', '') @@ -660,6 +664,7 @@ def grant_fund(request, grant_id, grant_slug): is_phantom_funding_this_grant = not is_phantom_funding_this_grant params = { + 'profile': profile, 'active': 'fund_grant', 'title': _('Fund Grant'), 'card_desc': _('Provide sustainable funding for Open Source with Gitcoin Grants'), diff --git a/app/marketing/views.py b/app/marketing/views.py index 37f29d2b6f5..c4acf2395e4 100644 --- a/app/marketing/views.py +++ b/app/marketing/views.py @@ -153,6 +153,7 @@ def privacy_settings(request): if profile: profile.suppress_leaderboard = bool(request.POST.get('suppress_leaderboard', False)) profile.hide_profile = bool(request.POST.get('hide_profile', False)) + profile.hide_wallet_address = bool(request.POST.get('hide_wallet_address', False)) profile = record_form_submission(request, profile, 'privacy') if profile.alumni and profile.alumni.exists(): alumni = profile.alumni.first() diff --git a/app/retail/templates/settings/privacy.html b/app/retail/templates/settings/privacy.html index a640605b41e..b40e6124106 100644 --- a/app/retail/templates/settings/privacy.html +++ b/app/retail/templates/settings/privacy.html @@ -17,6 +17,14 @@
{% trans "Privacy Preferences" %}

{% trans "If this option is chosen, we will remove your profile altogether" %}
+
+ + +
+ + {% trans "If this option is chosen, your wallet address will be visible only to user's you've previously done business with on Gitcoin" %} + +
{% if profile.alumni.exists %}