diff --git a/files/assets/js/submit_emojis.js b/files/assets/js/submit_emojis.js index f02adbf8d..0a3a5e444 100644 --- a/files/assets/js/submit_emojis.js +++ b/files/assets/js/submit_emojis.js @@ -5,7 +5,7 @@ function approve_emoji(t, name) { "tags": document.getElementById(`${name}-tags`).value, "name": document.getElementById(`${name}-name`).value, "kind": document.getElementById(`${name}-kind`).value, - "over_18": document.getElementById(`${name}-nsfw`).checked, + "nsfw": document.getElementById(`${name}-nsfw`).checked, }, () => { document.getElementById(`${name}-emoji`).remove() diff --git a/files/classes/comment.py b/files/classes/comment.py index 12bfe43c9..e808ea390 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -174,7 +174,7 @@ class Comment(Base): level = Column(Integer, default=1) parent_comment_id = Column(Integer, ForeignKey("comments.id")) top_comment_id = Column(Integer) - over_18 = Column(Boolean, default=False) + nsfw = Column(Boolean, default=False) is_bot = Column(Boolean, default=False) stickied = Column(String) stickied_utc = Column(Integer) @@ -322,7 +322,7 @@ class Comment(Base): @lazy def emoji_award_emojis(self, v, OVER_18_EMOJIS): - if g.show_over_18: + if g.show_nsfw: return [x.note for x in self.awards if x.kind == "emoji"][:4] return [x.note for x in self.awards if x.kind == "emoji" and x.note not in OVER_18_EMOJIS][:4] @@ -361,7 +361,7 @@ class Comment(Base): 'edited_utc': self.edited_utc or 0, 'is_banned': bool(self.is_banned), 'deleted_utc': self.deleted_utc, - 'is_nsfw': self.over_18, + 'is_nsfw': self.nsfw, 'permalink': f'/comment/{self.id}#context', 'stickied': self.stickied, 'distinguish_level': self.distinguish_level, @@ -435,7 +435,7 @@ class Comment(Base): if comment_info: return False - if self.over_18 and not (any(path.startswith(x) for x in ('/post/','/comment/','/h/')) and self.post.over_18) and not g.show_over_18: + if self.nsfw and not (any(path.startswith(x) for x in ('/post/','/comment/','/h/')) and self.post.nsfw) and not g.show_nsfw: return True if self.is_banned: return True diff --git a/files/classes/emoji.py b/files/classes/emoji.py index cf3939711..a34d773df 100644 --- a/files/classes/emoji.py +++ b/files/classes/emoji.py @@ -15,7 +15,7 @@ class Emoji(Base): count = Column(Integer, default=0) submitter_id = Column(Integer, ForeignKey("users.id")) created_utc = Column(Integer) - over_18 = Column(Boolean, default=False) + nsfw = Column(Boolean, default=False) def __init__(self, *args, **kwargs): if "created_utc" not in kwargs: kwargs["created_utc"] = int(time.time()) diff --git a/files/classes/post.py b/files/classes/post.py index 009a23ced..bfd857957 100644 --- a/files/classes/post.py +++ b/files/classes/post.py @@ -45,7 +45,7 @@ class Post(Base): private = Column(Boolean, default=False) comment_count = Column(Integer, default=0) is_approved = Column(Integer, ForeignKey("users.id")) - over_18 = Column(Boolean, default=False) + nsfw = Column(Boolean, default=False) is_bot = Column(Boolean, default=False) upvotes = Column(Integer, default=1) downvotes = Column(Integer, default=0) @@ -168,7 +168,7 @@ class Post(Base): @property @lazy def thumb_url(self): - if self.over_18: + if self.nsfw: return f"{SITE_FULL_IMAGES}/i/nsfw.webp?x=6" elif not self.url: return f"{SITE_FULL_IMAGES}/i/{SITE_NAME}/default_text.webp?x=6" @@ -225,7 +225,7 @@ class Post(Base): 'created_utc': self.created_utc, 'id': self.id, 'title': self.title, - 'is_nsfw': self.over_18, + 'is_nsfw': self.nsfw, 'is_bot': self.is_bot, 'thumb_url': self.thumb_url, 'domain': self.domain, @@ -265,7 +265,7 @@ class Post(Base): @lazy def emoji_award_emojis(self, v, OVER_18_EMOJIS): - if g.show_over_18: + if g.show_nsfw: return [x.note for x in self.awards if x.kind == "emoji"][:4] return [x.note for x in self.awards if x.kind == "emoji" and x.note not in OVER_18_EMOJIS][:4] diff --git a/files/classes/user.py b/files/classes/user.py index 27098c7b5..5818e3c8c 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -284,8 +284,8 @@ class User(Base): @property @lazy - def over_18(self): - return bool(session.get('over_18')) + def nsfw(self): + return bool(session.get('nsfw')) @property @lazy diff --git a/files/helpers/actions.py b/files/helpers/actions.py index 525c490fa..1bcc2ac2b 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -214,7 +214,7 @@ def execute_snappy(post, v): distinguish_level=6, parent_post=post.id, level=1, - over_18=False, + nsfw=False, is_bot=True, app_id=None, body=body, diff --git a/files/helpers/const_stateful.py b/files/helpers/const_stateful.py index fe6061f00..e73d0f1eb 100644 --- a/files/helpers/const_stateful.py +++ b/files/helpers/const_stateful.py @@ -19,9 +19,9 @@ def const_initialize(): db = db_session() - MARSEYS_CONST = [x[0] for x in db.query(Emoji.name).filter(Emoji.kind == "Marsey", Emoji.submitter_id == None, Emoji.name != 'chudsey', Emoji.over_18 == False)] + MARSEYS_CONST = [x[0] for x in db.query(Emoji.name).filter(Emoji.kind == "Marsey", Emoji.submitter_id == None, Emoji.name != 'chudsey', Emoji.nsfw == False)] MARSEYS_CONST2 = MARSEYS_CONST + ['chudsey','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','exclamationpoint','period','questionmark'] - marseys = db.query(Emoji).filter(Emoji.kind=="Marsey", Emoji.submitter_id == None, Emoji.over_18 == False).all() + marseys = db.query(Emoji).filter(Emoji.kind=="Marsey", Emoji.submitter_id == None, Emoji.nsfw == False).all() for marsey in marseys: for tag in marsey.tags.split(): if tag in MARSEY_MAPPINGS: @@ -29,12 +29,12 @@ def const_initialize(): else: MARSEY_MAPPINGS[tag] = [marsey.name] - SNAPPY_KONGS = db.query(Emoji.name).filter(Emoji.kind=="Donkey Kong", Emoji.submitter_id==None, Emoji.over_18 == False).all() + SNAPPY_KONGS = db.query(Emoji.name).filter(Emoji.kind=="Donkey Kong", Emoji.submitter_id==None, Emoji.nsfw == False).all() SNAPPY_KONGS = [f':#{x[0]}:' for x in SNAPPY_KONGS] STEALTH_HOLES = [x[0] for x in db.query(Sub.name).filter_by(stealth=True)] - OVER_18_EMOJIS = [x[0] for x in db.query(Emoji.name).filter_by(over_18=True)] + OVER_18_EMOJIS = [x[0] for x in db.query(Emoji.name).filter_by(nsfw=True)] db.commit() db.close() diff --git a/files/helpers/cron.py b/files/helpers/cron.py index 6d691dba1..41651fa5b 100644 --- a/files/helpers/cron.py +++ b/files/helpers/cron.py @@ -160,7 +160,7 @@ def _create_post(title, body, pin_hours): private=False, notify=True, author_id=AUTOJANNY_ID, - over_18=False, + nsfw=False, new=False, app_id=None, is_bot=False, diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index ce83cd83a..96acee010 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -267,7 +267,7 @@ def find_all_emote_endings(emoji): elif kind == 'Marseyalphabet': kind = 'Marsey Alphabet' if kind in EMOJI_KINDS: - emoji = g.db.query(Emoji.name).filter_by(kind=kind, over_18=False).order_by(func.random()).first()[0] + emoji = g.db.query(Emoji.name).filter_by(kind=kind, nsfw=False).order_by(func.random()).first()[0] return endings, emoji @@ -566,7 +566,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis if obj: for emoji in emojis_used: if emoji in OVER_18_EMOJIS: - obj.over_18 = True + obj.nsfw = True break sanitized = sanitized.replace('

', '') @@ -731,7 +731,7 @@ def filter_emojis_only(title, golden=True, count_emojis=False, obj=None): if obj: for emoji in emojis_used: if emoji in OVER_18_EMOJIS: - obj.over_18 = True + obj.nsfw = True break title = strikethrough_regex.sub(r'\1\2', title) diff --git a/files/routes/asset_submissions.py b/files/routes/asset_submissions.py index df283c3ba..d09f3e006 100644 --- a/files/routes/asset_submissions.py +++ b/files/routes/asset_submissions.py @@ -48,7 +48,7 @@ def submit_emoji(v): tags = request.values.get('tags', '').lower().strip() username = request.values.get('author', '').lower().strip() kind = request.values.get('kind', '').strip() - over_18 = bool(request.values.get("over_18")) + nsfw = bool(request.values.get("nsfw")) for modifier in emoji_modifiers: if name.endswith(modifier): @@ -99,7 +99,7 @@ def submit_emoji(v): tags=tags, count=0, submitter_id=v.id, - over_18=over_18, + nsfw=nsfw, ) g.db.add(emoji) @@ -148,12 +148,12 @@ def approve_emoji(v, name): if new_kind not in EMOJI_KINDS: abort(400, "Invalid kind!") - over_18 = request.values.get("over_18") == 'true' + nsfw = request.values.get("nsfw") == 'true' emoji.name = new_name emoji.kind = new_kind emoji.tags = tags - emoji.over_18 = over_18 + emoji.nsfw = nsfw g.db.add(emoji) author = get_account(emoji.author_id) @@ -188,8 +188,8 @@ def approve_emoji(v, name): badge_grant(badge_id=113, user=author) badge_grant(badge_id=112, user=author) - cache.delete(f"emojis_{emoji.over_18}") - cache.delete(f"emoji_list_{emoji.kind}_{emoji.over_18}") + cache.delete(f"emojis_{emoji.nsfw}") + cache.delete(f"emoji_list_{emoji.kind}_{emoji.nsfw}") purge_files_in_cloudflare_cache(f"{SITE_FULL_IMAGES}/e/{emoji.name}/webp") @@ -230,7 +230,7 @@ def approve_emoji(v, name): ) g.db.add(ma) - if emoji.over_18: + if emoji.nsfw: OVER_18_EMOJIS.append(emoji.name) return {"message": f"'{emoji.name}' approved!"} @@ -512,8 +512,8 @@ def update_emoji(v): ) g.db.add(ma) - cache.delete(f"emojis_{existing.over_18}") - cache.delete(f"emoji_list_{existing.kind}_{existing.over_18}") + cache.delete(f"emojis_{existing.nsfw}") + cache.delete(f"emoji_list_{existing.kind}_{existing.nsfw}") return {"message": f"'{name}' updated successfully!"} diff --git a/files/routes/comments.py b/files/routes/comments.py index 9f0a7f563..5664f7377 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -63,7 +63,7 @@ def post_pid_comment_cid(cid, v, pid=None, anything=None, sub=None): post = get_post(post, v=v) - if not (v and v.client) and post.over_18 and not g.show_over_18: + if not (v and v.client) and post.nsfw and not g.show_nsfw: return render_template("errors/nsfw.html", v=v), 403 try: context = min(int(request.values.get("context", 8)), 8) @@ -270,7 +270,7 @@ def comment(v): wall_user_id=post_target.id if not posting_to_post else None, parent_comment_id=parent_comment_id, level=level, - over_18=post_target.over_18 if posting_to_post else False, + nsfw=post_target.nsfw if posting_to_post else False, is_bot=is_bot, app_id=v.client.application.id if v.client else None, body=body, @@ -618,16 +618,16 @@ def toggle_comment_nsfw(cid, v): if comment.author_id != v.id and v.admin_level < PERMS['POST_COMMENT_MODERATION'] and not (comment.post.sub and v.mods(comment.post.sub)): abort(403) - if comment.over_18 and v.is_permabanned: + if comment.nsfw and v.is_permabanned: abort(403) - comment.over_18 = not comment.over_18 + comment.nsfw = not comment.nsfw g.db.add(comment) if comment.author_id != v.id: if v.admin_level >= PERMS['POST_COMMENT_MODERATION']: ma = ModAction( - kind = "set_nsfw_comment" if comment.over_18 else "unset_nsfw_comment", + kind = "set_nsfw_comment" if comment.nsfw else "unset_nsfw_comment", user_id = v.id, target_comment_id = comment.id, ) @@ -635,13 +635,13 @@ def toggle_comment_nsfw(cid, v): else: ma = SubAction( sub = comment.post.sub, - kind = "set_nsfw_comment" if comment.over_18 else "unset_nsfw_comment", + kind = "set_nsfw_comment" if comment.nsfw else "unset_nsfw_comment", user_id = v.id, target_comment_id = comment.id, ) g.db.add(ma) - if comment.over_18: return {"message": "Comment has been marked as NSFW!"} + if comment.nsfw: return {"message": "Comment has been marked as NSFW!"} else: return {"message": "Comment has been unmarked as NSFW!"} @app.post("/edit_comment/") diff --git a/files/routes/errors.py b/files/routes/errors.py index f1c6dd4a3..212d112a5 100644 --- a/files/routes/errors.py +++ b/files/routes/errors.py @@ -65,6 +65,6 @@ def error_500(e): @limiter.limit('1/second', scope=rpath) @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400) def allow_nsfw(): - session["over_18_cookies"] = int(time.time()) + 3600 + session["nsfw_cookies"] = int(time.time()) + 3600 redir = request.values.get("redir", "/") return '', 204 diff --git a/files/routes/posts.py b/files/routes/posts.py index 093b75a1f..4bd223791 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -102,7 +102,7 @@ def post_id(pid, v, anything=None, sub=None): p = get_post(pid, v=v) if not can_see(v, p): abort(403) - if not g.is_api_or_xhr and p.over_18 and not g.show_over_18: + if not g.is_api_or_xhr and p.nsfw and not g.show_nsfw: return render_template("errors/nsfw.html", v=v) gevent.spawn(_add_post_view, pid) @@ -539,7 +539,7 @@ def submit_post(v, sub=None): flag_notify = (request.values.get("notify", "on") == "on") flag_new = request.values.get("new", False, bool) or 'megathread' in title.lower() - flag_over_18 = FEATURES['NSFW_MARKING'] and request.values.get("over_18", False, bool) + flag_nsfw = FEATURES['NSFW_MARKING'] and request.values.get("nsfw", False, bool) flag_private = request.values.get("private", False, bool) flag_ghost = request.values.get("ghost", False, bool) and v.can_post_in_ghost_threads @@ -559,7 +559,7 @@ def submit_post(v, sub=None): private=flag_private, notify=flag_notify, author_id=v.id, - over_18=flag_over_18, + nsfw=flag_nsfw, new=flag_new, app_id=v.client.application.id if v.client else None, is_bot=(v.client is not None), @@ -661,7 +661,7 @@ def submit_post(v, sub=None): c_jannied = Comment(author_id=AUTOJANNY_ID, parent_post=p.id, level=1, - over_18=False, + nsfw=False, is_bot=True, app_id=None, distinguish_level=6, @@ -780,10 +780,10 @@ def mark_post_nsfw(pid, v): if p.author_id != v.id and v.admin_level < PERMS['POST_COMMENT_MODERATION'] and not (p.sub and v.mods(p.sub)): abort(403) - if p.over_18 and v.is_permabanned: + if p.nsfw and v.is_permabanned: abort(403) - p.over_18 = True + p.nsfw = True g.db.add(p) if p.author_id != v.id: @@ -819,10 +819,10 @@ def unmark_post_nsfw(pid, v): if p.author_id != v.id and v.admin_level < PERMS['POST_COMMENT_MODERATION'] and not (p.sub and v.mods(p.sub)): abort(403) - if p.over_18 and v.is_permabanned: + if p.nsfw and v.is_permabanned: abort(403) - p.over_18 = False + p.nsfw = False g.db.add(p) if p.author_id != v.id: diff --git a/files/routes/search.py b/files/routes/search.py index e80f80ca4..74807e3fc 100644 --- a/files/routes/search.py +++ b/files/routes/search.py @@ -112,7 +112,7 @@ def searchposts(v): ) for x in criteria['q']] posts = posts.filter(*words) - if 'nsfw' in criteria: posts = posts.filter(Post.over_18==True) + if 'nsfw' in criteria: posts = posts.filter(Post.nsfw==True) if 'domain' in criteria: domain = criteria['domain'] @@ -236,7 +236,7 @@ def searchcomments(v): ' & '.join(tokens), postgresql_regconfig='english')) - if 'nsfw' in criteria: comments = comments.filter(Comment.over_18 == True) + if 'nsfw' in criteria: comments = comments.filter(Comment.nsfw == True) if search_operator_hole in criteria: comments = comments.filter(Post.sub == criteria[search_operator_hole]) diff --git a/files/routes/settings.py b/files/routes/settings.py index 4da6abc5c..2d30f5746 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -178,9 +178,9 @@ def settings_personal_post(v): updated = True session["cursormarsey"] = int(request.values.get("cursormarsey") == 'true') - elif not updated and request.values.get("over_18", v.over_18) != v.over_18: + elif not updated and request.values.get("nsfw", v.nsfw) != v.nsfw: updated = True - session["over_18"] = int(request.values.get("over_18") == 'true') + session["nsfw"] = int(request.values.get("nsfw") == 'true') elif not updated and IS_EVENT() and v.can_toggle_event_music and request.values.get("event_music", v.event_music) != v.event_music: updated = True diff --git a/files/routes/static.py b/files/routes/static.py index 782e45e57..c402f99c4 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -42,11 +42,11 @@ def reddit_post(subreddit, v, path): return redirect(f'https://{reddit}/{post_id}') -@cache.cached(make_cache_key=lambda kind, over_18:f"emoji_list_{kind}_{over_18}") -def get_emoji_list(kind, over_18): +@cache.cached(make_cache_key=lambda kind, nsfw:f"emoji_list_{kind}_{nsfw}") +def get_emoji_list(kind, nsfw): li = g.db.query(Emoji, User).join(User, Emoji.author_id == User.id).filter(Emoji.submitter_id == None, Emoji.kind == kind) - if not over_18: - li = li.filter(Emoji.over_18 == False) + if not nsfw: + li = li.filter(Emoji.nsfw == False) li = li.order_by(Emoji.count.desc()) emojis = [] @@ -65,7 +65,7 @@ def marseys_redirect(): @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID) @auth_required def emoji_list(v, kind): - emojis = get_emoji_list(kind, g.show_over_18) + emojis = get_emoji_list(kind, g.show_nsfw) authors = get_accounts_dict([e.author_id for e in emojis], v=v, graceful=True) if FEATURES['ASSET_SUBMISSIONS']: @@ -86,12 +86,12 @@ def emoji_list(v, kind): -@cache.cached(make_cache_key=lambda over_18:f"emojis_{over_18}") -def get_emojis(over_18): +@cache.cached(make_cache_key=lambda nsfw:f"emojis_{nsfw}") +def get_emojis(nsfw): emojis = g.db.query(Emoji, User).join(User, Emoji.author_id == User.id).filter(Emoji.submitter_id == None) - if not over_18: - emojis = emojis.filter(Emoji.over_18 == False) + if not nsfw: + emojis = emojis.filter(Emoji.nsfw == False) emojis1 = emojis.filter(Emoji.kind != 'Marsey Alphabet').order_by(Emoji.count.desc()).all() emojis2 = emojis.filter(Emoji.kind == 'Marsey Alphabet').order_by(func.length(Emoji.name), Emoji.name).all() @@ -111,7 +111,7 @@ def get_emojis(over_18): @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID) @auth_required def emojis(v): - return get_emojis(g.show_over_18) + return get_emojis(g.show_nsfw) diff --git a/files/routes/wrappers.py b/files/routes/wrappers.py index 33d88c2dd..88370cdee 100644 --- a/files/routes/wrappers.py +++ b/files/routes/wrappers.py @@ -121,7 +121,7 @@ def get_logged_in_user(): if v and not IS_EVENT(): session.pop("event_music", None) - g.show_over_18 = SITE_NAME == 'WPD' or (v and v.over_18) or session.get('over_18_cookies', 0) >= int(time.time()) + g.show_nsfw = SITE_NAME == 'WPD' or (v and v.nsfw) or session.get('nsfw_cookies', 0) >= int(time.time()) return v diff --git a/files/templates/comments.html b/files/templates/comments.html index 7fce285c4..4660466cc 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -30,7 +30,7 @@
@@ -63,7 +63,7 @@ {% if standalone and level==1 %}
- {% if c.parent_post and c.post.over_18 %} + {% if c.parent_post and c.post.nsfw %} NSFW {% endif %} @@ -139,7 +139,7 @@ {% endif %} {% if c.active_reports(v) %}{% endif %} - {% if c.over_18 %}NSFW{% endif %} + {% if c.nsfw %}NSFW{% endif %} {% if v and v.can_see_shadowbanned and c.author.shadowbanned %}{% endif %} {% if c.stickied %} @@ -475,8 +475,8 @@ {% endif %} {% if FEATURES['NSFW_MARKING'] and (c.parent_post 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 %} {% if v.admin_level >= PERMS['USER_BAN'] and v.id != c.author_id %} @@ -629,9 +629,9 @@ {% endif %} {% if FEATURES['NSFW_MARKING'] and (c.author_id == v.id or (c.post.sub and v.mods(c.post.sub))) %} - + - + {% endif %} {% if v.admin_level < PERMS['POST_COMMENT_MODERATION'] %} @@ -695,8 +695,8 @@ {% if FEATURES['NSFW_MARKING'] %} - - + + {% endif %} {% endif %} diff --git a/files/templates/errors/nsfw.html b/files/templates/errors/nsfw.html index 9c5e54b25..a6a3edc9c 100644 --- a/files/templates/errors/nsfw.html +++ b/files/templates/errors/nsfw.html @@ -14,7 +14,7 @@ - +
diff --git a/files/templates/post_actions.html b/files/templates/post_actions.html index a38457c27..19cd98bc4 100644 --- a/files/templates/post_actions.html +++ b/files/templates/post_actions.html @@ -75,8 +75,8 @@ {% endif %} {% endif %} {% 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 %} {% if v.admin_level >= PERMS['PROGSTACK'] %} diff --git a/files/templates/post_actions_mobile.html b/files/templates/post_actions_mobile.html index ea42aa5e5..b228c30fd 100644 --- a/files/templates/post_actions_mobile.html +++ b/files/templates/post_actions_mobile.html @@ -51,8 +51,8 @@ {% endif %} {% if FEATURES['NSFW_MARKING'] and (v.id==p.author_id or (p.sub and v.mods(p.sub))) %} - - + + {% endif %} {% if p.sub and v.mods(p.sub) %} diff --git a/files/templates/post_admin_actions_mobile.html b/files/templates/post_admin_actions_mobile.html index e80d18fa0..db7c3e20e 100644 --- a/files/templates/post_admin_actions_mobile.html +++ b/files/templates/post_admin_actions_mobile.html @@ -34,8 +34,8 @@ {% endif %} {% if FEATURES['NSFW_MARKING'] and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %} - - + + {% endif %} {% if v.admin_level >= PERMS['PROGSTACK'] %} diff --git a/files/templates/post_banned.html b/files/templates/post_banned.html index e933a0f9f..032480914 100644 --- a/files/templates/post_banned.html +++ b/files/templates/post_banned.html @@ -23,9 +23,9 @@
- +
{{p.plaintitle(v)}}
- +
diff --git a/files/templates/post_listing.html b/files/templates/post_listing.html index 44497787d..69d3de415 100644 --- a/files/templates/post_listing.html +++ b/files/templates/post_listing.html @@ -28,7 +28,7 @@ {{macros.reports(p, 'post')}} -
+
diff --git a/files/templates/settings/advanced.html b/files/templates/settings/advanced.html index 310706d38..8a3719050 100644 --- a/files/templates/settings/advanced.html +++ b/files/templates/settings/advanced.html @@ -130,7 +130,7 @@
{{common.toggle_section('Disable Signatures', 'sigs_disabled', 'sigs_disabled', v.sigs_disabled, 'Hide user signatures.', false)}} {% if FEATURES['NSFW_MARKING'] %} - {{common.toggle_section('Disable NSFW Warnings', 'over_18', 'over_18', v.over_18, "Disable the warning that appears when viewing NSFW posts and stop collapsing NSFW comments.", false)}} + {{common.toggle_section('Disable NSFW Warnings', 'nsfw', 'nsfw', v.nsfw, "Disable the warning that appears when viewing NSFW posts and stop collapsing NSFW comments.", false)}} {% endif %} {% if SITE_NAME != 'rDrama' %} {{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 2c77886a3..1fa38688d 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -69,7 +69,7 @@
{% if FEATURES['NSFW_MARKING'] %}
- +
{% endif %} diff --git a/files/templates/submit_emojis.html b/files/templates/submit_emojis.html index 07d3cf12c..b61696a69 100644 --- a/files/templates/submit_emojis.html +++ b/files/templates/submit_emojis.html @@ -45,7 +45,7 @@ {% if FEATURES['NSFW_MARKING'] %}
- +
{% endif %} @@ -101,7 +101,7 @@ {% if FEATURES['NSFW_MARKING'] %}
- +
{% endif %} diff --git a/files/templates/util/macros.html b/files/templates/util/macros.html index 532c6f29e..4ea8a7d18 100644 --- a/files/templates/util/macros.html +++ b/files/templates/util/macros.html @@ -53,7 +53,7 @@ {% if p.is_pinned and request.path != '/' %} {% endif %} - {% if p.over_18 %}NSFW{% endif %} + {% if p.nsfw %}NSFW{% endif %} {% if p.is_bot %} {% endif %} {% if p.is_blocking and not p.ghost %}{% endif %} {% if p.is_blocked and not p.ghost %}{% endif %} diff --git a/migrations/20231005-name-over_18-to-nsfw.sql b/migrations/20231005-name-over_18-to-nsfw.sql new file mode 100644 index 000000000..1a910e615 --- /dev/null +++ b/migrations/20231005-name-over_18-to-nsfw.sql @@ -0,0 +1,3 @@ +alter table comments rename column over_18 to nsfw; +alter table emojis rename column over_18 to nsfw; +alter table posts rename column over_18 to nsfw;