diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index 281516820..7d01351e5 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -506,6 +506,7 @@ FEATURES = { 'REPOST_DETECTION': True, 'PATRON_ICONS': False, 'ASSET_SUBMISSIONS': False, + 'NSFW_MARKING': True, } WERKZEUG_ERROR_DESCRIPTIONS = { @@ -795,6 +796,7 @@ elif SITE == 'watchpeopledie.tv': WELCOME_MSG = """Hi, you! Welcome to WatchPeopleDie.tv, this really cool site where you can go to watch people die. I'm @CLiTPEELER! If you have any questions about how things work here, or suggestions on how to make them work better than they already do, definitely slide on into my DMs (no fat chicks).\nThere's an enormously robust suite of fun features we have here and we're always looking for more to add. Way, way too many to go over in an automated welcome message. And you're probably here for the videos of people dying more than any sort of weird, paradoxical digital community aspect anyway, so I won't bore you with a tedious overview of them. Just head on over to [your settings page](https://watchpeopledie.tv/settings/profile) and have a look at some of the basic profile stuff, at least. You can change your profile picture, username, flair, colors, banners, bio, profile anthem (autoplaying song on your page, like it's MySpace or some shit, hell yeah), CSS, all sorts of things.\nOr you can just go back to the main feed and carry on with watching people die. That's what the site is for, after all. Have fun!\nAnyway, in closing, WPD is entirely open source. We don't really need new full-time coders or anything, but if you'd like to take a look at our repo - or even submit a PR to change, fix, or add some things - go right ahead! Our codebase lives at https://fsdfsd.net/rDrama/rDrama\nWell, that's all. Thanks again for signing up. It's an automated message and all, but I really do mean that. Thank you, specifically. I love you. Romantically. Deeply. Passionately.\nHave fun!""" FEATURES['PATRON_ICONS'] = True + FEATURES['NSFW_MARKING'] = False PERMS['HOLE_CREATE'] = 2 PERMS['POST_EDITING'] = 2 diff --git a/files/routes/comments.py b/files/routes/comments.py index b20d8ce8a..b1ca2066c 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -619,6 +619,7 @@ def handle_wordle_action(cid, v): @app.post("/toggle_comment_nsfw/") +@feature_required('NSFW_MARKING') @limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID) @auth_required def toggle_comment_nsfw(cid, v): diff --git a/files/routes/posts.py b/files/routes/posts.py index 43a9c7020..c4147db7f 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -858,6 +858,7 @@ def undelete_post_pid(pid, v): @app.post("/mark_post_nsfw/") +@feature_required('NSFW_MARKING') @limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID) @auth_required def mark_post_nsfw(pid, v): @@ -893,6 +894,7 @@ def mark_post_nsfw(pid, v): return {"message": "Post has been marked as +18!"} @app.post("/unmark_post_nsfw/") +@feature_required('NSFW_MARKING') @limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID) @auth_required def unmark_post_nsfw(pid, v): diff --git a/files/templates/comments.html b/files/templates/comments.html index b1e1108c3..c9ef84e11 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -460,7 +460,7 @@ {% endif %} -{% if (c.parent_submission or c.wall_user_id) and (c.author_id==v.id or v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or (c.post.sub and v.mods(c.post.sub))) %} +{% if FEATURES['NSFW_MARKING'] and (c.parent_submission or c.wall_user_id) and (c.author_id==v.id or v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or (c.post.sub and v.mods(c.post.sub))) %} {% endif %} @@ -598,7 +598,7 @@ {% endif %} {% endif %} - {% if c.author_id == v.id or (c.post.sub and v.mods(c.post.sub)) %} + {% if FEATURES['NSFW_MARKING'] and (c.author_id == v.id or (c.post.sub and v.mods(c.post.sub))) %} {% endif %} @@ -657,8 +657,10 @@ - - + {% if FEATURES['NSFW_MARKING'] %} + + + {% endif %} {% endif %} {% if v.admin_level >= PERMS['PROGSTACK'] %} diff --git a/files/templates/post_actions.html b/files/templates/post_actions.html index 76a8a7e1c..f48a1c2d9 100644 --- a/files/templates/post_actions.html +++ b/files/templates/post_actions.html @@ -78,7 +78,7 @@ {% endif %} {% endif %} - {% if v.id==p.author_id or v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or (p.sub and v.mods(p.sub)) %} + {% if FEATURES['NSFW_MARKING'] and (v.id==p.author_id or v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or (p.sub and v.mods(p.sub))) %} {% endif %} diff --git a/files/templates/post_actions_mobile.html b/files/templates/post_actions_mobile.html index 05ce0d9c4..b97fb50f2 100644 --- a/files/templates/post_actions_mobile.html +++ b/files/templates/post_actions_mobile.html @@ -52,7 +52,7 @@ {% endif %} {% endif %} -{% if v.id==p.author_id or (p.sub and v.mods(p.sub)) %} +{% if FEATURES['NSFW_MARKING'] and (v.id==p.author_id or (p.sub and v.mods(p.sub))) %} {% endif %} diff --git a/files/templates/post_admin_actions_mobile.html b/files/templates/post_admin_actions_mobile.html index 8f0d46034..4e5d6b3ab 100644 --- a/files/templates/post_admin_actions_mobile.html +++ b/files/templates/post_admin_actions_mobile.html @@ -32,7 +32,7 @@ {% endif %} - {% if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %} + {% if FEATURES['NSFW_MARKING'] and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %} {% endif %} diff --git a/files/templates/settings/advanced.html b/files/templates/settings/advanced.html index 227a7de15..01e15a02b 100644 --- a/files/templates/settings/advanced.html +++ b/files/templates/settings/advanced.html @@ -130,7 +130,9 @@
Content Filters
{{common.toggle_section('Disable Signatures', 'sigs_disabled', 'sigs_disabled', v.sigs_disabled, 'Hide user signatures.', false)}} - {{common.toggle_section('Disable +18 Warnings', 'over_18', 'over_18', v.over_18, "Disable the warnings that appear when viewing +18 content.", false)}} + {% if FEATURES['NSFW_MARKING'] %} + {{common.toggle_section('Disable +18 Warnings', 'over_18', 'over_18', v.over_18, "Disable the warnings that appear when viewing +18 content.", false)}} + {% endif %} {{common.toggle_section('Hide Posts Voted On', 'hidevotedon', 'hidevotedon', v.hidevotedon, 'Enable if you would like to automatically hide posts you have voted on from your frontpage.', false)}}
diff --git a/files/templates/submit.html b/files/templates/submit.html index 5863131c1..0ddc656e9 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -75,10 +75,12 @@
-
- - -
+ {% if FEATURES['NSFW_MARKING'] %} +
+ + +
+ {% endif %}