diff --git a/files/helpers/const.py b/files/helpers/const.py index cc1313f98d..f45237d898 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -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 diff --git a/files/helpers/jinja2.py b/files/helpers/jinja2.py index 49701af9f1..57c53cff7b 100644 --- a/files/helpers/jinja2.py +++ b/files/helpers/jinja2.py @@ -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} \ No newline at end of file + "LOTTERY_ENABLED": LOTTERY_ENABLED, + # Below this line really should be refactored as params to render_template + "USER_TITLE_COST": USER_TITLE_COST, + } \ No newline at end of file diff --git a/files/routes/settings.py b/files/routes/settings.py index 2dd3b81a40..97366189d8 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -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() diff --git a/files/routes/static.py b/files/routes/static.py index a1f6b2604e..4e2eb1a1e7 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -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) diff --git a/files/templates/settings_profile.html b/files/templates/settings_profile.html index 3aa75c7948..c804c496d8 100644 --- a/files/templates/settings_profile.html +++ b/files/templates/settings_profile.html @@ -470,11 +470,13 @@