forked from MarseyWorld/MarseyWorld
add "distinguished" checkbox
parent
3f062fcf44
commit
c6aca40fbb
|
@ -307,6 +307,10 @@ function post_comment(fullname, hide) {
|
|||
if (admin_note_el)
|
||||
form.append('admin_note', admin_note_el.checked);
|
||||
|
||||
const distinguished_el = document.getElementById('distinguished-'+fullname)
|
||||
if (distinguished_el)
|
||||
form.append('distinguished', distinguished_el.checked);
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
url = '/comment';
|
||||
xhr.open("POST", url);
|
||||
|
|
|
@ -9,7 +9,7 @@ const postText = document.getElementById('post-text')
|
|||
autoExpand(postText)
|
||||
markdown(postText);
|
||||
|
||||
const save_checked = ['post-notify', 'post-new', 'post-nsfw', 'post-draft', 'post-effortpost', 'post-ghost', 'post-cw']
|
||||
const save_checked = ['post-notify', 'post-new', 'post-nsfw', 'post-draft', 'post-effortpost', 'post-ghost', 'post-cw', 'post-distinguished']
|
||||
for (const key of save_checked) {
|
||||
const value = localStorage.getItem(key)
|
||||
if (value) {
|
||||
|
|
|
@ -211,6 +211,8 @@ def comment(v):
|
|||
|
||||
chudded = v.chud and not (posting_to_post and post_target.hole == 'chudrama')
|
||||
|
||||
distinguished = request.values.get("distinguished", False, bool) and v.admin_level >= PERMS['POST_COMMENT_DISTINGUISH']
|
||||
|
||||
c = Comment(author_id=v.id,
|
||||
parent_post=post_target.id if posting_to_post else None,
|
||||
wall_user_id=post_target.id if not posting_to_post else None,
|
||||
|
@ -225,6 +227,7 @@ def comment(v):
|
|||
rainbowed=bool(v.rainbow),
|
||||
queened=bool(v.queen),
|
||||
sharpened=bool(v.sharpen),
|
||||
distinguished=distinguished,
|
||||
)
|
||||
|
||||
c.upvotes = 1
|
||||
|
|
|
@ -594,6 +594,7 @@ def submit_post(v, hole=None):
|
|||
flag_nsfw = FEATURES['NSFW_MARKING'] and request.values.get("nsfw", False, bool)
|
||||
flag_effortpost = request.values.get("effortpost", False, bool)
|
||||
flag_ghost = request.values.get("ghost", False, bool) and v.can_post_in_ghost_threads
|
||||
flag_distinguished = request.values.get("distinguished", False, bool) and v.admin_level >= PERMS['POST_COMMENT_DISTINGUISH']
|
||||
|
||||
if flag_ghost: hole = None
|
||||
|
||||
|
@ -619,6 +620,7 @@ def submit_post(v, hole=None):
|
|||
title=title,
|
||||
hole=hole,
|
||||
ghost=flag_ghost,
|
||||
distinguished=flag_distinguished,
|
||||
)
|
||||
|
||||
if SITE == 'watchpeopledie.tv':
|
||||
|
|
|
@ -112,6 +112,13 @@
|
|||
<label class="custom-control-label" for="post-ghost">Ghost thread</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if v.admin_level >= PERMS['POST_COMMENT_DISTINGUISH'] %}
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="post-distinguished" name="distinguished" data-nonce="{{g.nonce}}" data-onchange="savetext()">
|
||||
<label class="custom-control-label" for="post-distinguished">Distinguished</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -169,8 +169,15 @@
|
|||
{{file_btn('file-upload-reply-' ~ target_fullname)}}
|
||||
</div>
|
||||
|
||||
{% if v.admin_level >= PERMS['ADMIN_NOTES'] and target_fullname.startswith('u_') %}
|
||||
{% if v.admin_level >= PERMS['POST_COMMENT_DISTINGUISH'] %}
|
||||
<div class="custom-control custom-checkbox mt-3 d-inline-block">
|
||||
<input data-nonce="{{g.nonce}}" autocomplete="off" type="checkbox" class="custom-control-input" id="distinguished-{{target_fullname}}">
|
||||
<label class="custom-control-label" for="distinguished-{{target_fullname}}">Distinguished</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if v.admin_level >= PERMS['ADMIN_NOTES'] and target_fullname.startswith('u_') %}
|
||||
<div class="custom-control custom-checkbox mt-3 d-inline-block ml-3">
|
||||
<input data-nonce="{{g.nonce}}" autocomplete="off" type="checkbox" class="custom-control-input" id="admin-note-{{target_fullname}}">
|
||||
<label class="custom-control-label" for="admin-note-{{target_fullname}}">Admin Note</label>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue