forked from rDrama/rDrama
Merge branch 'frost' of https://github.com/Aevann1/Drama into frost
commit
f966262b97
|
@ -131,8 +131,11 @@ AGENDAPOSTER_MSG = """Hi @{username},\n\nYour {type} has been automatically remo
|
|||
PIN_LIMIT = 3
|
||||
POST_RATE_LIMIT = "1/second;2/minute;10/hour;50/day"
|
||||
|
||||
USER_TITLE_COST = 0
|
||||
|
||||
if SITE in {'rdrama.net','devrama.xyz'}:
|
||||
HOLE_COST = 200000
|
||||
USER_TITLE_COST = 25
|
||||
NOTIFICATIONS_ID = 1046
|
||||
AUTOJANNY_ID = 2360
|
||||
SNAPPY_ID = 261
|
||||
|
|
|
@ -55,4 +55,7 @@ def inject_constants():
|
|||
"CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID,
|
||||
"PIZZASHILL_ID":PIZZASHILL_ID, "config":app.config.get, "DEFAULT_COLOR":DEFAULT_COLOR,
|
||||
"COLORS":COLORS, "ADMIGGERS":ADMIGGERS, "datetime":datetime, "time":time,
|
||||
"LOTTERY_ENABLED": LOTTERY_ENABLED}
|
||||
"LOTTERY_ENABLED": LOTTERY_ENABLED,
|
||||
# Below this line really should be refactored as params to render_template
|
||||
"USER_TITLE_COST": USER_TITLE_COST,
|
||||
}
|
|
@ -917,6 +917,10 @@ def settings_title_change(v):
|
|||
|
||||
v.customtitle = filter_emojis_only(new_name)
|
||||
|
||||
if USER_TITLE_COST and v.coins < USER_TITLE_COST:
|
||||
return render_template("settings_profile.html", v=v, error=f"Changing flair costs {USER_TITLE_COST} DC.")
|
||||
v.coins -= USER_TITLE_COST
|
||||
|
||||
if len(v.customtitle) < 1000:
|
||||
g.db.add(v)
|
||||
g.db.commit()
|
||||
|
|
|
@ -329,8 +329,12 @@ def log(v):
|
|||
if kind not in types: kind = None
|
||||
|
||||
actions = g.db.query(ModAction)
|
||||
if not (v and v.admin_level > 1):
|
||||
actions = actions.filter(ModAction.kind.notin_(["shadowban","unshadowban","flair_post","edit_post"]))
|
||||
if not (v and v.admin_level >= 2):
|
||||
actions = actions.filter(ModAction.kind.notin_([
|
||||
"shadowban","unshadowban","flair_post","edit_post"]))
|
||||
if not (v and v.admin_level >= 3):
|
||||
actions = actions.filter(ModAction.kind.notin_([
|
||||
'ban_domain', 'unban_domain',]))
|
||||
|
||||
if admin_id:
|
||||
actions = actions.filter_by(user_id=admin_id)
|
||||
|
@ -345,7 +349,7 @@ def log(v):
|
|||
next_exists=len(actions)>25
|
||||
actions=actions[:25]
|
||||
|
||||
admins = [x[0] for x in g.db.query(User.username).filter(User.admin_level > 1).order_by(User.username).all()]
|
||||
admins = [x[0] for x in g.db.query(User.username).filter(User.admin_level >= 2).order_by(User.username).all()]
|
||||
|
||||
return render_template("log.html", v=v, admins=admins, types=types, admin=admin, type=kind, actions=actions, next_exists=next_exists, page=page)
|
||||
|
||||
|
|
|
@ -470,11 +470,13 @@
|
|||
|
||||
<form id="profile-settings" action="/settings/title_change" method="post">
|
||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||
<input maxlength=100 {% if v.flairchanged %}disabled{% endif %} autocomplete="off" id="customtitlebody" type="text" name="title" class="form-control" placeholder='Enter a flair here' value="{% if v.flairchanged %}Your flair has been locked until {{ti}}{% elif v.customtitleplain %}{{v.customtitleplain}}{% endif %}">
|
||||
<input maxlength=100 {% if v.flairchanged %}disabled{% endif %} autocomplete="off" id="customtitlebody" type="text" name="title" class="form-control" placeholder='Enter a flair here' value="{% if v.flairchanged %}Your flair has been locked until {{ti}}{% elif USER_TITLE_COST > v.coins %}Need {{USER_TITLE_COST}} DC to change flair!{% elif v.customtitleplain %}{{v.customtitleplain}}{% endif %}">
|
||||
<div class="d-flex mt-2">
|
||||
<a class="format" role="button"><i class="btn btn-secondary format d-inline-block m-0 fas fa-smile-beam" onclick="loadEmojis('customtitlebody')" aria-hidden="true" data-bs-toggle="modal" data-bs-target="#emojiModal" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Add Emoji"></i></a>
|
||||
|
||||
<small>Limit of 100 characters</small>
|
||||
<small>Limit of 100 characters
|
||||
{%- if USER_TITLE_COST %} — Costs {{USER_TITLE_COST}} DC to change.{% endif -%}
|
||||
</small>
|
||||
<input {% if v.flairchanged %}disabled{% endif %} autocomplete="off" class="btn btn-primary ml-auto" id="titleSave" type="submit" value="Change Flair">
|
||||
</div>
|
||||
</form>
|
||||
|
|
Loading…
Reference in New Issue