Skip to content

Commit ed7f904

Browse files
mds1thelostone-mc
andauthored
Rename user-facing instances of 'personal token' to 'time token' (gitcoinco#8322)
* Rename user-facing instances of 'personal token' to 'time token' * add new migration file Co-authored-by: Aditya Anand M C <[email protected]>
1 parent e89b62c commit ed7f904

29 files changed

+130
-77
lines changed

app/app/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
# board
7979
re_path(r'^dashboard/?', dashboard.views.board, name='dashboard'),
8080

81-
# personal_tokens
81+
# personal_tokens (now called Time Tokens)
8282
re_path(r'^ptoken/quickstart/?', ptokens.views.quickstart, name='ptoken_quickstart'),
8383
re_path(r'^ptoken/faq/?', ptokens.views.faq, name='ptokens_faq'),
8484
path('ptokens/redemptions/<int:redemption_id>/', ptokens.views.ptoken_redemption, name='token_redemption'),

app/assets/v2/js/board.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
// Personal token constants
1+
// Time token constants
2+
// Note: "Time Tokens" used to be called "Personal Tokens". To simplify the renaming process,
3+
// variables, classes, and contracts continue to use the old name, but user-facing text uses the
4+
// new name. Personal tokens and Time tokens are the same thing, so you will likely see those two
5+
// phrases used interchangeably throughout the codebase
6+
27
// Note that this address is also duplicated in profile_tokens.js and app/ptokens/models.py
38
const factoryAddress = document.contxt.ptoken_factory_address;
49

@@ -425,7 +430,7 @@ Vue.mixin({
425430
change_price(pTokenId, price, transactionHash, network);
426431
document.ptoken.price = price;
427432

428-
const successMsg = 'The price of your personal token has successfully been updated!';
433+
const successMsg = 'The price of your time token has successfully been updated!';
429434
const errorMsg = 'Oops, something went wrong changing your token price. Please try again or contact [email protected]';
430435

431436
await updatePtokenStatusinDatabase(transactionHash, successMsg, errorMsg);
@@ -450,7 +455,7 @@ Vue.mixin({
450455
document.ptoken.supply = supply;
451456
document.ptoken.available = supply - (document.ptoken.purchases - document.ptoken.redemptions);
452457

453-
const successMsg = 'The supply of your personal token has successfully been increased!';
458+
const successMsg = 'The supply of your time token has successfully been increased!';
454459
const errorMsg = 'Oops, something went wrong increasing your token supply. Please try again or contact [email protected]';
455460

456461
await updatePtokenStatusinDatabase(transactionHash, successMsg, errorMsg);
@@ -470,7 +475,7 @@ Vue.mixin({
470475
document.ptoken.supply = supply;
471476
document.ptoken.available = supply - (document.ptoken.purchases - document.ptoken.redemptions);
472477

473-
const successMsg = 'The supply of your personal token has successfully been decreased!';
478+
const successMsg = 'The supply of your time token has successfully been decreased!';
474479
const errorMsg = 'Oops, something went wrong decreased your token supply. Please try again or contact [email protected]';
475480

476481
await updatePtokenStatusinDatabase(transactionHash, successMsg, errorMsg);
@@ -536,8 +541,8 @@ Vue.mixin({
536541

537542
vm.user_has_token = true;
538543
console.log('Token saved in database', ptokenReponse);
539-
const successMsg = 'Congratulations, your personal token has been created successfully!';
540-
const errorMsg = 'Oops, something went wrong trying to create your personal token. Please try again or contact [email protected]';
544+
const successMsg = 'Congratulations, your time token has been created successfully!';
545+
const errorMsg = 'Oops, something went wrong trying to create your time token. Please try again or contact [email protected]';
541546

542547
await updatePtokenStatusinDatabase(transactionHash, successMsg, errorMsg);
543548
}).on('error', function(err) {

app/assets/v2/js/pages/profile_tokens.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
// Personal token constants
1+
// Time token constants
2+
// Note: "Time Tokens" used to be called "Personal Tokens". To simplify the renaming process,
3+
// variables, classes, and contracts continue to use the old name, but user-facing text uses the
4+
// new name. Personal tokens and Time tokens are the same thing, so you will likely see those two
5+
// phrases used interchangeably throughout the codebase
6+
27
// Note that this address is also duplicated in board.js
38
const factoryAddress = document.contxt.ptoken_factory_address;
49
const purchaseTokenName = 'DAI';
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 2.2.4 on 2021-02-02 07:26
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('dashboard', '0168_auto_20201216_2058'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='activity',
15+
name='activity_type',
16+
field=models.CharField(blank=True, choices=[('wall_post', 'Wall Post'), ('status_update', 'Update status'), ('hypercharge_bounty', 'Hypercharged bounty'), ('new_bounty', 'New Bounty'), ('start_work', 'Work Started'), ('stop_work', 'Work Stopped'), ('work_submitted', 'Work Submitted'), ('work_done', 'Work Done'), ('worker_approved', 'Worker Approved'), ('worker_rejected', 'Worker Rejected'), ('worker_applied', 'Worker Applied'), ('increased_bounty', 'Increased Funding'), ('killed_bounty', 'Canceled Bounty'), ('new_tip', 'New Tip'), ('receive_tip', 'Tip Received'), ('bounty_abandonment_escalation_to_mods', 'Escalated checkin from @gitcoinbot about bounty status'), ('bounty_abandonment_warning', 'Checkin from @gitcoinbot about bounty status'), ('bounty_removed_slashed_by_staff', 'Dinged and Removed from Bounty by Staff'), ('bounty_removed_by_staff', 'Removed from Bounty by Staff'), ('bounty_removed_by_funder', 'Removed from Bounty by Funder'), ('new_crowdfund', 'New Crowdfund Contribution'), ('new_grant', 'New Grant'), ('update_grant', 'Updated Grant'), ('killed_grant', 'Cancelled Grant'), ('negative_contribution', 'Negative Grant Contribution'), ('new_grant_contribution', 'Contributed to Grant'), ('new_grant_subscription', 'Subscribed to Grant'), ('killed_grant_contribution', 'Cancelled Grant Contribution'), ('new_kudos', 'New Kudos'), ('created_kudos', 'Created Kudos'), ('receive_kudos', 'Receive Kudos'), ('joined', 'Joined Gitcoin'), ('played_quest', 'Played Quest'), ('beat_quest', 'Beat Quest'), ('created_quest', 'Created Quest'), ('updated_avatar', 'Updated Avatar'), ('mini_clr_payout', 'Mini CLR Payout'), ('leaderboard_rank', 'Leaderboard Rank'), ('consolidated_leaderboard_rank', 'Consolidated Leaderboard Rank'), ('consolidated_mini_clr_payout', 'Consolidated CLR Payout'), ('hackathon_registration', 'Hackathon Registration'), ('hackathon_new_hacker', 'Hackathon Registration'), ('new_hackathon_project', 'New Hackathon Project'), ('flagged_grant', 'Flagged Grant'), ('create_ptoken', 'Create time token'), ('mint_ptoken', 'Mint time token'), ('edit_price_ptoken', 'Edit time token price'), ('buy_ptoken', 'Edit time token price'), ('accept_redemption_ptoken', 'Accepts a redemption request of ptoken'), ('denies_redemption_ptoken', 'Denies a redemption request of ptoken'), ('complete_redemption_ptoken', 'Completes an outgoing redemption'), ('incoming_redemption_ptoken', 'Has an incoming redemption finalized by the Buyer')], db_index=True, max_length=50),
17+
),
18+
]

app/dashboard/models.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,11 +2286,11 @@ class Activity(SuperModel):
22862286
('hackathon_new_hacker', 'Hackathon Registration'),
22872287
('new_hackathon_project', 'New Hackathon Project'),
22882288
('flagged_grant', 'Flagged Grant'),
2289-
# ptokens
2290-
('create_ptoken', 'Create personal token'),
2291-
('mint_ptoken', 'Mint personal token'),
2292-
('edit_price_ptoken', 'Edit personal token price'),
2293-
('buy_ptoken', 'Edit personal token price'),
2289+
# ptokens (formerly called personal tokens, now called time tokens)
2290+
('create_ptoken', 'Create time token'),
2291+
('mint_ptoken', 'Mint time token'),
2292+
('edit_price_ptoken', 'Edit time token price'),
2293+
('buy_ptoken', 'Edit time token price'),
22942294
('accept_redemption_ptoken', 'Accepts a redemption request of ptoken'),
22952295
('denies_redemption_ptoken', 'Denies a redemption request of ptoken'),
22962296
('complete_redemption_ptoken', 'Completes an outgoing redemption'),

app/dashboard/templates/board/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<a class="nav-item nav-link nav-line active" id="funder-tab" data-toggle="tab" href="#nav-funder" role="tab" aria-controls="funder" aria-selected="false" @click="checkData('funder')">Funder</a>
3939
<a class="nav-item nav-link nav-line " id="contributor-tab" data-toggle="tab" href="#nav-contributor" role="tab" aria-controls="contributor" aria-selected="true" @click="checkData('contributor')">Contributor</a>
4040
{% if is_staff %}
41-
<a class="nav-item nav-link nav-line alpha-warning" id="ptokens-tab" data-toggle="tab" href="#nav-ptokens" role="tab" aria-controls="ptokens" aria-selected="true" @click="checkData('personal-tokens')">Personal Tokens</a>
41+
<a class="nav-item nav-link nav-line alpha-warning" id="ptokens-tab" data-toggle="tab" href="#nav-ptokens" role="tab" aria-controls="ptokens" aria-selected="true" @click="checkData('personal-tokens')">Time Tokens</a>
4242
{% endif %}
4343
</div>
4444
</nav>

app/dashboard/templates/board/ptokens.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
You should have received a copy of the GNU Affero General Public License
1515
along with this program. If not,see
1616
<http://www.gnu.org/licenses/>.
17+
18+
Note: "Time Tokens" used to be called "Personal Tokens". To simplify the renaming process,
19+
variables, classes, and contracts continue to use the old name, but user-facing text uses the
20+
new name. Personal tokens and Time tokens are the same thing, so you will likely see those two
21+
phrases used interchangeably throughout the codebase
1722
{% endcomment %}
1823
{% load i18n static add_url_schema avatar_tags %}
1924

@@ -64,7 +69,7 @@
6469
<div class="d-flex justify-content-between align-items-center p-4 border-bottom">
6570
<template v-if="!user_has_token">
6671
<div>
67-
Create a personal token to get paid today for work tomorrow <a href="{% url 'ptoken_quickstart' %}" class="underline">Learn more</a>
72+
Create a time token to get paid today for work tomorrow <a href="{% url 'ptoken_quickstart' %}" class="underline">Learn more</a>
6873
</div>
6974
<div id="showCreationSuccessModal" hidden data-toggle="modal" data-target="#createTokenSuccessModal"></div>
7075
<button class="btn btn-sm btn-outline-gc-blue m-2" data-toggle="modal" data-target="#createTokenModal">
@@ -79,7 +84,7 @@
7984
</button>
8085
</template>
8186
<template v-else-if="pToken.tx_status === 'success'">
82-
<div>Modify your Personal Token</div>
87+
<div>Modify your Time Token</div>
8388
<button class="btn btn-sm btn-outline-gc-blue m-2" data-toggle="modal" data-target="#editpTokenModal">
8489
Edit
8590
</button>

app/dashboard/templates/dashboard/users.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
</div>
117117
</div>
118118
<div class="g-multiselect pb-4 border-bottom form-group">
119-
<label for="only-with-token" class="font-weight-bold">Personal Token?</label>
119+
<label for="only-with-token" class="font-weight-bold">Time Token?</label>
120120
<input v-model.lazy="params.only_with_token" type="checkbox" id="only-with-token" />
121121
</div>
122122
<div v-if="persona != 'tribe'" class="g-multiselect pb-4 border-bottom form-group">

app/dashboard/templates/legal/terms.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ <h2 class="font-title">11. GITCOIN CONTRACTS</h2>
116116
<p>
117117
As used herein, a “Service Contract” means, as applicable, the unilateral contractual provisions created by Poster that govern the Hunter Services to be performed by Hunter for Poster for a particular Task posted to the Site and which will typically include a description of the Task or Tasks to be completed, the amount and type of currency as compensation, and the deadline. You acknowledge and agree that Gitcoin is not a party to any Service Contracts, and that the formation of a Service Contract between any Posters and Hunters will not, under any circumstance, create an employment or other service relationship between Gitcoin and Poster or Gitcoin and Hunter.
118118
</p>
119-
<h2 class="font-title">12. GITCOIN PERSONAL TOKENS</h2>
119+
<h2 class="font-title">12. GITCOIN TIME TOKENS</h2>
120120
<p>
121-
Gitcoin offers its Personal Token minting technology to allow users to independently create and distribute their own personal ERC20 tokens. After generating the tokens, users can transfer their personal tokens for a fixed price to purchasers who are users on the platform. In return, the purchaser will get access to 1 hour of time from the seller. All funds are transferred directly from the purchaser to the seller. The seller transfers the personal token directly from the personal token contract to the wallet of the purchaser. Gitcoin does not take custody of the token or the funds and currently does not collect any fees for providing this technology. Sellers shall provide a description of the services that a purchaser may redeem the Seller’s personal tokens for. Users agree to refrain from participating in any illegal activities in all applicable jurisdictions.
121+
Gitcoin offers its Time Token minting technology to allow users to independently create and distribute their own personal ERC20 tokens. After generating the tokens, users can transfer their time tokens for a fixed price to purchasers who are users on the platform. In return, the purchaser will get access to 1 hour of time from the seller. All funds are transferred directly from the purchaser to the seller. The seller transfers the time token directly from the time token contract to the wallet of the purchaser. Gitcoin does not take custody of the token or the funds and currently does not collect any fees for providing this technology. Sellers shall provide a description of the services that a purchaser may redeem the Seller’s time tokens for. Users agree to refrain from participating in any illegal activities in all applicable jurisdictions.
122122
</p>
123123
<h2 class="font-title">13. PAYMENT</h2>
124124
<p>

app/dashboard/templates/profiles/scorecard_ptoken.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{% trans "Token" %}
88
<div id="tooltip" class="float-right mt-2">
99
<i class='fa fa-info-circle' data-toggle="tooltip" data-html="true" data-delay="1000"
10-
data-placement="bottom" title="{% if ptoken %}These tokens represent one hour of @{{ profile.handle }}‘s time. Open a redemption quest to use one today!{% else %}Personal Tokens represent an hour of this users time. To learn more, please reference this <a href='{% url "ptokens_faq" %}'>resource</a>.{% endif %} ">
10+
data-placement="bottom" title="{% if ptoken %}These tokens represent one hour of @{{ profile.handle }}‘s time. Open a redemption quest to use one today!{% else %}Time Tokens represent an hour of this users time. To learn more, please reference this <a href='{% url "ptokens_faq" %}'>resource</a>.{% endif %} ">
1111
</i>
1212
</div>
1313
</div>
@@ -32,7 +32,7 @@
3232
<li id="ptoken-action" data-address="{{ ptoken.token_address }}" data-id="{{ ptoken.id }}">
3333
{% if is_my_profile %}
3434
{% if not ptoken %}
35-
<a class="btn btn-outline-gc-blue btn-sm flex-grow-1 font-smaller-5" href="{% url 'ptoken_quickstart' %}">CREATE A PERSONAL TOKEN</a>
35+
<a class="btn btn-outline-gc-blue btn-sm flex-grow-1 font-smaller-5" href="{% url 'ptoken_quickstart' %}">CREATE A TIME TOKEN</a>
3636
{% endif %}
3737
{% else %}
3838
{% comment %} Buy button: Disable it if user holds no tokens or is not in a valid region {% endcomment %}

app/dashboard/templates/profiles/tab_ptokens.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="tab-projects d-flex flex-column">
44

55
{% if buyed_ptokens.count == 0 %}
6-
No PTokens
6+
No Time Tokens
77
{% endif %}
88
{% for ptoken in buyed_ptokens %}
99
<div class="tab-projects__item d-flex mb-0 {% cycle 'odd' 'even' %} pt-1 pb-1">

app/dashboard/templates/profiles/tabs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
{% endif %}
6767
{% if is_staff and personal_tokens_count %}
6868
<button type="button" id="nav-description" href="{{profile.url}}/ptokens" class="text-center section-tab {% if tab == "ptokens" %} active {% endif %}">
69-
{% trans "PERSONAL TOKENS" %}
69+
{% trans "TIME TOKENS" %}
7070
{% if personal_tokens_count %}<span class="nav-badge">({{personal_tokens_count}})</span>{%endif%}
7171
</button>
7272
{% endif %}

app/grants/urls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
get_interrupted_contributions, get_replaced_tx, grant_activity, grant_categories, grant_details, grant_details_api,
2828
grant_details_contributions, grant_details_contributors, grant_edit, grant_fund, grant_new, grant_new_whitelabel,
2929
grants, grants_addr_as_json, grants_bulk_add, grants_by_grant_type, grants_cart_view, grants_info,
30-
grants_stats_view, invoice, leaderboard, manage_ethereum_cart_data, new_matching_partner, profile, quickstart,
31-
remove_grant_from_collection, save_collection, subscription_cancel, toggle_grant_favorite, verify_grant,
32-
ingest_contributions_view, ingest_contributions
30+
grants_stats_view, ingest_contributions, ingest_contributions_view, invoice, leaderboard, manage_ethereum_cart_data,
31+
new_matching_partner, profile, quickstart, remove_grant_from_collection, save_collection, subscription_cancel,
32+
toggle_grant_favorite, verify_grant,
3333
)
3434

3535
app_name = 'grants'

app/inbox/signals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def create_notification(sender, **kwargs):
156156
activity.profile.user,
157157
activity.profile.absolute_url,
158158
'create_ptoken',
159-
f'You <b>new personal token {activity.ptoken.token_symbol}</b> has been created!'
159+
f'You <b>new time token {activity.ptoken.token_symbol}</b> has been created!'
160160
)
161161

162162
if activity.activity_type == 'buy_ptoken':

app/ptokens/emails.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,20 @@
1919
from retail.emails import premailer_transform
2020

2121

22+
"""
23+
Note: "Time Tokens" used to be called "Personal Tokens". To simplify the renaming process,
24+
variables, classes, and contracts continue to use the old name, but user-facing text uses the
25+
new name. Personal tokens and Time tokens are the same thing, so you will likely see those two
26+
phrases used interchangeably throughout the codebase
27+
"""
28+
29+
2230
def render_ptoken_created(ptoken):
2331
params = {'ptoken': ptoken}
2432

2533
response_html = premailer_transform(render_to_string("emails/ptoken_created.html", params))
2634
response_txt = render_to_string("emails/ptoken_created.txt", params)
27-
subject = _("🎉 Your new personal token is ready 🎉")
35+
subject = _("🎉 Your new time token is ready 🎉")
2836

2937
return response_html, response_txt, subject
3038

app/ptokens/management/commands/update_ptoken_tx_status.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
class Command(BaseCommand):
32-
help = 'gets the tx status of PTokens'
32+
help = 'gets the tx status of Time Tokens'
3333

3434
def process_ptokens(self):
3535
non_terminal_states = ['pending', 'na', 'unknown']

app/ptokens/models.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454

5555
class PersonalTokenQuerySet(models.QuerySet):
56-
"""Handle the manager queryset for Personal Tokens."""
56+
"""Handle the manager queryset for Personal Tokens (now called Time Tokens)."""
5757

5858
def visible(self):
5959
"""Filter results down to visible tokens only."""
@@ -77,7 +77,14 @@ def keyword(self, keyword):
7777

7878

7979
class PersonalToken(SuperModel):
80-
"""Define the structure of a Personal Token"""
80+
"""
81+
Define the structure of a Time Token
82+
83+
Note: "Time Tokens" used to be called "Personal Tokens". To simplify the renaming process,
84+
variables, classes, and contracts continue to use the old name, but user-facing text uses the
85+
new name. Personal tokens and Time tokens are the same thing, so you will likely see those two
86+
phrases used interchangeably throughout the codebase
87+
"""
8188

8289
TOKEN_STATUS_CHOICES = [
8390
('open', 'open'),
@@ -247,7 +254,7 @@ def update_tx_status(self):
247254

248255

249256
class RedemptionToken(SuperModel):
250-
"""Define the structure of a Redemption PToken"""
257+
"""Define the structure of a Redemption Time token"""
251258

252259
REDEMPTION_STATUS_CHOICES = [
253260
('request', 'requested'),

0 commit comments

Comments
 (0)