forked from rDrama/rDrama
private -> draft
parent
5441777c19
commit
4d04f861cb
|
@ -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', 'post-cw']
|
||||
const save_checked = ['post-notify', 'post-new', 'post-nsfw', 'post-draft', 'post-effortpost', 'post-ghost', 'post-cw']
|
||||
for (const key of save_checked) {
|
||||
const value = localStorage.getItem(key)
|
||||
if (value) {
|
||||
|
|
|
@ -451,8 +451,9 @@ def is_repost(v):
|
|||
@limiter.limit('20/day', deduct_when=lambda response: response.status_code < 400, key_func=get_ID)
|
||||
@auth_required
|
||||
def submit_post(v, hole=None):
|
||||
flag_private = request.values.get("private", False, bool)
|
||||
if v.is_permabanned or (v.is_banned and not flag_private):
|
||||
flag_draft = request.values.get("draft", False, bool)
|
||||
|
||||
if v.is_permabanned or (v.is_banned and not flag_draft):
|
||||
abort(403, "You can't perform this action while banned!")
|
||||
|
||||
url = request.values.get("url", "").strip()
|
||||
|
@ -574,7 +575,7 @@ def submit_post(v, hole=None):
|
|||
if url == '': url = None
|
||||
|
||||
p = Post(
|
||||
private=flag_private,
|
||||
draft=flag_draft,
|
||||
notify=flag_notify,
|
||||
author_id=v.id,
|
||||
nsfw=flag_nsfw,
|
||||
|
|
|
@ -994,7 +994,7 @@ def userpagelisting(u, v=None, page=1, sort="new", t="all"):
|
|||
posts = g.db.query(Post).filter_by(author_id=u.id, profile_pinned=False).options(load_only(Post.id))
|
||||
|
||||
if v.id != u.id and v.admin_level < PERMS['POST_COMMENT_MODERATION']:
|
||||
posts = posts.filter_by(is_banned=False, private=False, ghost=False)
|
||||
posts = posts.filter_by(is_banned=False, draft=False, ghost=False)
|
||||
|
||||
if v.admin_level < PERMS['POST_COMMENT_MODERATION'] and not (SITE_NAME == 'rDrama' and v.id == u.id):
|
||||
posts = posts.filter_by(deleted_utc=0)
|
||||
|
|
|
@ -90,8 +90,8 @@
|
|||
{% endif %}
|
||||
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="post-private" name="private" data-nonce="{{g.nonce}}" data-onchange="savetext()">
|
||||
<label class="custom-control-label" for="post-private">Draft</label>
|
||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="post-draft" name="draft" data-nonce="{{g.nonce}}" data-onchange="savetext()">
|
||||
<label class="custom-control-label" for="post-draft">Draft</label>
|
||||
</div>
|
||||
|
||||
{% if not (SITE_NAME == 'WPD' and v.truescore < 500) %}
|
||||
|
|
Loading…
Reference in New Issue