"Disable NSFW Warnings" -> "NSFW Warnings"

pull/211/head
Aevann 2023-10-05 13:29:23 +03:00
parent bb7192c929
commit a1de1cf7c8
4 changed files with 6 additions and 6 deletions

View File

@ -284,8 +284,8 @@ class User(Base):
@property
@lazy
def nsfw(self):
return bool(session.get('nsfw'))
def nsfw_warnings(self):
return bool(session.get('nsfw_warnings', True))
@property
@lazy

View File

@ -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("nsfw", v.nsfw) != v.nsfw:
elif not updated and request.values.get("nsfw_warnings", v.nsfw_warnings) != v.nsfw_warnings:
updated = True
session["nsfw"] = int(request.values.get("nsfw") == 'true')
session["nsfw_warnings"] = int(request.values.get("nsfw_warnings") == '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

View File

@ -121,7 +121,7 @@ def get_logged_in_user():
if v and not IS_EVENT():
session.pop("event_music", None)
g.show_nsfw = SITE_NAME == 'WPD' or (v and v.nsfw) or session.get('nsfw_cookies', 0) >= int(time.time())
g.show_nsfw = SITE_NAME == 'WPD' or (v and not v.nsfw_warnings) or session.get('nsfw_cookies', 0) >= int(time.time())
return v

View File

@ -130,7 +130,7 @@
<div class="settings-section rounded">
{{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', 'nsfw', 'nsfw', v.nsfw, "Disable the warning that appears when viewing NSFW posts and stop collapsing NSFW comments.", false)}}
{{common.toggle_section('NSFW Warnings', 'nsfw_warnings', 'nsfw_warnings', v.nsfw_warnings, "Show a warning when viewing NSFW posts and collapse 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)}}