FEATURES: pronouns, kys, chat, house, /vote perm.

remotes/1693045480750635534/spooky-22
Snakes 2022-07-18 02:43:20 -04:00
parent 8f7d05d62d
commit 0c43deeee6
Signed by: Snakes
GPG Key ID: E745A82778055C7E
14 changed files with 55 additions and 30 deletions

View File

@ -133,15 +133,20 @@ AGENDAPOSTER_MSG_HTML = """<p>Hi <a href="/id/{id}"><img loading="lazy" src="/pp
PERMS = { # Minimum admin_level to perform action.
'HOLE_CREATE': 0,
'CONTENT_THREADS': 3,
'FLAGS_VISIBLE': 0,
'FLAGS_VISIBLE_REPORTER': 0,
'FLAGS_REMOVE': 2,
'CONTENT_THREADS': 3,
'VOTES_VISIBLE': 0,
}
FEATURES = {
'PROCOINS': True,
'CHAT': True,
'PINS': True,
'PRONOUNS': False,
'HOUSES': False,
'USERS_SUICIDE': True,
}
EMOJI_MARSEYS = True
@ -217,6 +222,9 @@ elif SITE == 'lgbdropthet.com':
GAMBLING_THREAD = 25
if SITE in {'rdrama.net', 'devrama.xyz', 'deuxrama.net'}:
FEATURES['PRONOUNS'] = True
FEATURES['HOUSES'] = True
HOLE_COST = 50000
HOLE_INACTIVITY_DELETION = True
@ -308,8 +316,11 @@ elif SITE == 'watchpeopledie.co':
elif SITE == 'lgbdropthet.com':
PERMS['HOLE_CREATE'] = 3
PERMS['FLAGS_VISIBLE_REPORTER'] = 2
PERMS['VOTES_VISIBLE'] = 2
FEATURES['PROCOINS'] = False
FEATURES['CHAT'] = False
FEATURES['USERS_SUICIDE'] = False
EMOJI_MARSEYS = False
EMOJI_SRCS = ['files/assets/emojis.lgbdropthet.json']
@ -330,7 +341,8 @@ elif SITE == 'lgbdropthet.com':
LOTTERY_ENABLED = False
else: # localhost or testing environment implied
pass
FEATURES['PRONOUNS'] = True
FEATURES['HOUSES'] = True
if SITE == 'deuxrama.net':
PERMS['HOLE_CREATE'] = 3

View File

@ -131,7 +131,7 @@ def stats(site=None):
"users online in the past 7 days": g.db.query(User).filter(User.last_active > week).count(),
}
if site == 'rDrama':
if site == 'rDrama' or FEATURES['HOUSES']:
stats2 = {
"House furry members": g.db.query(User).filter(User.house.like('Furry%')).count(),
"House femboy members": g.db.query(User).filter(User.house.like('Femboy%')).count(),

View File

@ -260,7 +260,7 @@ def settings_profile_post(v):
else: abort(400)
house = request.values.get("house")
if house and house in ("None","Furry","Femboy","Vampire","Racist"):
if house and house in ("None","Furry","Femboy","Vampire","Racist") and FEATURES['HOUSES']:
if v.house: cost = 2000
else: cost = 500
@ -877,6 +877,8 @@ def settings_title_change(v):
@limiter.limit("1/second;30/minute;200/hour;1000/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}')
@auth_required
def settings_pronouns_change(v):
if not FEATURES['PRONOUNS']:
abort(403)
pronouns = request.values.get("pronouns").replace("𒐪","").lower().strip()

View File

@ -376,6 +376,9 @@ def downvoting(v, username):
@limiter.limit("1/second;5/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}')
@auth_required
def suicide(v, username):
if not FEATURES['USERS_SUICIDE']:
abort(403)
user = get_user(username)
suicide = f"Hi there,\n\nA [concerned user](/id/{v.id}) reached out to us about you.\n\nWhen you're in the middle of something painful, it may feel like you don't have a lot of options. But whatever you're going through, you deserve help and there are people who are here for you.\n\nThere are resources available in your area that are free, confidential, and available 24/7:\n\n- Call, Text, or Chat with Canada's [Crisis Services Canada](https://www.crisisservicescanada.ca/en/)\n- Call, Email, or Visit the UK's [Samaritans](https://www.samaritans.org/)\n- Text CHAT to America's [Crisis Text Line](https://www.crisistextline.org/) at 741741.\nIf you don't see a resource in your area above, the moderators keep a comprehensive list of resources and hotlines for people organized by location. Find Someone Now\n\nIf you think you may be depressed or struggling in another way, don't ignore it or brush it aside. Take yourself and your feelings seriously, and reach out to someone.\n\nIt may not feel like it, but you have options. There are people available to listen to you, and ways to move forward.\n\nYour fellow users care about you and there are people who want to help."
if not v.shadowbanned:

View File

@ -6,7 +6,7 @@ from flask import *
from files.__main__ import app, limiter, cache
@app.get("/votes/<link>")
@auth_required
@admin_level_required(PERMS['VOTES_VISIBLE'])
def vote_info_get(v, link):
try:
if "t2_" in link: thing = get_post(int(link.split("t2_")[1]), v=v)
@ -199,4 +199,4 @@ def api_vote_comment(comment_id, new, v):
comment.realupvotes = g.db.query(CommentVote).filter_by(comment_id=comment.id, real=True).count()
if comment.author.progressivestack: comment.realupvotes *= 2
g.db.add(comment)
return "", 204
return "", 204

View File

@ -192,7 +192,7 @@
{% if c.ghost %}
<span {% if c.distinguish_level %}class="mod"{% endif %}>👻</span>
{% else %}
{% if SITE_NAME=='rDrama' and c.author.house %}
{% if FEATURES['HOUSES'] and c.author.house %}
<img loading="lazy" src="/i/{{SITE_NAME}}/houses/{{c.author.house}}.webp?v=2000" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" title="House {{c.author.house}}" alt="House {{c.author.house}}">
{% endif %}
@ -206,7 +206,7 @@
{% endif %}
<span {% if c.author.patron and not c.distinguish_level %}class="patron" style="background-color:#{{c.author.namecolor}};"{% elif c.distinguish_level %}class="mod"{% endif %}>{{c.author_name}}</span>
</a>
{% if SITE_NAME == 'rDrama' %}
{% if FEATURES['PRONOUNS'] %}
<span class="pronouns" style="color:#{{c.author.titlecolor}};border-color:#{{c.author.titlecolor}}">{{c.author.pronouns}}</span>
{% endif %}
{% if c.author.customtitle %}
@ -437,7 +437,7 @@
{% endif %}
{% if not c.ghost or v.id == AEVANN_ID %}<a href="/votes/{{c.fullname}}" class="btn caction nobackground px-1 text-muted"><i class="fas fa-arrows-v"></i>Votes</a>{% endif %}
{% if v and ((not c.ghost and v.admin_level >= PERMS['VOTES_VISIBLE']) or v.id == AEVANN_ID) %}<a href="/votes/{{c.fullname}}" class="btn caction nobackground px-1 text-muted"><i class="fas fa-arrows-v"></i>Votes</a>{% endif %}
<a class="btn caction nobackground px-1 text-muted" href="{{c.permalink}}"><i class="fas fa-book-open"></i>Context</a>
@ -644,7 +644,7 @@
<div class="modal-body">
<ul class="list-group comment-actions">
{% if not c.ghost or v.id == AEVANN_ID %}<a href="/votes/{{c.fullname}}"><li class="list-group-item"><i class="fas fa-arrows-v mr-2"></i>Votes</li></a>{% endif %}
{% if v and ((not c.ghost and v.admin_level >= PERMS['VOTES_VISIBLE']) or v.id == AEVANN_ID) %}<a href="/votes/{{c.fullname}}"><li class="list-group-item"><i class="fas fa-arrows-v mr-2"></i>Votes</li></a>{% endif %}
<a class="list-group-item" href="{{c.permalink}}"><i class="fas fa-book-open mr-2"></i>Context</a>

View File

@ -168,9 +168,11 @@
<a class="nav-link" href="{% if sub %}/h/{{sub.name}}{% endif %}/submit" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Create Post"><i class="fas fa-feather-alt"></i></a>
</li>
{% if FEATURES['CHAT'] -%}
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
<a class="nav-link" href="/chat/" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Chat"><i class="fas fa-messages"></i></a>
</li>
{%- endif %}
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
<a class="nav-link" href="/leaderboard" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Leaderboard"><i class="fas fa-trophy"></i></a>

View File

@ -47,6 +47,7 @@
</a>
</button>
{% if v %}
{% if FEATURES['CHAT'] -%}
<button class="col px-0 btn btn-dead m-0" style="background: None !important; border: None;">
<a href="/chat" class="text-decoration-none" role="button">
<div class="text-center {% if request.path=='/chat' %}text-primary{% else %}text-muted{% endif %}">
@ -55,6 +56,7 @@
</div>
</a>
</button>
{%- endif %}
<button class="col px-0 mr-3 btn btn-dead m-0" style="background: None !important; border: None;">
<a href="/shop" class="text-decoration-none" role="button">
<div class="text-center {% if request.path=='/shop' %}text-primary{% else %}text-muted{% endif %}">

View File

@ -6,7 +6,7 @@
{% endif %}
{% if not p.ghost or v.id == AEVANN_ID %}<a class="list-inline-item" href="/votes/{{p.fullname}}"><i class="fas fa-arrows-v"></i>Votes</a>{% endif %}
{% if v and ((not p.ghost and v.admin_level >= PERMS['VOTES_VISIBLE']) or v.id == AEVANN_ID) %}<a class="list-inline-item" href="/votes/{{p.fullname}}"><i class="fas fa-arrows-v"></i>Votes</a>{% endif %}
{% if v %}
<a class="list-inline-item text-muted d-none d-md-inline-block" role="button" data-bs-toggle="modal" data-bs-target="#awardModal" data-url='/award/post/{{p.id}}'><i class="fas fa-gift fa-fw"></i>Give Award</a>

View File

@ -6,7 +6,7 @@
{% endif %}
{% if not p.ghost or v.id == AEVANN_ID %}<a class="btn-block" href="/votes/{{p.fullname}}"><button class="nobackground btn btn-link btn-block btn-lg text-left text-muted"><i class="fas fa-arrows-v text-center text-muted mr-3"></i>Votes</button></a>{% endif %}
{% if v and ((not p.ghost and v.admin_level >= PERMS['VOTES_VISIBLE']) or v.id == AEVANN_ID) %}<a class="btn-block" href="/votes/{{p.fullname}}"><button class="nobackground btn btn-link btn-block btn-lg text-left text-muted"><i class="fas fa-arrows-v text-center text-muted mr-3"></i>Votes</button></a>{% endif %}
<button data-bs-dismiss="modal" class="copy-link nobackground btn btn-link btn-block btn-lg text-left text-muted" data-clipboard-text="{% if SITE == 'rdrama.net' %}https://rdrama.co{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}"><i class="far fa-copy text-center text-muted mr-3"></i>Copy link</button>

View File

@ -24,7 +24,7 @@
<div class="settings">
{% if SITE_NAME == 'rDrama' %}
{% if FEATURES['HOUSES'] %}
<h2 class="h5" name="referral">House</h2>
<div class="settings-section rounded">
@ -458,7 +458,7 @@
</div>
</div>
{% if SITE_NAME == 'rDrama' %}
{% if FEATURES['PRONOUNS'] %}
<div class="body d-lg-flex border-bottom">
<label class="text-black w-lg-25">Pronouns</label>

View File

@ -663,7 +663,7 @@
{% if p.ghost %}
<span {% if p.distinguish_level %}class="mod"{% endif %}>👻</span>
{% else %}
{% if SITE_NAME=='rDrama' and p.author.house %}
{% if FEATURES['HOUSES'] and p.author.house %}
<img loading="lazy" src="/i/{{SITE_NAME}}/houses/{{p.author.house}}.webp?v=2000" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" title="House {{p.author.house}}" alt="House {{p.author.house}}">
{% endif %}
@ -676,7 +676,7 @@
{% endif %}
<span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.namecolor}};"{% elif p.distinguish_level %}class="mod"{% endif %}>{{p.author_name}}</span>
</a>
{% if SITE_NAME == 'rDrama' %}
{% if FEATURES['PRONOUNS'] %}
<span class="pronouns" style="color:#{{p.author.titlecolor}};border-color:#{{p.author.titlecolor}}">{{p.author.pronouns}}</span>
{% endif %}
{% if p.author.customtitle %}

View File

@ -194,7 +194,7 @@
{% if p.ghost %}
<span {% if p.distinguish_level %}class="mod"{% endif %}>👻</span>
{% else %}
{% if SITE_NAME=='rDrama' and p.author.house %}
{% if FEATURES['HOUSES'] and p.author.house %}
<img loading="lazy" src="/i/{{SITE_NAME}}/houses/{{p.author.house}}.webp?v=2000" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" title="House {{p.author.house}}" alt="House {{p.author.house}}">
{% endif %}
@ -207,7 +207,7 @@
{% endif %}
<span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.namecolor}};"{% elif p.distinguish_level %}class="mod"{% endif %}>{{p.author_name}}</span>
</a>
{% if SITE_NAME == 'rDrama' %}
{% if FEATURES['PRONOUNS'] %}
<span class="pronouns" style="color:#{{p.author.titlecolor}};border-color:#{{p.author.titlecolor}}">{{p.author.pronouns}}</span>
{% endif %}
{% if p.author.customtitle %}

View File

@ -64,7 +64,7 @@
</span>
{% endif %}
{% if SITE_NAME=='rDrama' and u.house %}
{% if FEATURES['HOUSES'] and u.house %}
<img loading="lazy" class="ml-3" id="profile--house" src="/i/{{SITE_NAME}}/houses/{{u.house}}.webp?v=2000" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" title="House {{u.house}}" alt="House {{u.house}}">
{% endif %}
@ -105,7 +105,7 @@
</div>
</div>
{% if SITE_NAME == 'rDrama' %}
{% if FEATURES['PRONOUNS'] %}
<p class="font-weight-bolder" id="profile--pronouns" style="color: #{{u.titlecolor}}">{{u.pronouns}}</p>
{% endif %}
@ -187,11 +187,13 @@
<a id="button-sub" class="btn btn-primary {% if is_following or u.is_nofollow or u.is_blocked %}d-none{% endif %}" role="button" onclick="post_toast(this,'/follow/{{u.username}}','button-unsub','button-sub','d-none')">Follow</a>
<a class="btn btn-primary" role="button" onclick="toggleElement('message', 'input-message')">Message</a>
<a class="btn btn-primary" role="button" onclick="post_toast(this,'/@{{u.username}}/suicide')">Get them help</a>
<a class="btn btn-primary" role="button" onclick="toggleElement('coin-transfer', 'coin-transfer-amount')">Gift coins</a>
{% if FEATURES['PROCOINS'] %}
{% if FEATURES['USERS_SUICIDE'] -%}
<a class="btn btn-primary" role="button" onclick="post_toast(this,'/@{{u.username}}/suicide')">Get Them Help</a>
{%- endif %}
<a class="btn btn-primary" role="button" onclick="toggleElement('coin-transfer', 'coin-transfer-amount')">Gift Coins</a>
{% if FEATURES['PROCOINS'] -%}
<a class="btn btn-primary" role="button" onclick="toggleElement('bux-transfer', 'bux-transfer-amount')">Gift Marseybux</a>
{% endif %}
{%- endif %}
<a class="btn btn-primary" role="button" onclick="post_toast(this,'/settings/block?username={{u.username}}',true)">Block</a>
@ -399,7 +401,7 @@
</span>
{% endif %}
{% if SITE_NAME=='rDrama' and u.house %}
{% if FEATURES['HOUSES'] and u.house %}
<img loading="lazy" class="ml-2" id="profile-mobile--house" src="/i/{{SITE_NAME}}/houses/{{u.house}}.webp?v=2000" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" title="House {{u.house}}" alt="House {{u.house}}">
{% endif %}
@ -416,7 +418,7 @@
<span class="followsyou badge badge-secondary text-small align-middle mx-1" id="profile-mobile--follows-you">Follows you</span>
{% endif %}
{% if SITE_NAME == 'rDrama' %}
{% if FEATURES['PRONOUNS'] %}
<p style="color: #{{u.titlecolor}}" id="profile-mobile--pronouns">{{u.pronouns}}</p>
{% endif %}
@ -511,11 +513,13 @@
<a id="button-sub2" class="btn btn-primary {% if is_following or u.is_nofollow or u.is_blocked %}d-none{% endif %}" role="button" onclick="post_toast(this,'/follow/{{u.username}}','button-unsub2','button-sub2','d-none')">Follow</a>
<a class="btn btn-primary" role="button" onclick="toggleElement('message-mobile', 'input-message-mobile')">Message</a>
<a class="btn btn-primary" role="button" onclick="post_toast(this,'/@{{u.username}}/suicide')">Get them help</a>
<a class="btn btn-primary" role="button" onclick="toggleElement('coin-transfer-mobile', 'coin-transfer-amount-mobile')">Gift coins</a>
{% if FEATURES['PROCOINS'] %}
{% if FEATURES['USERS_SUICIDE'] -%}
<a class="btn btn-primary" role="button" onclick="post_toast(this,'/@{{u.username}}/suicide')">Get Them Help</a>
{%- endif %}
<a class="btn btn-primary" role="button" onclick="toggleElement('coin-transfer-mobile', 'coin-transfer-amount-mobile')">Gift Coins</a>
{% if FEATURES['PROCOINS'] -%}
<a class="btn btn-primary" role="button" onclick="toggleElement('bux-transfer-mobile', 'bux-transfer-amount-mobile')">Gift Marseybux</a>
{% endif %}
{%- endif %}
<a class="btn btn-primary" role="button" onclick="post_toast(this,'/settings/block?username={{u.username}}',true)">Block</a>