diff --git a/files/classes/user.py b/files/classes/user.py index 78ea745c9..6da89d660 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -1002,21 +1002,9 @@ class User(Base): @property @lazy def patron_tooltip(self): - if self.patron == 2: - return 'Contributes $5/month' - if self.patron == 3: - return 'Contributes $10/month' - if self.patron == 4: - return 'Contributes $20/month' - if self.patron == 5: - return 'Contributes $50/month' - if self.patron == 6: - return 'Contributes $100/month' - if self.patron == 7: - return 'Contributes $200/month' - if self.patron == 8: - return 'Contributes $500/month' - return '' + tier_name = TIER_TO_NAME(self.patron) + tier_money = TIER_TO_MONEY(self.patron) + return f'{tier_name} - Donates at least ${tier_money}/month' @classmethod def can_see_content(cls, user:Optional["User"], other:Union[Submission, Comment, Sub]) -> bool: diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index 6b5fb084f..2ffea9b6b 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -700,7 +700,7 @@ LEADERBOARD_LIMIT = PAGE_SIZE HOUSE_JOIN_COST = 500 HOUSE_SWITCH_COST = 2000 -TIERS_ID_TO_NAME = { +TIER_TO_NAME = { 2: "Paypig", 3: "Renthog", 4: "Landchad", @@ -710,6 +710,26 @@ TIERS_ID_TO_NAME = { 8: "Rich Bich", } +TIER_TO_MONEY = { + 2: 5, + 3: 10, + 4: 20, + 5: 50, + 6: 100, + 7: 200, + 8: 500, +} + +TIER_TO_MBUX = { + 2: 2500, + 3: 5000, + 4: 10000, + 5: 25000, + 6: 50000, + 7: 100000, + 8: 250000, +} + BADGE_BLACKLIST = { # only grantable by admins higher than PERMS['IGNORE_BADGE_BLACKLIST'] 1, 2, 6, 10, 11, 12, # Alpha, Verified Email, Beta, Recruiter x3 16, 17, 143, 21, 22, 23, 24, 25, 26, 27, # Marsey Artist x3 / Patron Tiers @@ -899,7 +919,7 @@ elif SITE == 'watchpeopledie.tv': GIFT_NOTIF_ID = CARP_ID SIGNUP_FOLLOW_ID = CARP_ID - TIERS_ID_TO_NAME = { + TIER_TO_NAME = { 2: "Victim", 3: "Corpse", 4: "Zombie", diff --git a/files/routes/jinja2.py b/files/routes/jinja2.py index 141524aec..44815dfaa 100644 --- a/files/routes/jinja2.py +++ b/files/routes/jinja2.py @@ -143,7 +143,7 @@ def inject_constants(): "DONATE_LINK":DONATE_LINK, "DONATE_SERVICE":DONATE_SERVICE, "HOUSE_JOIN_COST":HOUSE_JOIN_COST, "HOUSE_SWITCH_COST":HOUSE_SWITCH_COST, "IMAGE_FORMATS":','.join(IMAGE_FORMATS), "PAGE_SIZES":PAGE_SIZES, "THEMES":THEMES, "COMMENT_SORTS":COMMENT_SORTS, "SORTS":SORTS, - "TIME_FILTERS":TIME_FILTERS, "HOUSES":HOUSES, "TIERS_ID_TO_NAME":TIERS_ID_TO_NAME, + "TIME_FILTERS":TIME_FILTERS, "HOUSES":HOUSES, "TIER_TO_NAME":TIER_TO_NAME, "DEFAULT_CONFIG_VALUE":DEFAULT_CONFIG_VALUE, "IS_LOCALHOST":IS_LOCALHOST, "BACKGROUND_CATEGORIES":BACKGROUND_CATEGORIES, "PAGE_SIZE":PAGE_SIZE, "TAGLINES":TAGLINES, "get_alt_graph":get_alt_graph, "current_registered_users":current_registered_users, "git_head":git_head, "max_days":max_days, "EMOJI_KINDS":EMOJI_KINDS, "BIO_FRIENDS_ENEMIES_LENGTH_LIMIT":BIO_FRIENDS_ENEMIES_LENGTH_LIMIT, diff --git a/files/routes/users.py b/files/routes/users.py index 2de592620..b25a132aa 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -1318,18 +1318,6 @@ def bid_list(v:User, bid): -tiers={ - 5: 2, - 10: 3, - 20: 4, - 50: 5, - 100: 6, - 200: 7, - 500: 8, - } - -marseybux_li = (0,0,2500,5000,10000,25000,50000,100000,250000) - def claim_rewards(v): transactions = g.db.query(Transaction).filter_by(email=v.email, claimed=None).all() @@ -1337,11 +1325,11 @@ def claim_rewards(v): marseybux = 0 for transaction in transactions: - for money, t in tiers.items(): + for t, money in TIER_TO_MONEY.items(): if transaction.amount < money: break tier = t - marseybux += marseybux_li[tier] + marseybux += TIER_TO_MARSEYBUX[tier] if tier > highest_tier: highest_tier = tier transaction.claimed = True diff --git a/files/templates/settings/personal.html b/files/templates/settings/personal.html index 3287e0025..a2df05079 100644 --- a/files/templates/settings/personal.html +++ b/files/templates/settings/personal.html @@ -15,7 +15,7 @@
-

You're a {{TIERS_ID_TO_NAME[v.patron] if v.patron else "freeloader"}}!

{% if v.patron %} Thanks ily! <3{% endif %} +

You're a {{TIER_TO_NAME[v.patron] if v.patron else "freeloader"}}!

{% if v.patron %} Thanks ily! <3{% endif %} {% if not v.patron and v.truescore >= TRUESCORE_DONATE_MINIMUM %}

To stop freeloading, first verify your email, support us on {{DONATE_SERVICE}} with the same email, and click "Claim {{patron}} Rewards"

{% elif not v.patron %}