fdsfds
This commit is contained in:
parent
c3930d4054
commit
42f70bc64e
12 changed files with 120 additions and 75 deletions
|
@ -72,10 +72,14 @@ class Comment(Base):
|
||||||
def top_comment(self):
|
def top_comment(self):
|
||||||
return g.db.query(Comment).filter_by(id=self.top_comment_id).one_or_none()
|
return g.db.query(Comment).filter_by(id=self.top_comment_id).one_or_none()
|
||||||
|
|
||||||
@property
|
|
||||||
@lazy
|
@lazy
|
||||||
def flags(self):
|
def flags(self, v):
|
||||||
return g.db.query(CommentFlag).filter_by(comment_id=self.id).order_by(CommentFlag.created_utc)
|
flags = g.db.query(CommentFlag).filter_by(comment_id=self.id).order_by(CommentFlag.created_utc).all()
|
||||||
|
if not (v and (v.shadowbanned or v.admin_level > 2)):
|
||||||
|
for flag in flags:
|
||||||
|
if flag.user.shadowbanned:
|
||||||
|
flags.remove(flag)
|
||||||
|
return flags
|
||||||
|
|
||||||
@lazy
|
@lazy
|
||||||
def poll_voted(self, v):
|
def poll_voted(self, v):
|
||||||
|
@ -256,7 +260,7 @@ class Comment(Base):
|
||||||
@lazy
|
@lazy
|
||||||
def json_raw(self):
|
def json_raw(self):
|
||||||
flags = {}
|
flags = {}
|
||||||
for f in self.flags: flags[f.user.username] = f.reason
|
for f in self.flags(None): flags[f.user.username] = f.reason
|
||||||
|
|
||||||
data= {
|
data= {
|
||||||
'id': self.id,
|
'id': self.id,
|
||||||
|
@ -434,10 +438,9 @@ class Comment(Base):
|
||||||
@lazy
|
@lazy
|
||||||
def is_op(self): return self.author_id==self.post.author_id
|
def is_op(self): return self.author_id==self.post.author_id
|
||||||
|
|
||||||
@property
|
|
||||||
@lazy
|
@lazy
|
||||||
def active_flags(self): return self.flags.count()
|
def active_flags(self, v): return len(self.flags(v))
|
||||||
|
|
||||||
@lazy
|
@lazy
|
||||||
def wordle_html(self, v):
|
def wordle_html(self, v):
|
||||||
if not self.wordle_result: return ''
|
if not self.wordle_result: return ''
|
||||||
|
|
|
@ -76,11 +76,15 @@ class Submission(Base):
|
||||||
if self.downvotes > 5 and 0.25 < self.upvotes / self.downvotes < 4: return True
|
if self.downvotes > 5 and 0.25 < self.upvotes / self.downvotes < 4: return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@property
|
|
||||||
@lazy
|
@lazy
|
||||||
def flags(self):
|
def flags(self, v):
|
||||||
return g.db.query(Flag).filter_by(post_id=self.id).order_by(Flag.created_utc)
|
flags = g.db.query(Flag).filter_by(post_id=self.id).order_by(Flag.created_utc).all()
|
||||||
|
if not (v and (v.shadowbanned or v.admin_level > 2)):
|
||||||
|
for flag in flags:
|
||||||
|
if flag.user.shadowbanned:
|
||||||
|
flags.remove(flag)
|
||||||
|
return flags
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def options(self):
|
def options(self):
|
||||||
|
@ -261,7 +265,7 @@ class Submission(Base):
|
||||||
@lazy
|
@lazy
|
||||||
def json_raw(self):
|
def json_raw(self):
|
||||||
flags = {}
|
flags = {}
|
||||||
for f in self.flags: flags[f.user.username] = f.reason
|
for f in self.flags(None): flags[f.user.username] = f.reason
|
||||||
|
|
||||||
data = {'author_name': self.author_name if self.author else '',
|
data = {'author_name': self.author_name if self.author else '',
|
||||||
'permalink': self.permalink,
|
'permalink': self.permalink,
|
||||||
|
@ -477,6 +481,5 @@ class Submission(Base):
|
||||||
if self.url: return self.url.lower().endswith('.webp') or self.url.lower().endswith('.jpg') or self.url.lower().endswith('.png') or self.url.lower().endswith('.gif') or self.url.lower().endswith('.jpeg') or self.url.lower().endswith('?maxwidth=9999') or self.url.lower().endswith('&fidelity=high')
|
if self.url: return self.url.lower().endswith('.webp') or self.url.lower().endswith('.jpg') or self.url.lower().endswith('.png') or self.url.lower().endswith('.gif') or self.url.lower().endswith('.jpeg') or self.url.lower().endswith('?maxwidth=9999') or self.url.lower().endswith('&fidelity=high')
|
||||||
else: return False
|
else: return False
|
||||||
|
|
||||||
@property
|
|
||||||
@lazy
|
@lazy
|
||||||
def active_flags(self): return self.flags.count()
|
def active_flags(self, v): return len(self.flags(v))
|
|
@ -422,7 +422,12 @@ class User(Base):
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def notifications_count(self):
|
def notifications_count(self):
|
||||||
return g.db.query(Notification.user_id).join(Comment).filter(Notification.user_id == self.id, Notification.read == False, Comment.is_banned == False, Comment.deleted_utc == 0).count()
|
notifs = g.db.query(Notification.user_id).join(Comment).filter(Notification.user_id == self.id, Notification.read == False, Comment.is_banned == False, Comment.deleted_utc == 0)
|
||||||
|
|
||||||
|
if not self.shadowbanned and self.admin_level < 3:
|
||||||
|
notifs = notifs.join(User, User.id == Comment.author_id).filter(User.shadowbanned == None)
|
||||||
|
|
||||||
|
return notifs.count()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
|
@ -516,8 +521,8 @@ class User(Base):
|
||||||
'bannerurl': self.banner_url,
|
'bannerurl': self.banner_url,
|
||||||
'bio_html': self.bio_html_eager,
|
'bio_html': self.bio_html_eager,
|
||||||
'coins': self.coins,
|
'coins': self.coins,
|
||||||
'post_count': 0 if self.shadowbanned and not (v and (v.shadowbanned or v.admin_level)) else self.post_count,
|
'post_count': 0 if self.shadowbanned and not (v and (v.shadowbanned or v.admin_level > 2)) else self.post_count,
|
||||||
'comment_count': 0 if self.shadowbanned and not (v and (v.shadowbanned or v.admin_level)) else self.comment_count,
|
'comment_count': 0 if self.shadowbanned and not (v and (v.shadowbanned or v.admin_level > 2)) else self.comment_count,
|
||||||
'badges': [x.path for x in self.badges],
|
'badges': [x.path for x in self.badges],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -231,7 +231,7 @@ def get_comments(cids, v=None, load_parent=False):
|
||||||
blocked.c.target_id,
|
blocked.c.target_id,
|
||||||
).filter(Comment.id.in_(cids))
|
).filter(Comment.id.in_(cids))
|
||||||
|
|
||||||
if not (v and (v.shadowbanned or v.admin_level > 1)):
|
if not (v and (v.shadowbanned or v.admin_level > 2)):
|
||||||
comments = comments.join(User, User.id == Comment.author_id).filter(User.shadowbanned == None)
|
comments = comments.join(User, User.id == Comment.author_id).filter(User.shadowbanned == None)
|
||||||
|
|
||||||
comments = comments.join(
|
comments = comments.join(
|
||||||
|
|
|
@ -125,7 +125,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
|
||||||
blocked.c.target_id,
|
blocked.c.target_id,
|
||||||
)
|
)
|
||||||
|
|
||||||
if not (v and v.shadowbanned) and not (v and v.admin_level > 1):
|
if not (v and v.shadowbanned) and not (v and v.admin_level > 2):
|
||||||
comments = comments.join(User, User.id == Comment.author_id).filter(User.shadowbanned == None)
|
comments = comments.join(User, User.id == Comment.author_id).filter(User.shadowbanned == None)
|
||||||
|
|
||||||
comments=comments.filter(
|
comments=comments.filter(
|
||||||
|
|
|
@ -49,7 +49,11 @@ def notifications(v):
|
||||||
next_exists = (len(comments) > 25)
|
next_exists = (len(comments) > 25)
|
||||||
listing = comments[:25]
|
listing = comments[:25]
|
||||||
elif messages:
|
elif messages:
|
||||||
comments = g.db.query(Comment).filter(Comment.sentto != None, or_(Comment.author_id==v.id, Comment.sentto==v.id), Comment.parent_submission == None, Comment.level == 1).order_by(Comment.id.desc()).offset(25*(page-1)).limit(26).all()
|
if v and (v.shadowbanned or v.admin_level > 2):
|
||||||
|
comments = g.db.query(Comment).filter(Comment.sentto != None, or_(Comment.author_id==v.id, Comment.sentto==v.id), Comment.parent_submission == None, Comment.level == 1).order_by(Comment.id.desc()).offset(25*(page-1)).limit(26).all()
|
||||||
|
else:
|
||||||
|
comments = g.db.query(Comment).join(User, User.id == Comment.author_id).filter(User.shadowbanned == None, Comment.sentto != None, or_(Comment.author_id==v.id, Comment.sentto==v.id), Comment.parent_submission == None, Comment.level == 1).order_by(Comment.id.desc()).offset(25*(page-1)).limit(26).all()
|
||||||
|
|
||||||
next_exists = (len(comments) > 25)
|
next_exists = (len(comments) > 25)
|
||||||
listing = comments[:25]
|
listing = comments[:25]
|
||||||
elif posts:
|
elif posts:
|
||||||
|
@ -112,7 +116,7 @@ def notifications(v):
|
||||||
Comment.body_html.notlike('<html><body><p>New site mention: <a href="https://old.reddit.com/r/%')
|
Comment.body_html.notlike('<html><body><p>New site mention: <a href="https://old.reddit.com/r/%')
|
||||||
).order_by(Comment.top_comment_id.desc(), Notification.created_utc.desc()).subquery()
|
).order_by(Comment.top_comment_id.desc(), Notification.created_utc.desc()).subquery()
|
||||||
|
|
||||||
if v and (v.shadowbanned or v.admin_level > 1):
|
if v and (v.shadowbanned or v.admin_level > 2):
|
||||||
comments = g.db.query(Comment).join(sq, sq.c.id == Comment.id).order_by(sq.c.created_utc.desc()).offset(25 * (page - 1)).limit(26).all()
|
comments = g.db.query(Comment).join(sq, sq.c.id == Comment.id).order_by(sq.c.created_utc.desc()).offset(25 * (page - 1)).limit(26).all()
|
||||||
else:
|
else:
|
||||||
comments = g.db.query(Comment).join(sq, sq.c.id == Comment.id).join(User, User.id == Comment.author_id).filter(User.shadowbanned == None).order_by(sq.c.created_utc.desc()).offset(25 * (page - 1)).limit(26).all()
|
comments = g.db.query(Comment).join(sq, sq.c.id == Comment.id).join(User, User.id == Comment.author_id).filter(User.shadowbanned == None).order_by(sq.c.created_utc.desc()).offset(25 * (page - 1)).limit(26).all()
|
||||||
|
|
|
@ -149,7 +149,7 @@ def post_id(pid, anything=None, v=None, sub=None):
|
||||||
blocked.c.target_id,
|
blocked.c.target_id,
|
||||||
)
|
)
|
||||||
|
|
||||||
if not (v and v.shadowbanned) and not (v and v.admin_level > 1):
|
if not (v and v.shadowbanned) and not (v and v.admin_level > 2):
|
||||||
comments = comments.join(User, User.id == Comment.author_id).filter(User.shadowbanned == None)
|
comments = comments.join(User, User.id == Comment.author_id).filter(User.shadowbanned == None)
|
||||||
|
|
||||||
comments=comments.filter(Comment.parent_submission == post.id, Comment.author_id.notin_((AUTOPOLLER_ID, AUTOBETTER_ID, AUTOCHOICE_ID))).join(
|
comments=comments.filter(Comment.parent_submission == post.id, Comment.author_id.notin_((AUTOPOLLER_ID, AUTOBETTER_ID, AUTOCHOICE_ID))).join(
|
||||||
|
@ -284,7 +284,7 @@ def viewmore(v, pid, sort, offset):
|
||||||
blocked.c.target_id,
|
blocked.c.target_id,
|
||||||
).filter(Comment.parent_submission == pid, Comment.author_id.notin_((AUTOPOLLER_ID, AUTOBETTER_ID, AUTOCHOICE_ID)), Comment.is_pinned == None, Comment.id.notin_(ids))
|
).filter(Comment.parent_submission == pid, Comment.author_id.notin_((AUTOPOLLER_ID, AUTOBETTER_ID, AUTOCHOICE_ID)), Comment.is_pinned == None, Comment.id.notin_(ids))
|
||||||
|
|
||||||
if not (v and v.shadowbanned) and not (v and v.admin_level > 1):
|
if not (v and v.shadowbanned) and not (v and v.admin_level > 2):
|
||||||
comments = comments.join(User, User.id == Comment.author_id).filter(User.shadowbanned == None)
|
comments = comments.join(User, User.id == Comment.author_id).filter(User.shadowbanned == None)
|
||||||
|
|
||||||
comments=comments.join(
|
comments=comments.join(
|
||||||
|
|
|
@ -12,32 +12,37 @@ def api_flag_post(pid, v):
|
||||||
|
|
||||||
post = get_post(pid)
|
post = get_post(pid)
|
||||||
|
|
||||||
if not v.shadowbanned:
|
reason = request.values.get("reason", "").strip()
|
||||||
reason = request.values.get("reason", "").strip()[:100]
|
|
||||||
|
|
||||||
if not reason.startswith('!'):
|
if blackjack and blackjack in reason.lower():
|
||||||
existing = g.db.query(Flag.post_id).filter_by(user_id=v.id, post_id=post.id).one_or_none()
|
v.shadowbanned = 'AutoJanny'
|
||||||
if existing: return "", 409
|
send_repeatable_notification(CARP_ID, f"reports on {post.permalink}")
|
||||||
|
|
||||||
reason = filter_emojis_only(reason)
|
reason = reason[:100]
|
||||||
|
|
||||||
if len(reason) > 350: return {"error": "Too long."}
|
if not reason.startswith('!'):
|
||||||
|
existing = g.db.query(Flag.post_id).filter_by(user_id=v.id, post_id=post.id).one_or_none()
|
||||||
|
if existing: return "", 409
|
||||||
|
|
||||||
if reason.startswith('!') and v.admin_level > 1:
|
reason = filter_emojis_only(reason)
|
||||||
post.flair = reason[1:]
|
|
||||||
g.db.add(post)
|
|
||||||
ma=ModAction(
|
|
||||||
kind="flair_post",
|
|
||||||
user_id=v.id,
|
|
||||||
target_submission_id=post.id,
|
|
||||||
_note=f'"{post.flair}"'
|
|
||||||
)
|
|
||||||
g.db.add(ma)
|
|
||||||
else:
|
|
||||||
flag = Flag(post_id=post.id, user_id=v.id, reason=reason)
|
|
||||||
g.db.add(flag)
|
|
||||||
|
|
||||||
g.db.commit()
|
if len(reason) > 350: return {"error": "Too long."}
|
||||||
|
|
||||||
|
if reason.startswith('!') and v.admin_level > 1:
|
||||||
|
post.flair = reason[1:]
|
||||||
|
g.db.add(post)
|
||||||
|
ma=ModAction(
|
||||||
|
kind="flair_post",
|
||||||
|
user_id=v.id,
|
||||||
|
target_submission_id=post.id,
|
||||||
|
_note=f'"{post.flair}"'
|
||||||
|
)
|
||||||
|
g.db.add(ma)
|
||||||
|
else:
|
||||||
|
flag = Flag(post_id=post.id, user_id=v.id, reason=reason)
|
||||||
|
g.db.add(flag)
|
||||||
|
|
||||||
|
g.db.commit()
|
||||||
|
|
||||||
return {"message": "Post reported!"}
|
return {"message": "Post reported!"}
|
||||||
|
|
||||||
|
@ -49,19 +54,25 @@ def api_flag_comment(cid, v):
|
||||||
|
|
||||||
comment = get_comment(cid)
|
comment = get_comment(cid)
|
||||||
|
|
||||||
if not v.shadowbanned:
|
existing = g.db.query(CommentFlag.comment_id).filter_by( user_id=v.id, comment_id=comment.id).one_or_none()
|
||||||
existing = g.db.query(CommentFlag.comment_id).filter_by( user_id=v.id, comment_id=comment.id).one_or_none()
|
if existing: return "", 409
|
||||||
if existing: return "", 409
|
|
||||||
|
|
||||||
reason = request.values.get("reason", "").strip()[:100]
|
reason = request.values.get("reason", "").strip()
|
||||||
reason = filter_emojis_only(reason)
|
|
||||||
|
|
||||||
if len(reason) > 350: return {"error": "Too long."}
|
if blackjack and blackjack in reason.lower():
|
||||||
|
v.shadowbanned = 'AutoJanny'
|
||||||
|
send_repeatable_notification(CARP_ID, f"reports on {comment.permalink}")
|
||||||
|
|
||||||
flag = CommentFlag(comment_id=comment.id, user_id=v.id, reason=reason)
|
reason = reason[:100]
|
||||||
|
|
||||||
g.db.add(flag)
|
reason = filter_emojis_only(reason)
|
||||||
g.db.commit()
|
|
||||||
|
if len(reason) > 350: return {"error": "Too long."}
|
||||||
|
|
||||||
|
flag = CommentFlag(comment_id=comment.id, user_id=v.id, reason=reason)
|
||||||
|
|
||||||
|
g.db.add(flag)
|
||||||
|
g.db.commit()
|
||||||
|
|
||||||
return {"message": "Comment reported!"}
|
return {"message": "Comment reported!"}
|
||||||
|
|
||||||
|
|
|
@ -600,8 +600,6 @@ def message2(v, username):
|
||||||
if v.admin_level <= 1 and hasattr(user, 'is_blocked') and user.is_blocked:
|
if v.admin_level <= 1 and hasattr(user, 'is_blocked') and user.is_blocked:
|
||||||
return {"error": "This user is blocking you."}, 403
|
return {"error": "This user is blocking you."}, 403
|
||||||
|
|
||||||
if v.shadowbanned and user.admin_level < 2: return {"message": "Message sent!"}
|
|
||||||
|
|
||||||
message = request.values.get("message", "").strip()[:10000].strip()
|
message = request.values.get("message", "").strip()[:10000].strip()
|
||||||
|
|
||||||
if not message: return {"error": "Message is empty!"}
|
if not message: return {"error": "Message is empty!"}
|
||||||
|
@ -629,11 +627,21 @@ def message2(v, username):
|
||||||
|
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
||||||
|
if blackjack and blackjack in c.body_html.lower():
|
||||||
|
v.shadowbanned = 'AutoJanny'
|
||||||
|
g.db.add(v)
|
||||||
|
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=CARP_ID).one_or_none()
|
||||||
|
if not notif:
|
||||||
|
notif = Notification(comment_id=c.id, user_id=CARP_ID)
|
||||||
|
g.db.add(notif)
|
||||||
|
g.db.flush()
|
||||||
|
|
||||||
c.top_comment_id = c.id
|
c.top_comment_id = c.id
|
||||||
|
|
||||||
|
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=user.id).one_or_none()
|
||||||
notif = Notification(comment_id=c.id, user_id=user.id)
|
if not notif:
|
||||||
g.db.add(notif)
|
notif = Notification(comment_id=c.id, user_id=user.id)
|
||||||
|
g.db.add(notif)
|
||||||
|
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
|
@ -688,7 +696,7 @@ def messagereply(v):
|
||||||
else: return {"error": "Image/Video files only"}, 400
|
else: return {"error": "Image/Video files only"}, 400
|
||||||
|
|
||||||
|
|
||||||
new_comment = Comment(author_id=v.id,
|
c = Comment(author_id=v.id,
|
||||||
parent_submission=None,
|
parent_submission=None,
|
||||||
parent_comment_id=id,
|
parent_comment_id=id,
|
||||||
top_comment_id=parent.top_comment_id,
|
top_comment_id=parent.top_comment_id,
|
||||||
|
@ -696,12 +704,23 @@ def messagereply(v):
|
||||||
sentto=user_id,
|
sentto=user_id,
|
||||||
body_html=body_html,
|
body_html=body_html,
|
||||||
)
|
)
|
||||||
g.db.add(new_comment)
|
g.db.add(c)
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
||||||
|
if blackjack and blackjack in c.body_html.lower():
|
||||||
|
v.shadowbanned = 'AutoJanny'
|
||||||
|
g.db.add(v)
|
||||||
|
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=CARP_ID).one_or_none()
|
||||||
|
if not notif:
|
||||||
|
notif = Notification(comment_id=c.id, user_id=CARP_ID)
|
||||||
|
g.db.add(notif)
|
||||||
|
g.db.flush()
|
||||||
|
|
||||||
if user_id and user_id != v.id and user_id != 2:
|
if user_id and user_id != v.id and user_id != 2:
|
||||||
notif = Notification(comment_id=new_comment.id, user_id=user_id)
|
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=user_id).one_or_none()
|
||||||
g.db.add(notif)
|
if not notif:
|
||||||
|
notif = Notification(comment_id=c.id, user_id=user_id)
|
||||||
|
g.db.add(notif)
|
||||||
|
|
||||||
if PUSHER_ID != 'blahblahblah':
|
if PUSHER_ID != 'blahblahblah':
|
||||||
if len(message) > 500: notifbody = message[:500] + '...'
|
if len(message) > 500: notifbody = message[:500] + '...'
|
||||||
|
@ -731,14 +750,14 @@ def messagereply(v):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
if new_comment.top_comment.sentto == 2:
|
if c.top_comment.sentto == 2:
|
||||||
admins = g.db.query(User).filter(User.admin_level > 2, User.id != v.id).all()
|
admins = g.db.query(User).filter(User.admin_level > 2, User.id != v.id).all()
|
||||||
for admin in admins:
|
for admin in admins:
|
||||||
notif = Notification(comment_id=new_comment.id, user_id=admin.id)
|
notif = Notification(comment_id=c.id, user_id=admin.id)
|
||||||
g.db.add(notif)
|
g.db.add(notif)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
return {"comment": render_template("comments.html", v=v, comments=[new_comment], ajax=True)}
|
return {"comment": render_template("comments.html", v=v, comments=[c], ajax=True)}
|
||||||
|
|
||||||
@app.get("/2faqr/<secret>")
|
@app.get("/2faqr/<secret>")
|
||||||
@auth_required
|
@auth_required
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
{% set downs=c.downvotes %}
|
{% set downs=c.downvotes %}
|
||||||
{% set score=ups-downs %}
|
{% set score=ups-downs %}
|
||||||
|
|
||||||
{% if v and (v.shadowbanned or v.admin_level > 1) %}
|
{% if v and (v.shadowbanned or v.admin_level > 2) %}
|
||||||
{% set replies=c.replies3 %}
|
{% set replies=c.replies3 %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set replies=c.replies %}
|
{% set replies=c.replies %}
|
||||||
|
@ -185,7 +185,7 @@
|
||||||
{% if c.bannedfor %}
|
{% if c.bannedfor %}
|
||||||
<a role="button"><i class="fas fa-gavel text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User was banned for this comment{% if c.author.banned_by %} by @{{c.author.banned_by.username}}{% endif %}"></i></a>
|
<a role="button"><i class="fas fa-gavel text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User was banned for this comment{% if c.author.banned_by %} by @{{c.author.banned_by.username}}{% endif %}"></i></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if c.active_flags %}<a class="btn btn-primary" style="padding:1px 5px; font-size:10px"role="button" onclick="document.getElementById('flaggers-{{c.id}}').classList.toggle('d-none')">{{c.active_flags}} Reports</a>{% endif %}
|
{% if c.active_flags(v) %}<a class="btn btn-primary" style="padding:1px 5px; font-size:10px"role="button" onclick="document.getElementById('flaggers-{{c.id}}').classList.toggle('d-none')">{{c.active_flags(v)}} Reports</a>{% endif %}
|
||||||
{% if c.over_18 %}<span class="badge badge-danger text-small-extra mr-1">+18</span>{% endif %}
|
{% if c.over_18 %}<span class="badge badge-danger text-small-extra mr-1">+18</span>{% endif %}
|
||||||
{% if v and v.admin_level > 1 and c.author.shadowbanned %}<i class="fas fa-user-times text-admin" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Shadowbanned by @{{c.author.shadowbanned}}"></i>{% endif %}
|
{% if v and v.admin_level > 1 and c.author.shadowbanned %}<i class="fas fa-user-times text-admin" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Shadowbanned by @{{c.author.shadowbanned}}"></i>{% endif %}
|
||||||
{% if c.is_pinned %}
|
{% if c.is_pinned %}
|
||||||
|
@ -246,12 +246,12 @@
|
||||||
{{c.wordle_html(v) | safe}}
|
{{c.wordle_html(v) | safe}}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% if c.active_flags %}
|
{% if c.active_flags(v) %}
|
||||||
<div id="flaggers-{{c.id}}" class="flaggers d-none">
|
<div id="flaggers-{{c.id}}" class="flaggers d-none">
|
||||||
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
|
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
|
||||||
<pre></pre>
|
<pre></pre>
|
||||||
<ul style="padding-left:20px; margin-bottom: 0;word-wrap:break-word">
|
<ul style="padding-left:20px; margin-bottom: 0;word-wrap:break-word">
|
||||||
{% for f in c.flags %}
|
{% for f in c.flags(v) %}
|
||||||
<li><a style="font-weight:bold" href="{{f.user.url}}">{{f.user.username}}</a>{% if f.reason %}: {{f.realreason(v) | safe}}{% endif %} {% if v and v.admin_level > 1 %}<a role="button" onclick="post_toast(this,'/del_report/comment/{{f.comment_id}}/{{f.user_id}}')">[remove]</a>{% endif %}</li>
|
<li><a style="font-weight:bold" href="{{f.user.url}}">{{f.user.username}}</a>{% if f.reason %}: {{f.realreason(v) | safe}}{% endif %} {% if v and v.admin_level > 1 %}<a role="button" onclick="post_toast(this,'/del_report/comment/{{f.comment_id}}/{{f.user_id}}')">[remove]</a>{% endif %}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -636,7 +636,7 @@
|
||||||
{% if p.is_bot %} <i class="fas fa-robot text-info" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Bot"></i>{% endif %}
|
{% if p.is_bot %} <i class="fas fa-robot text-info" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Bot"></i>{% endif %}
|
||||||
{% if p.over_18 %}<span class="badge badge-danger text-small-extra mr-1">+18</span>{% endif %}
|
{% if p.over_18 %}<span class="badge badge-danger text-small-extra mr-1">+18</span>{% endif %}
|
||||||
{% if p.private %}<span class="badge border-warning border-1 text-small-extra">Draft</span>{% endif %}
|
{% if p.private %}<span class="badge border-warning border-1 text-small-extra">Draft</span>{% endif %}
|
||||||
{% if p.active_flags %}<a class="btn btn-primary" role="button" style="padding:1px 5px; font-size:10px"onclick="document.getElementById('flaggers').classList.toggle('d-none')">{{p.active_flags}} Reports</a>{% endif %}
|
{% if p.active_flags(v) %}<a class="btn btn-primary" role="button" style="padding:1px 5px; font-size:10px"onclick="document.getElementById('flaggers').classList.toggle('d-none')">{{p.active_flags(v)}} Reports</a>{% endif %}
|
||||||
|
|
||||||
{% if not p.author %}
|
{% if not p.author %}
|
||||||
{{p.print()}}
|
{{p.print()}}
|
||||||
|
@ -661,12 +661,12 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{p.views}} thread views
|
{{p.views}} thread views
|
||||||
</div>
|
</div>
|
||||||
{% if p.active_flags %}
|
{% if p.active_flags(v) %}
|
||||||
<div id="flaggers" class="flaggers d-none">
|
<div id="flaggers" class="flaggers d-none">
|
||||||
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
|
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
|
||||||
<pre></pre>
|
<pre></pre>
|
||||||
<ul style="padding-left:20px; margin-bottom: 0;word-wrap:break-word">
|
<ul style="padding-left:20px; margin-bottom: 0;word-wrap:break-word">
|
||||||
{% for f in p.flags %}
|
{% for f in p.flags(v) %}
|
||||||
<li><a style="font-weight:bold" href="{{f.user.url}}">{{f.user.username}}</a>{% if f.reason %}: {{f.realreason(v) | safe}}{% endif %} {% if v and v.admin_level > 1 %}<a role="button" onclick="post_toast(this,'/del_report/post/{{f.post_id}}/{{f.user_id}}')">[remove]</a>{% endif %}</li>
|
<li><a style="font-weight:bold" href="{{f.user.url}}">{{f.user.username}}</a>{% if f.reason %}: {{f.realreason(v) | safe}}{% endif %} {% if v and v.admin_level > 1 %}<a role="button" onclick="post_toast(this,'/del_report/post/{{f.post_id}}/{{f.user_id}}')">[remove]</a>{% endif %}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -62,12 +62,12 @@
|
||||||
{% set voted=-2 %}
|
{% set voted=-2 %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if p.active_flags %}
|
{% if p.active_flags(v) %}
|
||||||
<div id="flaggers-{{p.id}}" class="flaggers d-none">
|
<div id="flaggers-{{p.id}}" class="flaggers d-none">
|
||||||
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
|
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
|
||||||
<pre></pre>
|
<pre></pre>
|
||||||
<ul style="padding-left:20px; margin-bottom: 0;word-wrap:break-word">
|
<ul style="padding-left:20px; margin-bottom: 0;word-wrap:break-word">
|
||||||
{% for f in p.flags %}
|
{% for f in p.flags(v) %}
|
||||||
<li><a style="font-weight:bold" href="{{f.user.url}}">{{f.user.username}}</a>{% if f.reason %}: {{f.realreason(v) | safe}}{% endif %} {% if v and v.admin_level > 1 %}<a role="button" onclick="post_toast(this,'/del_report/post/{{f.post_id}}/{{f.user_id}}')">[remove]</a>{% endif %}</li>
|
<li><a style="font-weight:bold" href="{{f.user.url}}">{{f.user.username}}</a>{% if f.reason %}: {{f.realreason(v) | safe}}{% endif %} {% if v and v.admin_level > 1 %}<a role="button" onclick="post_toast(this,'/del_report/post/{{f.post_id}}/{{f.user_id}}')">[remove]</a>{% endif %}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -179,7 +179,7 @@
|
||||||
{% if p.is_blocking %}<i class="fas fa-user-minus text-warning" data-bs-toggle="tooltip" data-bs-placement="bottom" title="You're blocking this user, but you can see this post because you're an admin."></i>{% endif %}
|
{% if p.is_blocking %}<i class="fas fa-user-minus text-warning" data-bs-toggle="tooltip" data-bs-placement="bottom" title="You're blocking this user, but you can see this post because you're an admin."></i>{% endif %}
|
||||||
{% if p.is_blocked %}<i class="fas fa-user-minus text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="This user is blocking you."></i>{% endif %}
|
{% if p.is_blocked %}<i class="fas fa-user-minus text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="This user is blocking you."></i>{% endif %}
|
||||||
{% if p.private %}<span class="badge border-warning border-1 text-small-extra">Draft</span>{% endif %}
|
{% if p.private %}<span class="badge border-warning border-1 text-small-extra">Draft</span>{% endif %}
|
||||||
{% if p.active_flags %}<a class="btn btn-primary" role="button" style="padding:1px 5px; font-size:10px"onclick="document.getElementById('flaggers-{{p.id}}').classList.toggle('d-none')">{{p.active_flags}} Reports</a>{% endif %}
|
{% if p.active_flags(v) %}<a class="btn btn-primary" role="button" style="padding:1px 5px; font-size:10px"onclick="document.getElementById('flaggers-{{p.id}}').classList.toggle('d-none')">{{p.active_flags(v)}} Reports</a>{% endif %}
|
||||||
|
|
||||||
{% if not p.author %}
|
{% if not p.author %}
|
||||||
{{p.print()}}
|
{{p.print()}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue