add lifetimedonated_visible

master
Aevann 2023-08-03 07:57:09 +03:00
parent 52f9a99af1
commit 9a527df75d
5 changed files with 12 additions and 2 deletions

View File

@ -159,6 +159,7 @@ class User(Base):
rainbow = Column(Integer, default=0)
spider = Column(Integer, default=0)
lifetimedonated = Column(Integer, default=0)
lifetimedonated_visible = Column(Boolean, default=False)
blacklisted_by = Column(Integer, ForeignKey("users.id"))
if IS_FISTMAS():

View File

@ -164,6 +164,7 @@ def settings_personal_post(v):
updated = updated or update_flag("sigs_disabled", "sigs_disabled")
updated = updated or update_flag("over_18", "over_18")
updated = updated or update_flag("is_private", "private")
updated = updated or update_flag("lifetimedonated_visible", "lifetimedonated_visible")
if not updated and request.values.get("spider", v.spider) != v.spider and v.spider <= 1:
updated = True

View File

@ -247,6 +247,8 @@
{{common.text_area_section('profile-signature', '/settings/personal', 'sig', 'Signature', v.sig, 'Limit of 200 characters', 'Enter a signature...', true, false, 200)}}
{{common.toggle_section('Private Mode', 'privateswitch', 'private', v.is_private, 'This will hide your profile page from others.', false)}}
{{common.toggle_section('Lifetime donated visiblity', 'lifetimedonated_visible', 'lifetimedonated_visible', v.lifetimedonated_visible, 'Make the "lifetime donated" field in your profile visible to everyone instead of just you.', false)}}
{{common.toggle_section('Spider', 'spiderswitch', 'spider', v.spider, 'Have a spider friend accompany you during your journey on the site.', v.spider > 1)}}
{{common.toggle_section('Marsify', 'marsify', 'marsify', v.marsify, 'Automatically insert relevant marseys into your future comments.', v.marsify > 1)}}
</div>

View File

@ -233,7 +233,9 @@
<p id="profile--info--spent">Coins spent on awards: {{u.coins_spent}}</p>
<p id="profile--info--spent">Coins spent on hats: {{u.coins_spent_on_hats}}</p>
{% if v and (v.id == u.id or v.admin_level >= PERMS['VIEW_PATRONS']) %}
{% if u.lifetimedonated_visible %}
<p id="profile--info--lifetime-donated">Lifetime donated: ${{u.lifetimedonated}} (shown to everyone)</p>
{% elif v.id == u.id or v.admin_level >= PERMS['VIEW_PATRONS'] %}
<p id="profile--info--lifetime-donated">Lifetime donated: ${{u.lifetimedonated}} (shown to you only)</p>
{% endif %}
@ -511,7 +513,9 @@
<p id="profile-mobile--info--spent">Coins spent on awards: {{u.coins_spent}}</p>
<p id="profile-mobile--info--spent">Coins spent on hats: {{u.coins_spent_on_hats}}</p>
{% if v and (v.id == u.id or v.admin_level >= PERMS['VIEW_PATRONS']) %}
{% if u.lifetimedonated_visible %}
<p id="profile-mobile--info--lifetime-donated">Lifetime donated: ${{u.lifetimedonated}} (shown to everyone)</p>
{% elif v.id == u.id or v.admin_level >= PERMS['VIEW_PATRONS'] %}
<p id="profile-mobile--info--lifetime-donated">Lifetime donated: ${{u.lifetimedonated}} (shown to you only)</p>
{% endif %}

View File

@ -0,0 +1,2 @@
alter table users add column lifetimedonated_visible bool default false not null;
alter table users alter column lifetimedonated_visible drop default;