add new patron tier for benefactor-cels

pull/143/head
Aevann 2023-05-03 18:29:31 +03:00
parent 756ac7dcd1
commit f5a97ae709
28 changed files with 70 additions and 70 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 694 KiB

After

Width:  |  Height:  |  Size: 694 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -26,10 +26,10 @@ class BadgeDef(Base):
@property @property
@lazy @lazy
def path(self): def path(self):
if self.id == 7 or 20 < self.id < 28 or self.id == 222: if self.id == 7 or 20 < self.id < 29 or self.id == 222:
return f"{SITE_FULL_IMAGES}/i/{SITE_NAME}/badges/{self.id}.webp?x=2" return f"{SITE_FULL_IMAGES}/i/{SITE_NAME}/badges/{self.id}.webp?x=7"
return f"{SITE_FULL_IMAGES}/i/badges/{self.id}.webp?x=2" return f"{SITE_FULL_IMAGES}/i/badges/{self.id}.webp?x=7"
class Badge(Base): class Badge(Base):
@ -55,7 +55,7 @@ class Badge(Base):
@property @property
@lazy @lazy
def until(self): def until(self):
if self.badge_id == 28 and self.user.agendaposter != 1: return self.user.agendaposter if self.badge_id == 58 and self.user.agendaposter != 1: return self.user.agendaposter
if self.badge_id == 170 and self.user.marsify != 1: return self.user.marsify if self.badge_id == 170 and self.user.marsify != 1: return self.user.marsify
if self.badge_id == 94: return self.user.progressivestack if self.badge_id == 94: return self.user.progressivestack

View File

@ -426,13 +426,13 @@ class User(Base):
@property @property
@lazy @lazy
def discount(self): def discount(self):
if self.patron == 1: discount = 0.90 if self.patron in {1,2}: discount = 0.90
elif self.patron == 2: discount = 0.85 elif self.patron == 3: discount = 0.85
elif self.patron == 3: discount = 0.80 elif self.patron == 4: discount = 0.80
elif self.patron == 4: discount = 0.75 elif self.patron == 5: discount = 0.75
elif self.patron == 5: discount = 0.70 elif self.patron == 6: discount = 0.70
elif self.patron == 6: discount = 0.65 elif self.patron == 7: discount = 0.65
elif self.patron == 7: discount = 0.60 elif self.patron == 8: discount = 0.60
else: discount = 1 else: discount = 1
owned_badges = [x.badge_id for x in self.badges] owned_badges = [x.badge_id for x in self.badges]
@ -987,19 +987,19 @@ class User(Base):
@property @property
@lazy @lazy
def patron_tooltip(self): def patron_tooltip(self):
if self.patron == 1:
return 'Contributes $5/month'
if self.patron == 2: if self.patron == 2:
return 'Contributes $10/month' return 'Contributes $5/month'
if self.patron == 3: if self.patron == 3:
return 'Contributes $20/month' return 'Contributes $10/month'
if self.patron == 4: if self.patron == 4:
return 'Contributes $50/month' return 'Contributes $20/month'
if self.patron == 5: if self.patron == 5:
return 'Contributes $100/month' return 'Contributes $50/month'
if self.patron == 6: if self.patron == 6:
return 'Contributes $200/month' return 'Contributes $100/month'
if self.patron == 7: if self.patron == 7:
return 'Contributes $200/month'
if self.patron == 8:
return 'Contributes $500/month' return 'Contributes $500/month'
return '' return ''

View File

