WPD: Require flairs on all posts.

remotes/1693045480750635534/spooky-22
Snakes 2022-06-25 21:01:21 -04:00
parent 7b92db114a
commit e0c3c79902
4 changed files with 9 additions and 3 deletions

View File

@ -140,6 +140,7 @@ AGENDAPOSTER_MSG_HTML = """<p>Hi <a href="/id/{id}"><img loading="lazy" src="/pp
HOLE_NAME = 'hole'
HOLE_STYLE_FLAIR = False
HOLE_REQUIRED = False
HOLE_COST = 0
HOLE_CREATE_JL_MIN = 0
HOLE_INACTIVITY_DELETION = False
@ -287,6 +288,7 @@ elif SITE == 'cringetopia.org':
elif SITE == 'watchpeopledie.co':
HOLE_NAME = 'flair'
HOLE_STYLE_FLAIR = True
HOLE_REQUIRED = True
HOLE_CREATE_JL_MIN = 2
GIFT_NOTIF_ID = 13

View File

@ -55,6 +55,6 @@ def inject_constants():
"CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID,
"PIZZASHILL_ID":PIZZASHILL_ID, "DEFAULT_COLOR":DEFAULT_COLOR,
"COLORS":COLORS, "ADMIGGERS":ADMIGGERS, "datetime":datetime, "time":time,
"HOLE_NAME": HOLE_NAME, "HOLE_STYLE_FLAIR": HOLE_STYLE_FLAIR,
"HOLE_NAME": HOLE_NAME, "HOLE_STYLE_FLAIR": HOLE_STYLE_FLAIR, "HOLE_REQUIRED": HOLE_REQUIRED,
"LOTTERY_ENABLED": LOTTERY_ENABLED, "GUMROAD_LINK": GUMROAD_LINK,
"DEFAULT_THEME": DEFAULT_THEME, "DESCRIPTION": DESCRIPTION}

View File

@ -729,6 +729,9 @@ def submit_post(v, sub=None):
if v.exiled_from(sub): return error(f"You're exiled from /h/{sub}")
else: sub = None
if not sub and HOLE_REQUIRED:
return error(f"You must choose a {HOLE_NAME} for your post!")
if v.is_suspended: return error("You can't perform this action while banned.")
if v.agendaposter and not v.marseyawarded: title = torture_ap(title, v.username)

View File

@ -83,7 +83,8 @@
<label class='mt-4' for="title">{{HOLE_NAME|capitalize}}</label>
<div class="input-group mb2">
<input list="subs" autocomplete="off" id='sub' class="form-control" form="submitform" name="sub" oninput="savetext()" {% if sub %}value="{{sub.name}}"{% endif %} placeholder="Optional">
{%- set hole_placeholder = 'Required' if HOLE_REQUIRED else 'Optional' -%}
<input list="subs" autocomplete="off" id='sub' class="form-control" form="submitform" name="sub" oninput="savetext()" {% if sub %}value="{{sub.name}}"{% endif %} placeholder="{{hole_placeholder}}">
<datalist id="subs">
{% for s in SUBS %}
<option value="{{s}}"></option>
@ -92,7 +93,7 @@
</div>
{% if not SITE_NAME == 'WPD' -%}
{% if not HOLE_REQUIRED -%}
<div class="mt-1" style="font-size: min(3.5vw,14px)"><span style="color:#ffcccb ">WARNING</span>: Selecting a {{HOLE_NAME}} considerably reduces the number of people who will see your post. Don't select a {{HOLE_NAME}} unless that's what you want.</div>
{%- endif %}