diff --git a/files/assets/js/submit.js b/files/assets/js/submit.js index 30b52351b..b31153907 100644 --- a/files/assets/js/submit.js +++ b/files/assets/js/submit.js @@ -8,7 +8,7 @@ for (const id of save_value) { autoExpand(document.getElementById('post-text')) markdown(document.getElementById("post-text")); -const save_checked = ['post-notify', 'post-new', 'post-nsfw', 'post-private', 'post-effortpost', 'post-ghost'] +const save_checked = ['post-notify', 'post-new', 'post-nsfw', 'post-private', 'post-effortpost', 'post-ghost', 'post-cw'] for (const key of save_checked) { const value = localStorage.getItem(key) if (value) { diff --git a/files/classes/post.py b/files/classes/post.py index 98c8afc01..2af97907b 100644 --- a/files/classes/post.py +++ b/files/classes/post.py @@ -74,6 +74,9 @@ class Post(Base): else: nsfw = False + if SITE_NAME == 'WPD': + cw = Column(Boolean, default=False) + author = relationship("User", primaryjoin="Post.author_id==User.id") oauth_app = relationship("OauthApp") approved_by = relationship("User", uselist=False, primaryjoin="Post.is_approved==User.id") diff --git a/files/routes/posts.py b/files/routes/posts.py index 8272b73c5..6fdfe3c76 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -572,6 +572,8 @@ def submit_post(v, hole=None): ghost=flag_ghost, ) + if SITE_NAME == 'WPD': + p.cw = request.values.get("cw", False, bool) p.chudded = v.chud and hole != 'chudrama' and not (p.is_longpost and not v.chudded_by) p.queened = v.queen and not p.is_longpost diff --git a/files/templates/post.html b/files/templates/post.html index 43bc071ad..491de5d6d 100644 --- a/files/templates/post.html +++ b/files/templates/post.html @@ -92,7 +92,14 @@ {{macros.reports(p, 'post')}}