@ -699,13 +699,13 @@ HOUSE_JOIN_COST = 500
HOUSE_SWITCH_COST = 2000 HOUSE_SWITCH_COST = 2000
TIERS_ID_TO_NAME = { TIERS_ID_TO_NAME = {
1: "Paypig", 2: "Paypig",
2: "Renthog", 3: "Renthog",
3: "Landchad", 4: "Landchad",
4: "Terminally online turboautist", 5: "Terminally online turboautist",
5: "Marsey's Sugar Daddy", 6: "Marsey's Sugar Daddy",
6: "JIDF Bankroller", 7: "JIDF Bankroller",
7: "Rich Bich", 8: "Rich Bich",
} }
BADGE_BLACKLIST = { # only grantable by admins higher than PERMS['IGNORE_BADGE_BLACKLIST'] BADGE_BLACKLIST = { # only grantable by admins higher than PERMS['IGNORE_BADGE_BLACKLIST']
@ -896,13 +896,13 @@ elif SITE == 'watchpeopledie.tv':
SIGNUP_FOLLOW_ID = CARP_ID SIGNUP_FOLLOW_ID = CARP_ID
TIERS_ID_TO_NAME = { TIERS_ID_TO_NAME = {
1: "Victim", 2: "Victim",
2: "Corpse", 3: "Corpse",
3: "Zombie", 4: "Zombie",
4: "Ghost", 5: "Ghost",
5: "Survivor", 6: "Survivor",
6: "Jigsaw", 7: "Jigsaw",
7: "P̵͇̕S̶̔̇Ȳ̴͙C̶͋͗H̵͒̉O̴̎̍ ", 8: "P̵͇̕S̶̔̇Ȳ̴͙C̶͋͗H̵͒̉O̴̎̍ ",
} }
elif SITE == 'devrama.net': elif SITE == 'devrama.net':
AEVANN_ID = 7 AEVANN_ID = 7
@ -1032,23 +1032,6 @@ def is_safe_url(url):
hosts = "|".join(approved_embed_hosts).replace('.','\.') hosts = "|".join(approved_embed_hosts).replace('.','\.')
tiers={
"(Paypig)": 1,
"(Renthog)": 2,
"(Landchad)": 3,
"(Terminally online turboautist)": 4,
"(Marsey's Sugar Daddy)": 5,
"(JIDF Bankroller)": 6,
"(Rich Bich)": 7,
"(LlamaBean)": 1,
"(Victim)": 1,
"(Corpse)": 2,
"(Zombie)": 3,
"(Ghost)": 4,
"(Survivor)": 5,
"(Jigsaw)": 6,
}
has_sidebar = path.exists(f'files/templates/sidebar_{SITE_NAME}.html') has_sidebar = path.exists(f'files/templates/sidebar_{SITE_NAME}.html')
has_logo = path.exists(f'files/assets/images/{SITE_NAME}/logo.webp') has_logo = path.exists(f'files/assets/images/{SITE_NAME}/logo.webp')

View File

@ -1099,7 +1099,7 @@ def agendaposter(id, v):
) )
g.db.add(ma) g.db.add(ma)
badge_grant(user=user, badge_id=28) badge_grant(user=user, badge_id=58)
if 'reason' in request.values: if 'reason' in request.values:
if request.values["reason"].startswith("/post/"): if request.values["reason"].startswith("/post/"):

View File

@ -335,7 +335,7 @@ def award_thing(v, thing_type, id):
author.agendaposter_phrase = note.lower() author.agendaposter_phrase = note.lower()
badge_grant(user=author, badge_id=28) badge_grant(user=author, badge_id=58)
elif kind == "flairlock": elif kind == "flairlock":
new_name = note[:100].replace("𒐪","").replace("","").strip() new_name = note[:100].replace("𒐪","").replace("","").strip()
if not new_name and author.flairchanged: if not new_name and author.flairchanged:

View File

@ -1322,18 +1322,18 @@ def bid_list(v:User, bid):
tiers={ tiers={
3: 1, 3: 2,
5: 1, 5: 2,
10: 2, 10: 3,
20: 3, 20: 4,
50: 4, 50: 5,
100: 5, 100: 6,
151: 5, 151: 6,
200: 6, 200: 7,
500: 7, 500: 8,
} }
marseybux_li = (0,2500,5000,10000,25000,50000,100000,250000) marseybux_li = (0,0,2500,5000,10000,25000,50000,100000,250000)
def claim_rewards(v): def claim_rewards(v):
transactions = g.db.query(Transaction).filter_by(email=v.email, claimed=None).all() transactions = g.db.query(Transaction).filter_by(email=v.email, claimed=None).all()

View File

@ -15,7 +15,9 @@
<td>{{loop.index}}</td> <td>{{loop.index}}</td>
<td>{% include "user_in_table.html" %}</td> <td>{% include "user_in_table.html" %}</td>
<td> <td>
<img class="contain" alt="2{{user.patron}}" loading="lazy" width=29.33 height=32 src="{{SITE_FULL_IMAGES}}/i/{{SITE_NAME}}/badges/2{{user.patron}}.webp?x=6"> {% if user.patron > 1 %}
<img class="contain" alt="2{{user.patron}}" loading="lazy" width=29.33 height=32 src="{{SITE_FULL_IMAGES}}/i/{{SITE_NAME}}/badges/2{{user.patron}}.webp?x=7">
{% endif %}
</td> </td>
<td>{{user.truescore}}</td> <td>{{user.truescore}}</td>
</tr> </tr>

View File

@ -158,8 +158,8 @@
{% if c.ghost %} {% if c.ghost %}
<span {% if c.distinguish_level %}class="mod {% if SITE_NAME == 'rDrama' %}mod-rdrama{% endif %}"{% endif %}>👻</span> <span {% if c.distinguish_level %}class="mod {% if SITE_NAME == 'rDrama' %}mod-rdrama{% endif %}"{% endif %}>👻</span>
{% else %} {% else %}
{% if FEATURES['PATRON_ICONS'] and c.author.patron %} {% if FEATURES['PATRON_ICONS'] and c.author.patron > 1 %}
<img loading="lazy" src="{{SITE_FULL_IMAGES}}/i/{{SITE_NAME}}/badges/2{{c.author.patron}}.webp?x=6" class="patron-img" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{c.author.patron_tooltip}}" alt="{{c.author.patron_tooltip}}"> <img loading="lazy" src="{{SITE_FULL_IMAGES}}/i/{{SITE_NAME}}/badges/2{{c.author.patron}}.webp?x=7" class="patron-img" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{c.author.patron_tooltip}}" alt="{{c.author.patron_tooltip}}">
{% endif %} {% endif %}
{% if FEATURES['HOUSES'] and c.author.house %} {% if FEATURES['HOUSES'] and c.author.house %}

View File

@ -31,8 +31,8 @@
</span> </span>
{% endif %} {% endif %}
{% if FEATURES['PATRON_ICONS'] and u.patron %} {% if FEATURES['PATRON_ICONS'] and u.patron > 1 %}
<img loading="lazy" src="{{SITE_FULL_IMAGES}}/i/{{SITE_NAME}}/badges/2{{u.patron}}.webp?x=6" class="ml-3 patron-img" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{u.patron_tooltip}}" alt="{{u.patron_tooltip}}"> <img loading="lazy" src="{{SITE_FULL_IMAGES}}/i/{{SITE_NAME}}/badges/2{{u.patron}}.webp?x=7" class="ml-3 patron-img" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{u.patron_tooltip}}" alt="{{u.patron_tooltip}}">
{% endif %} {% endif %}
{% if FEATURES['HOUSES'] and u.house %} {% if FEATURES['HOUSES'] and u.house %}
@ -293,8 +293,8 @@
</span> </span>
{% endif %} {% endif %}
{% if FEATURES['PATRON_ICONS'] and u.patron %} {% if FEATURES['PATRON_ICONS'] and u.patron > 1 %}
<img loading="lazy" src="{{SITE_FULL_IMAGES}}/i/{{SITE_NAME}}/badges/2{{u.patron}}.webp?x=6" class="ml-2 patron-img" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{u.patron_tooltip}}" alt="{{u.patron_tooltip}}"> <img loading="lazy" src="{{SITE_FULL_IMAGES}}/i/{{SITE_NAME}}/badges/2{{u.patron}}.webp?x=7" class="ml-2 patron-img" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{u.patron_tooltip}}" alt="{{u.patron_tooltip}}">
{% endif %} {% endif %}
{% if FEATURES['HOUSES'] and u.house %} {% if FEATURES['HOUSES'] and u.house %}

View File

@ -59,8 +59,8 @@
{% if p.ghost %} {% if p.ghost %}
<span {% if p.distinguish_level %}class="mod {% if SITE_NAME == 'rDrama' %}mod-rdrama{% endif %}"{% endif %}>👻</span> <span {% if p.distinguish_level %}class="mod {% if SITE_NAME == 'rDrama' %}mod-rdrama{% endif %}"{% endif %}>👻</span>
{% else %} {% else %}
{% if FEATURES['PATRON_ICONS'] and p.author.patron %} {% if FEATURES['PATRON_ICONS'] and p.author.patron > 1 %}
<img loading="lazy" src="{{SITE_FULL_IMAGES}}/i/{{SITE_NAME}}/badges/2{{p.author.patron}}.webp?x=6" class="patron-img" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{p.author.patron_tooltip}}" alt="{{p.author.patron_tooltip}}"> <img loading="lazy" src="{{SITE_FULL_IMAGES}}/i/{{SITE_NAME}}/badges/2{{p.author.patron}}.webp?x=7" class="patron-img" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{p.author.patron_tooltip}}" alt="{{p.author.patron_tooltip}}">
{% endif %} {% endif %}
{% if FEATURES['HOUSES'] and p.author.house %} {% if FEATURES['HOUSES'] and p.author.house %}

View File

@ -0,0 +1,15 @@
update badge_defs set name='Paypig', description='Contributes $5/month' where id=22;
update badge_defs set name='Renthog', description='Contributes $10/month' where id=23;
update badge_defs set name='Landchad', description='Contributes $20/month' where id=24;
update badge_defs set name='Terminally online turboautist', description='Contributes $50/month' where id=25;
update badge_defs set name='Marsey''s Sugar Daddy', description='Contributes $100/month' where id=26;
update badge_defs set name='JIDF Bankroller', description='Contributes $200/month' where id=27;
update badge_defs set name='Rich Bich', description='Contributes $500/month' where id=28;
INSERT INTO public.badge_defs VALUES (58, 'Chud', 'Marked as a chud', NULL);
update badges set badge_id=58 where badge_id=28;
update badges set badge_id=badge_id+1 where badge_id in (21,22,23,24,25,26,27);
delete from badge_defs where id=21;
update users set patron=patron+1 where id in (select user_id from badges where badge_id in (22,23,24,25,26,27,28));