forked from MarseyWorld/MarseyWorld
do this https://stupidpol.site/h/countryclub/post/79285/tired-of-some-cute-twink-jannies/3194721?context=8#context (#53)
Co-authored-by: Aevann1 <randomname42029@gmail.com> Reviewed-on: rDrama/rDrama#53master
parent
e8f9d39bcf
commit
81267ef1c6
|
@ -143,6 +143,7 @@ function post_reply(id){
|
|||
document.getElementById('reply-form-body-'+id).value = ''
|
||||
document.getElementById('message-reply-'+id).innerHTML = ''
|
||||
ToggleReplyBox('reply-message-'+id)
|
||||
document.getElementById('file-upload').value = null;
|
||||
} else {
|
||||
showToast(false, getMessageFromJsonData(false, data));
|
||||
}
|
||||
|
@ -179,6 +180,7 @@ function comment_edit(id){
|
|||
bs_trigger(commentForm);
|
||||
document.getElementById('filename-edit-reply-' + id).innerHTML = '<i class="fas fa-file"></i>';
|
||||
document.getElementById('comment-edit-body-' + id).value = data["body"];
|
||||
document.getElementById('file-edit-reply-'+id).value = null;
|
||||
}
|
||||
else {
|
||||
showToast(false, getMessageFromJsonData(false, data));
|
||||
|
@ -239,6 +241,7 @@ function post_comment(fullname, wall_user_id, hide){
|
|||
document.getElementById('form-preview-'+fullname).innerHTML = ''
|
||||
document.getElementById('charcount-'+fullname).innerHTML = ''
|
||||
document.getElementById('filename-show-reply-' + fullname).innerHTML = '<i class="fas fa-file"></i>';
|
||||
document.getElementById('file-upload-reply-'+fullname).value = null;
|
||||
}
|
||||
else {
|
||||
showToast(false, getMessageFromJsonData(false, data));
|
||||
|
|
|
@ -292,7 +292,7 @@ function changename(s1,s2) {
|
|||
if (files.length > 4)
|
||||
{
|
||||
alert("You can't upload more than 4 files at one time!")
|
||||
document.getElementById(s2).files = null
|
||||
document.getElementById(s2).value = null
|
||||
return
|
||||
}
|
||||
let filename = '';
|
||||
|
|
|
@ -72,7 +72,7 @@ document.onpaste = function(event) {
|
|||
for (const file of files)
|
||||
filename += file.name + ', '
|
||||
filename = filename.toLowerCase().slice(0, -2)
|
||||
document.getElementById('file-upload-submit').files = files;
|
||||
document.getElementById('file-upload-submit').value = files;
|
||||
document.getElementById('filename-show-submit').textContent = filename;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -131,14 +131,12 @@ def get_post(i:Union[str, int], v:Optional[User]=None, graceful=False) -> Option
|
|||
)
|
||||
|
||||
post=post.filter(Submission.id == i
|
||||
).join(
|
||||
).outerjoin(
|
||||
vt,
|
||||
vt.c.submission_id == Submission.id,
|
||||
isouter=True
|
||||
).join(
|
||||
).outerjoin(
|
||||
blocking,
|
||||
blocking.c.target_id == Submission.author_id,
|
||||
isouter=True
|
||||
)
|
||||
|
||||
post=post.one_or_none()
|
||||
|
@ -179,16 +177,14 @@ def get_posts(pids:Iterable[int], v:Optional[User]=None, eager:bool=False, extra
|
|||
blocked.c.target_id,
|
||||
).filter(
|
||||
Submission.id.in_(pids)
|
||||
).join(
|
||||
vt, vt.c.submission_id==Submission.id, isouter=True
|
||||
).join(
|
||||
).outerjoin(
|
||||
vt, vt.c.submission_id==Submission.id
|
||||
).outerjoin(
|
||||
blocking,
|
||||
blocking.c.target_id == Submission.author_id,
|
||||
isouter=True
|
||||
).join(
|
||||
).outerjoin(
|
||||
blocked,
|
||||
blocked.c.user_id == Submission.author_id,
|
||||
isouter=True
|
||||
)
|
||||
else:
|
||||
query = g.db.query(Submission).filter(Submission.id.in_(pids))
|
||||
|
@ -320,18 +316,15 @@ def get_comments_v_properties(v:User, include_shadowbanned=True, should_keep_fun
|
|||
comments = comments.join(Comment.author).filter(User.shadowbanned == None)
|
||||
|
||||
comments = comments.filter(*criterion)
|
||||
comments = comments.join(
|
||||
comments = comments.outerjoin(
|
||||
votes,
|
||||
votes.c.comment_id == Comment.id,
|
||||
isouter=True
|
||||
).join(
|
||||
).outerjoin(
|
||||
blocking,
|
||||
blocking.c.target_id == Comment.author_id,
|
||||
isouter=True
|
||||
).join(
|
||||
).outerjoin(
|
||||
blocked,
|
||||
blocked.c.user_id == Comment.author_id,
|
||||
isouter=True
|
||||
)
|
||||
queried = comments.all()
|
||||
output = []
|
||||
|
|
|
@ -79,7 +79,6 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
|
|||
else: template = "submission.html"
|
||||
return render_template(template, v=v, p=post, sort=sort, comment_info=comment_info, render_replies=True, sub=post.subr)
|
||||
|
||||
#- API
|
||||
@app.post("/comment")
|
||||
@limiter.limit("1/second;20/minute;200/hour;1000/day")
|
||||
@auth_required
|
||||
|
@ -311,7 +310,7 @@ def comment(v):
|
|||
|
||||
v.comment_count = g.db.query(Comment).filter(
|
||||
Comment.author_id == v.id,
|
||||
Comment.parent_submission != None,
|
||||
or_(Comment.parent_submission != None, Comment.wall_user_id != None),
|
||||
Comment.deleted_utc == 0
|
||||
).count()
|
||||
g.db.add(v)
|
||||
|
@ -346,7 +345,6 @@ def comment(v):
|
|||
return {"comment": render_template("comments.html", v=v, comments=[c])}
|
||||
|
||||
|
||||
#- API
|
||||
@app.post("/wall_comment")
|
||||
@limiter.limit("1/second;20/minute;200/hour;1000/day")
|
||||
@auth_required
|
||||
|
@ -523,7 +521,7 @@ def wall_comment(v):
|
|||
|
||||
v.comment_count = g.db.query(Comment).filter(
|
||||
Comment.author_id == v.id,
|
||||
Comment.parent_submission != None,
|
||||
or_(Comment.parent_submission != None, Comment.wall_user_id != None),
|
||||
Comment.deleted_utc == 0
|
||||
).count()
|
||||
g.db.add(v)
|
||||
|
@ -550,6 +548,8 @@ def wall_comment(v):
|
|||
|
||||
g.db.flush()
|
||||
|
||||
cache.delete_memoized(comment_idlist)
|
||||
|
||||
if v.client: return c.json(db=g.db)
|
||||
return {"comment": render_template("comments.html", v=v, comments=[c])}
|
||||
|
||||
|
@ -644,7 +644,7 @@ def delete_comment(cid, v):
|
|||
g.db.flush()
|
||||
v.comment_count = g.db.query(Comment).filter(
|
||||
Comment.author_id == v.id,
|
||||
Comment.parent_submission != None,
|
||||
or_(Comment.parent_submission != None, Comment.wall_user_id != None),
|
||||
Comment.deleted_utc == 0
|
||||
).count()
|
||||
g.db.add(v)
|
||||
|
@ -664,7 +664,7 @@ def undelete_comment(cid, v):
|
|||
g.db.flush()
|
||||
v.comment_count = g.db.query(Comment).filter(
|
||||
Comment.author_id == v.id,
|
||||
Comment.parent_submission != None,
|
||||
or_(Comment.parent_submission != None, Comment.wall_user_id != None),
|
||||
Comment.deleted_utc == 0
|
||||
).count()
|
||||
g.db.add(v)
|
||||
|
|
|
@ -210,8 +210,10 @@ def all_comments(v:User):
|
|||
@cache.memoize(timeout=86400)
|
||||
def comment_idlist(v=None, page=1, sort="new", t="all", gt=0, lt=0, site=None):
|
||||
comments = g.db.query(Comment.id) \
|
||||
.join(Comment.post) \
|
||||
.filter(Comment.parent_submission != None)
|
||||
.outerjoin(Comment.post) \
|
||||
.filter(
|
||||
or_(Comment.parent_submission != None, Comment.wall_user_id != None),
|
||||
)
|
||||
|
||||
if v.admin_level < PERMS['POST_COMMENT_MODERATION']:
|
||||
comments = comments.filter(
|
||||
|
|
|
@ -181,8 +181,11 @@ def searchcomments(v:User):
|
|||
|
||||
criteria = searchparse(query)
|
||||
|
||||
comments = g.db.query(Comment.id).join(Comment.post) \
|
||||
.filter(Comment.parent_submission != None, Comment.author_id.notin_(v.userblocks))
|
||||
comments = g.db.query(Comment.id).outerjoin(Comment.post) \
|
||||
.filter(
|
||||
or_(Comment.parent_submission != None, Comment.wall_user_id != None),
|
||||
Comment.author_id.notin_(v.userblocks),
|
||||
)
|
||||
|
||||
|
||||
if 'post' in criteria:
|
||||
|
|
|
@ -938,11 +938,11 @@ def u_username_comments(username, v=None):
|
|||
|
||||
comment_post_author = aliased(User)
|
||||
comments = g.db.query(Comment.id) \
|
||||
.join(Comment.post) \
|
||||
.join(comment_post_author, Submission.author) \
|
||||
.outerjoin(Comment.post) \
|
||||
.outerjoin(comment_post_author, Submission.author) \
|
||||
.filter(
|
||||
Comment.author_id == u.id,
|
||||
Comment.parent_submission != None
|
||||
or_(Comment.parent_submission != None, Comment.wall_user_id != None),
|
||||
)
|
||||
|
||||
if not v or (v.id != u.id and v.admin_level < PERMS['POST_COMMENT_MODERATION']):
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
{% elif c.author_id==AUTOJANNY_ID %}
|
||||
<span class="font-weight-bold">Notification</span>
|
||||
{% elif c.wall_user_id %}
|
||||
{% if request.path == '/notifications' %}
|
||||
{% if not wall %}
|
||||
{% if c.wall_user_id == v.id %}
|
||||
<span class="font-weight-bold"><a href="/@{{v.username}}">Your Profile Wall</a></span>
|
||||
{% else %}
|
||||
|
|
Loading…
Reference in New Issue