remotes/1693045480750635534/spooky-22
Aevann1 2021-07-30 07:31:38 +02:00
parent 0337be51f7
commit b64c34519c
28 changed files with 315 additions and 363 deletions

View File

@ -29,7 +29,7 @@ class OauthApp(Base, Stndrd):
@property
def permalink(self):
return f"/admin/app/{self.base36id}"
return f"/admin/app/{self.id}"
def idlist(self, page=1, **kwargs):

View File

@ -90,7 +90,7 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing):
@property
@lazy
def fullname(self):
return f"t3_{self.base36id}"
return f"t3_{self.id}"
@property
@lazy
@ -162,7 +162,7 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing):
'permalink': self.permalink,
'is_pinned': self.is_pinned,
'distinguish_level': self.distinguish_level,
'post_id': self.post.base36id,
'post_id': self.post.id,
'score': self.score_fuzzed,
'upvotes': self.upvotes_fuzzed,
'downvotes': self.downvotes_fuzzed,
@ -182,15 +182,15 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing):
if self.is_banned:
data= {'is_banned': True,
'ban_reason': self.ban_reason,
'id': self.base36id,
'post': self.post.base36id,
'id': self.id,
'post': self.post.id,
'level': self.level,
'parent': self.parent_fullname
}
elif self.deleted_utc > 0:
data= {'deleted_utc': self.deleted_utc,
'id': self.base36id,
'post': self.post.base36id,
'id': self.id,
'post': self.post.id,
'level': self.level,
'parent': self.parent_fullname
}
@ -198,8 +198,7 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing):
data=self.json_raw
if self.level>=2:
data['parent_comment_id']= base36encode(self.parent_comment_id),
if self.level>=2: data['parent_comment_id']= self.parent_comment_id,
if "replies" in self.__dict__:
data['replies']=[x.json_core for x in self.replies]

View File

@ -33,7 +33,7 @@ class ModAction(Base, Stndrd, Age_times):
super().__init__(*args, **kwargs)
def __repr__(self):
return f"<ModAction(id={self.base36id})>"
return f"<ModAction(id={self.id})>"
@property
def actiontype(self):
@ -80,21 +80,21 @@ class ModAction(Base, Stndrd, Age_times):
@property
def json(self):
data={
"id":self.base36id,
"id":self.id,
"kind": self.kind,
"created_utc": self.created_utc,
"mod": self.user.username,
}
if self.target_user_id:
data["target_user_id"]=self.target_user.base36id
data["target_user_id"]=self.target_user.id
data["target_user"]=self.target_user.username
if self.target_comment_id:
data["target_comment_id"]=self.target_comment.base36id
data["target_comment_id"]=self.target_comment.id
if self.target_submission_id:
data["target_submission_id"]=self.target_submission.base36id
data["target_submission_id"]=self.target_submission.id
if self._note:
data["note"]=self._note
@ -114,7 +114,7 @@ class ModAction(Base, Stndrd, Age_times):
@property
def permalink(self):
return f"/log/{self.base36id}"
return f"/log/{self.id}"
@property
def title_text(self):
return f"@{self.user.username} {self.actiontype['title'].format(self=self)}"

View File

@ -116,7 +116,7 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing):
@property
@lazy
def fullname(self):
return f"t2_{self.base36id}"
return f"t2_{self.id}"
@property
@lazy
@ -254,14 +254,14 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing):
return {'is_banned': True,
'deleted_utc': self.deleted_utc,
'ban_reason': self.ban_reason,
'id': self.base36id,
'id': self.id,
'title': self.title,
'permalink': self.permalink,
}
elif self.deleted_utc:
return {'is_banned': bool(self.is_banned),
'deleted_utc': True,
'id': self.base36id,
'id': self.id,
'title': self.title,
'permalink': self.permalink,
}

View File

@ -233,13 +233,9 @@ class User(Base, Stndrd, Age_times):
secondrange = firstrange + 26
return [x.id for x in comments[firstrange:secondrange]]
@property
def base36id(self):
return base36encode(self.id)
@property
def fullname(self):
return f"t1_{self.base36id}"
return f"t1_{self.id}"
@property
def banned_by(self):
@ -447,7 +443,7 @@ class User(Base, Stndrd, Age_times):
'url': self.url,
'is_banned': bool(self.is_banned),
'created_utc': self.created_utc,
'id': self.base36id,
'id': self.id,
'is_private': self.is_private,
'profile_url': self.profile_url,
'banner_url': self.banner_url,
@ -468,7 +464,7 @@ class User(Base, Stndrd, Age_times):
'is_banned': True,
'is_permanent_ban': not bool(self.unban_utc),
'ban_reason': self.ban_reason,
'id': self.base36id
'id': self.id
}
return self.json_raw

View File

@ -1,34 +1,3 @@
from flask import abort
def base36encode(number, alphabet='0123456789abcdefghijklmnopqrstuvwxyz'):
"""Converts an integer to a base36 string."""
if not isinstance(number, int):
raise TypeError('number must be an integer')
base36 = ''
sign = ''
if number < 0:
sign = '-'
number = -number
if 0 <= number < len(alphabet):
return sign + alphabet[number]
while number != 0:
number, i = divmod(number, len(alphabet))
base36 = alphabet[i] + base36
return sign + base36
def base36decode(number):
try:
return int(str(number), 36)
except ValueError:
abort(400)
def hex2bin(hexstr):
value = int(hexstr, 16)
bindigits = []

View File

@ -44,11 +44,7 @@ def get_user(username, v=None, graceful=False):
return user
def get_account(base36id, v=None, graceful=False):
if isinstance(base36id, str): id = base36decode(base36id)
else: id = base36id
def get_account(id, v=None, graceful=False):
user = g.db.query(User
).filter(
@ -80,12 +76,7 @@ def get_account(base36id, v=None, graceful=False):
return user
def get_post(pid, v=None, graceful=False, **kwargs):
if isinstance(pid, str):
i = base36decode(pid)
else:
i = pid
def get_post(i, v=None, graceful=False, **kwargs):
if v:
vt = g.db.query(Vote).filter_by(
@ -177,10 +168,7 @@ def get_posts(pids, v=None):
return sorted(output, key=lambda x: pids.index(x.id))
def get_comment(cid, v=None, graceful=False, **kwargs):
if isinstance(cid, str): i = base36decode(cid)
else: i = cid
def get_comment(i, v=None, graceful=False, **kwargs):
if v:
blocking = v.blocking.subquery()

View File

@ -87,7 +87,7 @@ class CustomRenderer(HTMLRenderer):
if not user: return f"{space}@{target}"
return f'{space}<a href="{user.url}" class="d-inline-block mention-user" data-original-name="{user.original_username}"><img src="/uid/{user.base36id}/pic/profile" class="profile-pic-20 mr-1">@{user.username}</a>'
return f'{space}<a href="{user.url}" class="d-inline-block mention-user" data-original-name="{user.original_username}"><img src="/uid/{user.id}/pic/profile" class="profile-pic-20 mr-1">@{user.username}</a>'
def render_sub_mention(self, token):
space = token.target[0]

View File

@ -725,7 +725,7 @@ def unban_user(user_id, v):
@validate_formkey
def ban_post(post_id, v):
post = g.db.query(Submission).filter_by(id=base36decode(post_id)).first()
post = g.db.query(Submission).filter_by(id=post_id).first()
if not post:
abort(400)
@ -761,7 +761,7 @@ def ban_post(post_id, v):
@validate_formkey
def unban_post(post_id, v):
post = g.db.query(Submission).filter_by(id=base36decode(post_id)).first()
post = g.db.query(Submission).filter_by(id=post_id).first()
if not post:
abort(400)
@ -789,7 +789,7 @@ def unban_post(post_id, v):
@validate_formkey
def api_distinguish_post(post_id, v):
post = g.db.query(Submission).filter_by(id=base36decode(post_id)).first()
post = g.db.query(Submission).filter_by(id=post_id).first()
if not post:
abort(404)
@ -811,7 +811,7 @@ def api_distinguish_post(post_id, v):
@admin_level_required(3)
def api_sticky_post(post_id, v):
post = g.db.query(Submission).filter_by(id=base36decode(post_id)).first()
post = g.db.query(Submission).filter_by(id=post_id).first()
if post:
post.stickied = not (post.stickied)
g.db.add(post)
@ -824,7 +824,7 @@ def api_sticky_post(post_id, v):
@auth_required
def api_pin_post(post_id, v):
post = g.db.query(Submission).filter_by(id=base36decode(post_id)).first()
post = g.db.query(Submission).filter_by(id=post_id).first()
if post:
post.is_pinned = not (post.is_pinned)
g.db.add(post)
@ -835,7 +835,7 @@ def api_pin_post(post_id, v):
@admin_level_required(1)
def api_ban_comment(c_id, v):
comment = g.db.query(Comment).filter_by(id=base36decode(c_id)).first()
comment = g.db.query(Comment).filter_by(id=c_id).first()
if not comment:
abort(404)
@ -856,7 +856,7 @@ def api_ban_comment(c_id, v):
@admin_level_required(1)
def api_unban_comment(c_id, v):
comment = g.db.query(Comment).filter_by(id=base36decode(c_id)).first()
comment = g.db.query(Comment).filter_by(id=c_id).first()
if not comment:
abort(404)
g.db.add(comment)
@ -900,7 +900,7 @@ def admin_distinguish_comment(c_id, v):
render_replies=False,
)
html=str(BeautifulSoup(html, features="html.parser").find(id=f"comment-{comment.base36id}-only"))
html=str(BeautifulSoup(html, features="html.parser").find(id=f"comment-{comment.id}-only"))
return jsonify({"html":html, "api":html})

View File

@ -237,7 +237,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
@api("create")
def api_comment(v):
parent_submission = base36decode(request.form.get("submission"))
parent_submission = request.form.get("submission")
parent_fullname = request.form.get("parent_fullname")
# get parent item info
@ -247,14 +247,14 @@ def api_comment(v):
parent = parent_post
parent_comment_id = None
level = 1
parent_submission = base36decode(parent_id)
parent_submission = parent_id
elif parent_fullname.startswith("t3"):
parent = get_comment(parent_id, v=v)
parent_comment_id = parent.id
level = parent.level + 1
parent_id = parent.parent_submission
parent_submission = parent_id
parent_post = get_post(base36encode(parent_id))
parent_post = get_post(parent_id)
else:
abort(400)
@ -389,7 +389,7 @@ def api_comment(v):
if not file.content_type.startswith('image/'):
return jsonify({"error": "That wasn't an image!"}), 400
name = f'comment/{c.base36id}/{secrets.token_urlsafe(8)}'
name = f'comment/{c.id}/{secrets.token_urlsafe(8)}'
url = upload_file(file)
body = request.form.get("body") + f"\n![]({url})"
@ -653,7 +653,7 @@ def edit_comment(cid, v):
body = request.form.get("body", "")[0:10000]
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF))', body, re.MULTILINE): body = body.replace(i.group(1), f'![]({i.group(1)})')
body = body.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n")
with CustomRenderer(post_id=c.post.base36id) as renderer: body_md = renderer.render(mistletoe.Document(body))
with CustomRenderer(post_id=c.post.id) as renderer: body_md = renderer.render(mistletoe.Document(body))
body_html = sanitize(body_md, linkgen=True)
bans = filter_comment_html(body_html)
@ -672,7 +672,7 @@ def edit_comment(cid, v):
reason += f" {ban.reason_text}"
return {'html': lambda: render_template("comment_failed.html",
action=f"/edit_comment/{c.base36id}",
action=f"/edit_comment/{c.id}",
badlinks=[
x.domain for x in bans],
body=body,
@ -744,7 +744,7 @@ def edit_comment(cid, v):
file=request.files["file"]
if not file.content_type.startswith('image/'): return jsonify({"error": "That wasn't an image!"}), 400
name = f'comment/{c.base36id}/{secrets.token_urlsafe(8)}'
name = f'comment/{c.id}/{secrets.token_urlsafe(8)}'
url = upload_file(file)
body += f"\n![]({url})"
@ -837,7 +837,7 @@ def edit_comment(cid, v):
@api("delete")
def delete_comment(cid, v):
c = g.db.query(Comment).filter_by(id=base36decode(cid)).first()
c = g.db.query(Comment).filter_by(id=cid).first()
if not c:
abort(404)
@ -862,7 +862,7 @@ def delete_comment(cid, v):
@api("delete")
def undelete_comment(cid, v):
c = g.db.query(Comment).filter_by(id=base36decode(cid)).first()
c = g.db.query(Comment).filter_by(id=cid).first()
if not c:
abort(404)
@ -927,7 +927,7 @@ def toggle_comment_pin(cid, v):
render_replies=False,
)
html=str(BeautifulSoup(html, features="html.parser").find(id=f"comment-{comment.base36id}-only"))
html=str(BeautifulSoup(html, features="html.parser").find(id=f"comment-{comment.id}-only"))
return jsonify({"html":html})

View File

@ -540,7 +540,7 @@ def request_2fa_disable():
valid=int(time.time())
token=generate_hash(f"{user.id}+{user.username}+disable2fa+{valid}+{user.mfa_secret}+{user.login_nonce}")
action_url=f"https://{app.config['SERVER_NAME']}/reset_2fa?id={user.base36id}&t={valid}&token={token}"
action_url=f"https://{app.config['SERVER_NAME']}/reset_2fa?id={user.id}&t={valid}&token={token}"
send_mail(to_address=user.email,
subject="Drama - 2FA Removal Request",

View File

@ -287,7 +287,7 @@ def api_v1_identity(v):
@validate_formkey
def admin_app_approve(v, aid):
app = g.db.query(OauthApp).filter_by(id=base36decode(aid)).first()
app = g.db.query(OauthApp).filter_by(id=aid).first()
app.client_id = secrets.token_urlsafe(64)[0:64]
app.client_secret = secrets.token_urlsafe(128)[0:128]
@ -305,7 +305,7 @@ def admin_app_approve(v, aid):
@validate_formkey
def admin_app_revoke(v, aid):
app = g.db.query(OauthApp).filter_by(id=base36decode(aid)).first()
app = g.db.query(OauthApp).filter_by(id=aid).first()
app.client_id = None
app.client_secret = None
@ -323,7 +323,7 @@ def admin_app_revoke(v, aid):
@validate_formkey
def admin_app_reject(v, aid):
app = g.db.query(OauthApp).filter_by(id=base36decode(aid)).first()
app = g.db.query(OauthApp).filter_by(id=aid).first()
for auth in g.db.query(ClientAuth).filter_by(oauth_client=app.id).all():
g.db.delete(auth)
@ -341,7 +341,7 @@ def admin_app_reject(v, aid):
@admin_level_required(3)
def admin_app_id(v, aid):
aid=base36decode(aid)
aid=aid
oauth = g.db.query(OauthApp).options(
joinedload(
@ -367,7 +367,7 @@ def admin_app_id(v, aid):
@admin_level_required(3)
def admin_app_id_comments(v, aid):
aid=base36decode(aid)
aid=aid
oauth = g.db.query(OauthApp).options(
joinedload(
@ -409,7 +409,7 @@ def admin_apps_list(v):
@auth_required
def reroll_oauth_tokens(aid, v):
aid = base36decode(aid)
aid = aid
a = g.db.query(OauthApp).filter_by(id=aid).first()
@ -433,7 +433,7 @@ def reroll_oauth_tokens(aid, v):
@validate_formkey
def oauth_rescind_app(aid, v):
aid = base36decode(aid)
aid = aid
auth = g.db.query(ClientAuth).filter_by(id=aid).first()
if auth.user_id != v.id:

View File

@ -77,7 +77,7 @@ def submit_get(v):
@app.get("/api/v1/post/<pid>")
@auth_desired
@api("read")
def post_base36id(pid, anything=None, v=None):
def post_id(pid, anything=None, v=None):
try: pid = int(pid)
except Exception as e: pass
@ -405,7 +405,7 @@ def get_post_title(v):
return jsonify({"error": f"Could not find a title"}), 400
def thumbs(new_post):
pid = new_post.base36id
pid = new_post.id
post = get_post(pid, graceful=True, session=g.db)
if not post:
# account for possible follower lag
@ -921,7 +921,7 @@ def submit_post(v):
"api": lambda: ({"error": f"Image files only"}, 400)
}
name = f'post/{new_post.base36id}/{secrets.token_urlsafe(8)}'
name = f'post/{new_post.id}/{secrets.token_urlsafe(8)}'
new_post.url = upload_file(file)
new_post.domain_ref = 1 # id of i.ruqqus.ga domain
g.db.add(new_post)
@ -1087,7 +1087,7 @@ def embed_post_pid(pid):
@validate_formkey
def toggle_comment_nsfw(cid, v):
comment = g.db.query(Comment).filter_by(id=base36decode(cid)).first()
comment = g.db.query(Comment).filter_by(id=cid).first()
if not comment.author_id == v.id and not v.admin_level >= 3: abort(403)
comment.over_18 = not comment.over_18
g.db.add(comment)

View File

@ -44,7 +44,7 @@ def log(v):
@auth_desired
def log_item(aid, v):
action=g.db.query(ModAction).filter_by(id=base36decode(aid)).first()
action=g.db.query(ModAction).filter_by(id=aid).first()
if not action:
abort(404)

View File

@ -96,7 +96,7 @@ def api_vote_post(post_id, new, v):
g.db.add(post.author)
vote = Vote(user_id=v.id,
vote_type=new,
submission_id=base36decode(post_id),
submission_id=post_id,
app_id=v.client.application.id if v.client else None
)
g.db.add(vote)
@ -143,7 +143,7 @@ def api_vote_comment(comment_id, new, v):
g.db.add(comment.author)
vote = CommentVote(user_id=v.id,
vote_type=new,
comment_id=base36decode(comment_id),
comment_id=comment_id,
app_id=v.client.application.id if v.client else None
)

View File

@ -34,12 +34,12 @@
<div class="d-flex">
{% if not app.client_secret%}
<a href="javascript:void(0)" class="btn btn-primary ml-auto" onclick="post_toast('/admin/app/approve/{{app.base36id}}')">Approve</a>
<a href="javascript:void(0)" class="btn btn-secondary mr-0" onclick="post_toast('/admin/app/reject/{{app.base36id}}')">Reject</a>
<a href="javascript:void(0)" class="btn btn-primary ml-auto" onclick="post_toast('/admin/app/approve/{{app.id}}')">Approve</a>
<a href="javascript:void(0)" class="btn btn-secondary mr-0" onclick="post_toast('/admin/app/reject/{{app.id}}')">Reject</a>
{% else %}
<a href="javascript:void(0)" class="btn btn-primary ml-auto" onclick="post_toast('/admin/app/revoke/{{app.base36id}}')">Revoke</a>
<a href="javascript:void(0)" class="btn btn-primary ml-auto" onclick="post_toast('/admin/app/revoke/{{app.id}}')">Revoke</a>
{% endif %}
</div>
</div>

View File

@ -52,12 +52,12 @@
<div class="d-flex">
{% if not thing.oauth_app.client_secret %}
<a href="javascript:void(0)" class="btn btn-primary ml-auto" onclick="post_toast('/admin/app/approve/{{thing.oauth_app.base36id}}')">Approve</a>
<a href="javascript:void(0)" class="btn btn-secondary mr-0" onclick="post_toast('/admin/app/reject/{{thing.oauth_app.base36id}}')">Reject</a>
<a href="javascript:void(0)" class="btn btn-primary ml-auto" onclick="post_toast('/admin/app/approve/{{thing.oauth_app.id}}')">Approve</a>
<a href="javascript:void(0)" class="btn btn-secondary mr-0" onclick="post_toast('/admin/app/reject/{{thing.oauth_app.id}}')">Reject</a>
{% else %}
<a href="javascript:void(0)" class="btn btn-primary ml-auto" onclick="post_toast('/admin/app/revoke/{{thing.oauth_app.base36id}}')">Revoke</a>
<a href="javascript:void(0)" class="btn btn-primary ml-auto" onclick="post_toast('/admin/app/revoke/{{thing.oauth_app.id}}')">Revoke</a>
{% endif %}
</div>

View File

@ -39,12 +39,12 @@
<div class="d-flex">
{% if not app.client_secret %}
<a href="javascript:void(0)" class="btn btn-primary ml-auto" onclick="post_toast('/admin/app/approve/{{app.base36id}}')">Approve</a>
<a href="javascript:void(0)" class="btn btn-secondary mr-0" onclick="post_toast('/admin/app/reject/{{app.base36id}}')">Reject</a>
<a href="javascript:void(0)" class="btn btn-primary ml-auto" onclick="post_toast('/admin/app/approve/{{app.id}}')">Approve</a>
<a href="javascript:void(0)" class="btn btn-secondary mr-0" onclick="post_toast('/admin/app/reject/{{app.id}}')">Reject</a>
{% else %}
<a href="javascript:void(0)" class="btn btn-primary ml-auto" onclick="post_toast('/admin/app/revoke/{{app.base36id}}')">Revoke</a>
<a href="javascript:void(0)" class="btn btn-primary ml-auto" onclick="post_toast('/admin/app/revoke/{{app.id}}')">Revoke</a>
{% endif %}
</div>

View File

@ -17,17 +17,17 @@
<div id="comment-{{c.base36id}}" class="comment">
<div id="comment-{{c.id}}" class="comment">
<span class="comment-collapse-desktop d-none d-md-block" style="border-left: 2px solid #{{c.author.namecolor}};" onclick="collapse_comment('{{c.base36id}}')"></span>
<span class="comment-collapse-desktop d-none d-md-block" style="border-left: 2px solid #{{c.author.namecolor}};" onclick="collapse_comment('{{c.id}}')"></span>
<div class="comment-body">
<div id="comment-{{c.base36id}}-only" class="">
<div id="comment-{{c.id}}-only" class="">
<div class="user-info">
<span class="comment-collapse d-md-none" onclick="collapse_comment('{{c.base36id}}')"></span>
<span class="comment-collapse d-md-none" onclick="collapse_comment('{{c.id}}')"></span>
{% if standalone and c.over_18 %}<span class="badge badge-danger">+18</span> {% endif %}
[{% if c.is_banned %}Removed by admins{% elif c.deleted_utc > 0 %}Deleted by author{% elif c.is_blocking %}You are blocking @{{c.author.username}}{% elif c.is_blocked %}This user has blocked you{% endif %}]
</div>
@ -42,20 +42,20 @@
{% if render_replies %}
{% if level<6 %}
<div id="replies-of-{{c.base36id}}" class="">
<div id="replies-of-{{c.id}}" class="">
{% set standalone=False %}
{% for reply in c.children(v) %}
{{single_comment(reply, level=level+1)}}
{% endfor %}
</div>
{% elif c.children(v) %}
<div id="replies-of-{{c.base36id}}" class="d-none d-md-block">
<div id="replies-of-{{c.id}}" class="d-none d-md-block">
{% set standalone=False %}
{% for reply in c.children(v) %}
{{single_comment(reply, level=level+1)}}
{% endfor %}
</div>
<div id="morecomment-{{c.base36id}}" class="d-block d-md-none mt-2 more-comments text-small">
<div id="morecomment-{{c.id}}" class="d-block d-md-none mt-2 more-comments text-small">
<a href="{{c.permalink}}"{% if c.author.is_private %} rel="nofollow"{% endif %}>More comments <i class="fas fa-long-arrow-right ml-1"></i></a>
</div>
{% endif %}
@ -101,16 +101,16 @@
</div>
{% endif %}
<div id="comment-{{c.base36id}}" class="comment {% if standalone and level==1 %} mt-0{% endif %}{% if c.collapse_for_user(v) or (standalone and c.over_18 and not (v and v.over_18)) %} collapsed{% endif %}" style="border-left: 2px solid #{{c.author.namecolor}};">
<div id="comment-{{c.id}}" class="comment {% if standalone and level==1 %} mt-0{% endif %}{% if c.collapse_for_user(v) or (standalone and c.over_18 and not (v and v.over_18)) %} collapsed{% endif %}" style="border-left: 2px solid #{{c.author.namecolor}};">
<span class="comment-collapse-desktop d-none d-md-block" style="border-left: 2px solid #{{c.author.namecolor}};" onclick="collapse_comment('{{c.base36id}}')"></span>
<span class="comment-collapse-desktop d-none d-md-block" style="border-left: 2px solid #{{c.author.namecolor}};" onclick="collapse_comment('{{c.id}}')"></span>
<div class="comment-body">
<div id="{% if comment_info and comment_info.id == c.id %}context{%else%}comment-{{c.base36id}}-only{% endif %}" class="{% if comment_info and comment_info.id == c.id %}context{%endif%}{% if c.is_banned %} banned{% endif %}{% if c.deleted_utc %} deleted{% endif %}">
<div id="{% if comment_info and comment_info.id == c.id %}context{%else%}comment-{{c.id}}-only{% endif %}" class="{% if comment_info and comment_info.id == c.id %}context{%endif%}{% if c.is_banned %} banned{% endif %}{% if c.deleted_utc %} deleted{% endif %}">
<div class="user-info">
<span class="comment-collapse d-md-none" onclick="collapse_comment('{{c.base36id}}')"></span>
<span class="comment-collapse d-md-none" onclick="collapse_comment('{{c.id}}')"></span>
{% if c.banaward %} <i class="fas fa-gavel text-danger" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="Given the 1-day ban award by @{{c.banaward}}"></i>&nbsp;{% endif %}
{% if c.flags %}&nbsp;<a class="btn btn-primary" style="padding:1px 5px; font-size:10px;" href="javascript:void(0)" onclick="document.getElementById('flaggers-{{c.id}}').classList.toggle('d-none')">{{c.active_flags}} Reports</a>&nbsp;{% endif %}
{% if c.over_18 %}<span class="badge badge-danger text-small-extra mr-1">+18</span>&nbsp;{% endif %}
@ -141,24 +141,24 @@
<div id="comment-banned-warning" class="comment-text text-danger text-small mb-0">Reason: {{c.ban_reason}}</div>
{% endif %}
<div id="comment-text-{{c.base36id}}" class="comment-text mb-0">
<div id="comment-text-{{c.id}}" class="comment-text mb-0">
{{c.realbody(v) | safe}}
{% if not c.parent_submission and c.author_id!=1046 and c.author_id!=2360 and c.author_id!=v.id %}
<a class="btn btn-primary" href="javascript:void(0)" onclick="document.getElementById('reply-to-{{c.base36id}}').classList.toggle('d-none')">Reply</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="document.getElementById('reply-to-{{c.id}}').classList.toggle('d-none')">Reply</a>
<pre></pre>
<form class="d-none" id="reply-to-{{c.base36id}}" action="/@{{c.author.username}}/reply/{{c.id}}" method="post">
<textarea id="input-message-{{c.base36id}}" form="reply-to-{{c.base36id}}" name="message" rows="3" class="form-control" required></textarea>
<form class="d-none" id="reply-to-{{c.id}}" action="/@{{c.author.username}}/reply/{{c.id}}" method="post">
<textarea id="input-message-{{c.id}}" form="reply-to-{{c.id}}" name="message" rows="3" class="form-control" required></textarea>
<pre></pre>
<pre class="btn btn-secondary format d-inline-block m-0 fas fa-bold" aria-hidden="true" onclick="makeBold('input-message-{{c.base36id}}')" data-toggle="tooltip" data-placement="bottom" title="Bold"></pre>
<pre class="btn btn-secondary format d-inline-block m-0 fas fa-bold" aria-hidden="true" onclick="makeBold('input-message-{{c.id}}')" data-toggle="tooltip" data-placement="bottom" title="Bold"></pre>
&nbsp;
<pre class="btn btn-secondary format d-inline-block m-0 fas fa-italic" aria-hidden="true" onclick="makeItalics('input-message-{{c.base36id}}')" data-toggle="tooltip" data-placement="bottom" title="Italicize"></pre>
<pre class="btn btn-secondary format d-inline-block m-0 fas fa-italic" aria-hidden="true" onclick="makeItalics('input-message-{{c.id}}')" data-toggle="tooltip" data-placement="bottom" title="Italicize"></pre>
&nbsp;
<pre class="btn btn-secondary format d-inline-block m-0 fas fa-quote-right" aria-hidden="true" onclick="makeQuote('input-message-{{c.base36id}}')" data-toggle="tooltip" data-placement="bottom" title="Quote"></pre>
<pre class="btn btn-secondary format d-inline-block m-0 fas fa-quote-right" aria-hidden="true" onclick="makeQuote('input-message-{{c.id}}')" data-toggle="tooltip" data-placement="bottom" title="Quote"></pre>
&nbsp;
<pre style="line-height:1;" class="btn btn-secondary format d-inline-block m-0 font-weight-bolder text-uppercase" onclick="commentForm('input-message-{{c.base36id}}');getGif()" aria-hidden="true" data-toggle="modal" data-target="#gifModal" data-toggle="tooltip" data-placement="bottom" title="Add GIF">GIF</pre>
<pre style="line-height:1;" class="btn btn-secondary format d-inline-block m-0 font-weight-bolder text-uppercase" onclick="commentForm('input-message-{{c.id}}');getGif()" aria-hidden="true" data-toggle="modal" data-target="#gifModal" data-toggle="tooltip" data-placement="bottom" title="Add GIF">GIF</pre>
&nbsp;
<pre class="btn btn-secondary format d-inline-block m-0 fas fa-smile-beam" onclick="loadEmojis('input-message-{{c.base36id}}')" aria-hidden="true" data-toggle="modal" data-target="#emojiModal" data-toggle="tooltip" data-placement="bottom" title="Add Emoji"></pre>
<pre class="btn btn-secondary format d-inline-block m-0 fas fa-smile-beam" onclick="loadEmojis('input-message-{{c.id}}')" aria-hidden="true" data-toggle="modal" data-target="#emojiModal" data-toggle="tooltip" data-placement="bottom" title="Add Emoji"></pre>
&nbsp;
<input type="submit" value="Submit" class="btn btn-primary mt-3">
</form>
@ -167,26 +167,26 @@
{% if c.parent_submission %}
{% if v and v.id==c.author_id %}
<div id="comment-edit-{{c.base36id}}" class="d-none comment-write collapsed child">
<form id="comment-edit-form-{{c.base36id}}" action="/edit_comment/{{c.base36id}}" method="post" class="input-group" enctype="multipart/form-data">
<div id="comment-edit-{{c.id}}" class="d-none comment-write collapsed child">
<form id="comment-edit-form-{{c.id}}" action="/edit_comment/{{c.id}}" method="post" class="input-group" enctype="multipart/form-data">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<textarea id="comment-edit-body-{{c.base36id}}" name="body" form="comment-edit-form-{{c.base36id}}" class="comment-box form-control rounded" id="edit-box-comment-{{c.base36id}}" aria-label="With textarea" placeholder="Add your comment..." rows="3">{{c.body}}</textarea>
<textarea id="comment-edit-body-{{c.id}}" name="body" form="comment-edit-form-{{c.id}}" class="comment-box form-control rounded" id="edit-box-comment-{{c.id}}" aria-label="With textarea" placeholder="Add your comment..." rows="3">{{c.body}}</textarea>
<div class="comment-format">
<small class="btn btn-secondary format d-inline-block m-0"><span class="font-weight-bolder text-uppercase" aria-hidden="true" onclick="commentForm('comment-edit-body-{{c.base36id}}');getGif()" data-toggle="modal" data-target="#gifModal" data-toggle="tooltip" data-placement="bottom" title="Add GIF">GIF</span></small>
<small class="btn btn-secondary format d-inline-block m-0"><span class="font-weight-bolder text-uppercase" aria-hidden="true" onclick="commentForm('comment-edit-body-{{c.id}}');getGif()" data-toggle="modal" data-target="#gifModal" data-toggle="tooltip" data-placement="bottom" title="Add GIF">GIF</span></small>
&nbsp;
<small class="btn btn-secondary format d-inline-block m-0"><i class="fas fa-smile-beam" aria-hidden="true" onclick="loadEmojis('comment-edit-body-{{c.base36id}}')" data-toggle="modal" data-target="#emojiModal" data-toggle="tooltip" data-placement="bottom" title="Add Emoji"></i></small>
<small class="btn btn-secondary format d-inline-block m-0"><i class="fas fa-smile-beam" aria-hidden="true" onclick="loadEmojis('comment-edit-body-{{c.id}}')" data-toggle="modal" data-target="#emojiModal" data-toggle="tooltip" data-placement="bottom" title="Add Emoji"></i></small>
&nbsp;
<label class="btn btn-secondary format d-inline-block m-0" for="file-edit-reply-{{c.base36id}}">
<div id="filename-edit-reply-{{c.base36id}}"><i class="far fa-image"></i></div>
<input id="file-edit-reply-{{c.base36id}}" type="file" name="file" accept="image/*" onchange="document.getElementById('filename-edit-reply-{{c.base36id}}').innerHTML='image';" hidden>
<label class="btn btn-secondary format d-inline-block m-0" for="file-edit-reply-{{c.id}}">
<div id="filename-edit-reply-{{c.id}}"><i class="far fa-image"></i></div>
<input id="file-edit-reply-{{c.id}}" type="file" name="file" accept="image/*" onchange="document.getElementById('filename-edit-reply-{{c.id}}').innerHTML='image';" hidden>
</label>
<a id="cancel-edit-{{c.base36id}}" href="javascript:void(0)" onclick="toggleEdit('{{c.base36id}}')" class="d-none d-md-block btn btn-link text-muted ml-auto cancel-form">Cancel</a>
<a href="javascript:void(0)" form="comment-edit-form-{{c.base36id}}" class="d-none d-md-block btn btn-primary ml-2" onclick="comment_edit('{{c.base36id}}')">Save Edit</a>
<a id="cancel-edit-{{c.id}}" href="javascript:void(0)" onclick="toggleEdit('{{c.id}}')" class="d-none d-md-block btn btn-link text-muted ml-auto cancel-form">Cancel</a>
<a href="javascript:void(0)" form="comment-edit-form-{{c.id}}" class="d-none d-md-block btn btn-primary ml-2" onclick="comment_edit('{{c.id}}')">Save Edit</a>
</div>
<a id="cancel-edit-{{c.base36id}}" href="javascript:void(0)" onclick="toggleEdit('{{c.base36id}}')" class="d-block d-md-none btn btn-link text-muted ml-auto cancel-form">Cancel</a>
<a href="javascript:void(0)" form="comment-edit-form-{{c.base36id}}" class="d-block d-md-none btn btn-primary ml-2" onclick="comment_edit('{{c.base36id}}')">Save Edit</a>
<a id="cancel-edit-{{c.id}}" href="javascript:void(0)" onclick="toggleEdit('{{c.id}}')" class="d-block d-md-none btn btn-link text-muted ml-auto cancel-form">Cancel</a>
<a href="javascript:void(0)" form="comment-edit-form-{{c.id}}" class="d-block d-md-none btn btn-primary ml-2" onclick="comment_edit('{{c.id}}')">Save Edit</a>
</form>
</div>
{% endif %}
@ -203,43 +203,43 @@
</div>
{% endif %}
<div id="comment-{{c.base36id}}-actions" class="comment-actions{% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}">
<div id="comment-{{c.id}}-actions" class="comment-actions{% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}">
<ul class="list-inline text-right text-md-left">
{% if v and request.path.startswith('/@') and v.admin_level == 0%}
{% if voted==1 %}
<li class="list-inline-item arrow-up d-none d-md-inline-block mr-2 comment-{{c.base36id}}-up active"></li>
<li class="list-inline-item arrow-up d-none d-md-inline-block mr-2 comment-{{c.id}}-up active"></li>
{% endif %}
{% elif v %}
<li id="comment-{{c.base36id}}-up" tabindex="0" class="list-inline-item arrow-up upvote-button d-none d-md-inline-block mr-2 comment-{{c.base36id}}-up {% if voted==1 %}active{% endif %}" data-id-up="{{c.base36id}}" data-content-type="comment">
<li id="comment-{{c.id}}-up" tabindex="0" class="list-inline-item arrow-up upvote-button d-none d-md-inline-block mr-2 comment-{{c.id}}-up {% if voted==1 %}active{% endif %}" data-id-up="{{c.id}}" data-content-type="comment">
</li>
{% else %}
<li id="comment-{{c.base36id}}-up" tabindex="0" class="list-inline-item arrow-up d-none d-md-inline-block mr-2" onclick="location.href='/login';">
<li id="comment-{{c.id}}-up" tabindex="0" class="list-inline-item arrow-up d-none d-md-inline-block mr-2" onclick="location.href='/login';">
</li>
{% endif %}
<li class="list-inline-item d-none d-md-inline-block mr-2">
<span class="points" data-toggle="tooltip" data-placement="top" data-original-title="+{{ups}} | -{{downs}}"><span id="comment-score-{{c.base36id}}" class="score comment-score-{{c.base36id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}">{{score}}</span></span>
<span class="points" data-toggle="tooltip" data-placement="top" data-original-title="+{{ups}} | -{{downs}}"><span id="comment-score-{{c.id}}" class="score comment-score-{{c.id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}">{{score}}</span></span>
</li>
{% if v and request.path.startswith('/@') and v.admin_level == 0 %}
{% if voted==-1 %}
<li class="list-inline-item arrow-down d-none d-md-inline-block mr-2 comment-{{c.base36id}}-down active"></li>
<li class="list-inline-item arrow-down d-none d-md-inline-block mr-2 comment-{{c.id}}-down active"></li>
{% endif %}
{% elif v %}
<li id="comment-{{c.base36id}}-down" tabindex="0" class="list-inline-item arrow-down downvote-button d-none d-md-inline-block mr-2 comment-{{c.base36id}}-down {% if voted==-1 %}active{% endif %}" data-id-down="{{c.base36id}}" data-content-type="comment">
<li id="comment-{{c.id}}-down" tabindex="0" class="list-inline-item arrow-down downvote-button d-none d-md-inline-block mr-2 comment-{{c.id}}-down {% if voted==-1 %}active{% endif %}" data-id-down="{{c.id}}" data-content-type="comment">
</li>
{% else %}
<li id="comment-{{c.base36id}}-down" tabindex="0" class="list-inline-item arrow-down d-none d-md-inline-block" onclick="location.href='/login';">
<li id="comment-{{c.id}}-down" tabindex="0" class="list-inline-item arrow-down d-none d-md-inline-block" onclick="location.href='/login';">
</li>
{% endif %}
@ -247,13 +247,13 @@
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="/votes?link=https://rdrama.net{{c.permalink}}"><i class="fas fa-arrows-v"></i>Votes</a></li>
{% if v and c.id in v.saved_comment_idlist() %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" onclick="post('/unsave_comment/{{c.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-save"></i>Unsave</a></li>
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" onclick="post('/unsave_comment/{{c.id}}', function(){window.location.reload(true);})"><i class="fas fa-save"></i>Unsave</a></li>
{% else %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" onclick="post('/save_comment/{{c.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-save"></i>Save</a></li>
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" onclick="post('/save_comment/{{c.id}}', function(){window.location.reload(true);})"><i class="fas fa-save"></i>Save</a></li>
{% endif %}
{% if v %}
<li class="list-inline-item text-muted"><a href="javascript:void(0)" onclick="document.getElementById('reply-to-{{c.base36id}}').classList.remove('d-none')"><i class="fas fa-reply"
<li class="list-inline-item text-muted"><a href="javascript:void(0)" onclick="document.getElementById('reply-to-{{c.id}}').classList.remove('d-none')"><i class="fas fa-reply"
aria-hidden="true"></i><span class="d-none d-md-inline-block">Reply</span></a></li>
{% if v.id!=c.author_id %}
@ -266,7 +266,7 @@
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0);" role="button" class="copy-link" data-clipboard-text="{{c.permalink | full_link}}?context=99#context"><i class="fas fa-copy"></i>Copy link</a></li>
{% if v %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" data-toggle="modal" data-target="#reportCommentModal" onclick="report_commentModal('{{c.base36id}}','{{c.author.username}}',)"><i class="fas fa-flag fa-fw"></i>Report</a></li>
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" data-toggle="modal" data-target="#reportCommentModal" onclick="report_commentModal('{{c.id}}','{{c.author.username}}',)"><i class="fas fa-flag fa-fw"></i>Report</a></li>
{% else %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" data-toggle="modal" data-target="#reportCommentModal" onclick=""><i class="fas fa-flag fa-fw"></i>Flag</a></li>
{% endif %}
@ -274,18 +274,18 @@
{% if v and c.parent_submission and c.author_id==v.id %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" onclick="toggleEdit('{{c.base36id}}')"><i class="fas fa-edit fa-fw"></i>Edit</a></li>
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" onclick="toggleEdit('{{c.id}}')"><i class="fas fa-edit fa-fw"></i>Edit</a></li>
{% if c.deleted_utc > 0 %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" onclick="post('/undelete/comment/{{c.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-trash-alt fa-fw"></i>Undelete</a></li>
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" onclick="post('/undelete/comment/{{c.id}}', function(){window.location.reload(true);})"><i class="fas fa-trash-alt fa-fw"></i>Undelete</a></li>
{% else %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" data-toggle="modal" data-target="#deleteCommentModal" onclick="delete_commentModal('{{c.base36id}}')"><i class="fas fa-trash-alt fa-fw"></i>Delete</a></li>
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" data-toggle="modal" data-target="#deleteCommentModal" onclick="delete_commentModal('{{c.id}}')"><i class="fas fa-trash-alt fa-fw"></i>Delete</a></li>
{% endif %}
{% endif %}
{% if v and v.admin_level==6 and v.id==c.author_id %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a id="distinguish-{{c.base36id}}" href="javascript:void(0)" onclick="admin_comment('{{c.base36id}}')"><i class="fas fa-id-badge fa-fw"></i>{{'Undistinguish' if c.distinguish_level else 'Distinguish'}}</a></li>
<li class="list-inline-item text-muted d-none d-md-inline-block"><a id="distinguish-{{c.id}}" href="javascript:void(0)" onclick="admin_comment('{{c.id}}')"><i class="fas fa-id-badge fa-fw"></i>{{'Undistinguish' if c.distinguish_level else 'Distinguish'}}</a></li>
{% endif %}
@ -295,21 +295,21 @@
{% if v and v.admin_level>=3 %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" onclick="removeComment('{{c.base36id}}')"><i class="fas fa-ban fa-fw text-danger"></i>Remove</a></li>
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" onclick="approveComment('{{c.base36id}}')"><i class="fas fa-check fa-fw text-success"></i>Approve</a></li>
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" onclick="removeComment('{{c.id}}')"><i class="fas fa-ban fa-fw text-danger"></i>Remove</a></li>
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" onclick="approveComment('{{c.id}}')"><i class="fas fa-check fa-fw text-success"></i>Approve</a></li>
{% endif %}
{% if v and v.admin_level==6 and v.id != c.author_id %}
{% if c.author.is_banned %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a id="unexile-comment-{{c.base36id}}" href="javascript:void(0)" onclick="post_toast('/api/unban_user/{{c.author_id}}?toast=1')"><i class="fas fa-user-slash fa-fw text-danger"></i>Unban user</a></li>
<li class="list-inline-item text-muted d-none d-md-inline-block"><a id="unexile-comment-{{c.id}}" href="javascript:void(0)" onclick="post_toast('/api/unban_user/{{c.author_id}}?toast=1')"><i class="fas fa-user-slash fa-fw text-danger"></i>Unban user</a></li>
{% else %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a id="exile-comment-{{c.base36id}}" href="javascript:void(0)" onclick="post_toast('/api/ban_user/{{c.author_id}}?toast=1')"><i class="fas fa-user-slash fa-fw text-danger"></i>Ban user</a></li>
<li class="list-inline-item text-muted d-none d-md-inline-block"><a id="exile-comment-{{c.id}}" href="javascript:void(0)" onclick="post_toast('/api/ban_user/{{c.author_id}}?toast=1')"><i class="fas fa-user-slash fa-fw text-danger"></i>Ban user</a></li>
{% endif %}
{% endif %}
{% if v and c.parent_submission and (c.author_id==v.id or v.admin_level > 0) %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" onclick="post('/api/toggle_comment_nsfw/{{c.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-eye-evil fa-fw text-danger"></i>Toggle +18</a></li>
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" onclick="post('/api/toggle_comment_nsfw/{{c.id}}', function(){window.location.reload(true);})"><i class="fas fa-eye-evil fa-fw text-danger"></i>Toggle +18</a></li>
{% endif %}
{% if v and v.admin_level >=4 and c.oauth_app %}
@ -317,24 +317,24 @@
{% endif %}
<li class="list-inline-item d-inline-block d-md-none"><a href="#" data-toggle="modal" data-target="#actionsModal-{{c.base36id}}" data-focus="false"><i class="fas fa-ellipsis-h"></i></a></li>
<li class="list-inline-item d-inline-block d-md-none"><a href="#" data-toggle="modal" data-target="#actionsModal-{{c.id}}" data-focus="false"><i class="fas fa-ellipsis-h"></i></a></li>
{% if v and request.path.startswith('/@') and v.admin_level == 0 %}
{% if voted==1 %}<li class="list-inline-item arrow-up d-inline-block d-md-none mr-2 comment-{{c.base36id}}-up active"></li>{% endif %}
{% if voted==1 %}<li class="list-inline-item arrow-up d-inline-block d-md-none mr-2 comment-{{c.id}}-up active"></li>{% endif %}
{% elif v %}
<li id="comment-{{c.base36id}}-up" tabindex="0" class="list-inline-item arrow-up upvote-button d-inline-block d-md-none mr-2 comment-{{c.base36id}}-up {% if voted==1 %}active{% endif %}" data-id-up="{{c.base36id}}" data-content-type="comment"></li>
<li id="comment-{{c.id}}-up" tabindex="0" class="list-inline-item arrow-up upvote-button d-inline-block d-md-none mr-2 comment-{{c.id}}-up {% if voted==1 %}active{% endif %}" data-id-up="{{c.id}}" data-content-type="comment"></li>
{% else %}
<li id="comment-{{c.base36id}}-up" tabindex="0" class="list-inline-item arrow-up d-inline-block d-md-none mr-2" onclick="location.href='/login';"></li>
<li id="comment-{{c.id}}-up" tabindex="0" class="list-inline-item arrow-up d-inline-block d-md-none mr-2" onclick="location.href='/login';"></li>
{% endif %}
<li class="list-inline-item d-inline-block d-md-none mr-2"><span class="points" data-toggle="tooltip" data-placement="top" data-original-title="+{{ups}} | -{{downs}}"><span id="comment-score-{{c.base36id}}" class="score comment-score-{{c.base36id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}">{{score}}</span></span></li>
<li class="list-inline-item d-inline-block d-md-none mr-2"><span class="points" data-toggle="tooltip" data-placement="top" data-original-title="+{{ups}} | -{{downs}}"><span id="comment-score-{{c.id}}" class="score comment-score-{{c.id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}">{{score}}</span></span></li>
{% if v and request.path.startswith('/@') and v.admin_level == 0 %}
{% if voted==-1 %}
<li class="list-inline-item arrow-down d-inline-block d-md-none mr-2 comment-{{c.base36id}}-up active"></li>
<li class="list-inline-item arrow-down d-inline-block d-md-none mr-2 comment-{{c.id}}-up active"></li>
{% endif %}
{% elif v %}
<li id="comment-{{c.base36id}}-down" tabindex="0" class="list-inline-item arrow-down downvote-button d-inline-block d-md-none mr-2 comment-{{c.base36id}}-down {% if voted==-1 %}active{% endif %}" data-id-down="{{c.base36id}}" data-content-type="comment"></li>
<li id="comment-{{c.id}}-down" tabindex="0" class="list-inline-item arrow-down downvote-button d-inline-block d-md-none mr-2 comment-{{c.id}}-down {% if voted==-1 %}active{% endif %}" data-id-down="{{c.id}}" data-content-type="comment"></li>
{% else %}
<li id="comment-{{c.base36id}}-down" tabindex="0" class="list-inline-item arrow-down d-inline-block d-md-none" onclick="location.href='/login';"></li>
<li id="comment-{{c.id}}-down" tabindex="0" class="list-inline-item arrow-down d-inline-block d-md-none" onclick="location.href='/login';"></li>
{% endif %}
</ul>
</div>
@ -342,14 +342,14 @@
</div>
<div id="reply-to-{{c.base36id}}" class="d-none">
<div id="reply-to-{{c.id}}" class="d-none">
<div id="comment-form-space-{{c.fullname}}" class="comment-write collapsed child">
<form id="reply-to-t3_{{c.base36id}}" action="/api/comment" method="post" class="input-group" enctype="multipart/form-data">
<form id="reply-to-t3_{{c.id}}" action="/api/comment" method="post" class="input-group" enctype="multipart/form-data">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<input type="hidden" name="parent_fullname" value="{{c.fullname}}">
<input id="reply-form-submission-{{c.fullname}}" type="hidden" name="submission" value="{{c.post.base36id}}">
<textarea name="body" form="reply-to-t3_{{c.base36id}}" class="comment-box form-control rounded" id="reply-form-body-{{c.fullname}}" aria-label="With textarea" placeholder="Add your comment..." rows="3"></textarea>
<div class="comment-format" id="comment-format-bar-{{c.base36id}}">
<input id="reply-form-submission-{{c.fullname}}" type="hidden" name="submission" value="{{c.post.id}}">
<textarea name="body" form="reply-to-t3_{{c.id}}" class="comment-box form-control rounded" id="reply-form-body-{{c.fullname}}" aria-label="With textarea" placeholder="Add your comment..." rows="3"></textarea>
<div class="comment-format" id="comment-format-bar-{{c.id}}">
<label class="btn btn-secondary format d-inline-block m-0" for="gif-reply-btn-{{c.fullname}}">
<span id="gif-reply-btn-{{c.fullname}}" class="font-weight-bolder text-uppercase" onclick="commentForm('reply-form-body-{{c.fullname}}');getGif()" aria-hidden="true" data-toggle="modal" data-target="#gifModal" data-toggle="tooltip" data-placement="bottom" title="Add GIF">GIF</span>
</label>
@ -359,13 +359,13 @@
</label>
&nbsp;
<label class="btn btn-secondary format d-inline-block m-0" for="file-upload-reply-{{c.fullname}}">
<div id="filename-show-reply-{{c.base36id}}"><i class="far fa-image"></i></div>
<input id="file-upload-reply-{{c.fullname}}" type="file" name="file" accept="image/*" onchange="document.getElementById('filename-show-reply-{{c.base36id}}').innerHTML='image';" hidden>
<div id="filename-show-reply-{{c.id}}"><i class="far fa-image"></i></div>
<input id="file-upload-reply-{{c.fullname}}" type="file" name="file" accept="image/*" onchange="document.getElementById('filename-show-reply-{{c.id}}').innerHTML='image';" hidden>
</label>
<a href="javascript:void(0)" onclick="document.getElementById('reply-to-{{c.base36id}}').classList.add('d-none')" class="d-none d-md-block btn btn-link text-muted ml-auto cancel-form">Cancel</a>
<a href="javascript:void(0)" onclick="document.getElementById('reply-to-{{c.id}}').classList.add('d-none')" class="d-none d-md-block btn btn-link text-muted ml-auto cancel-form">Cancel</a>
<a id="save-reply-to-{{c.fullname}}" class="d-none d-md-block btn btn-primary text-white ml-2" onclick="post_comment('{{c.fullname}}');" href="javascript:void(0)">Comment</a>
</div>
<a href="javascript:void(0)" onclick="document.getElementById('reply-to-{{c.base36id}}').classList.add('d-none')" class="d-block d-md-none btn btn-link text-muted ml-auto cancel-form">Cancel</a>
<a href="javascript:void(0)" onclick="document.getElementById('reply-to-{{c.id}}').classList.add('d-none')" class="d-block d-md-none btn btn-link text-muted ml-auto cancel-form">Cancel</a>
<a id="save-reply-to-{{c.fullname}}" class="d-block d-md-none btn btn-primary text-white ml-2" onclick="post_comment('{{c.fullname}}');" href="javascript:void(0)">Comment</a>
</form>
</div>
@ -375,18 +375,18 @@
{% if render_replies %}
{% if level<6 %}
<div id="replies-of-{{c.base36id}}">
<div id="replies-of-{{c.id}}">
{% for reply in c.children(v) %}
{{single_comment(reply, level=level+1)}}
{% endfor %}
</div>
{% elif c.children(v) %}
<div id="replies-of-{{c.base36id}}" class="d-none d-md-block">
<div id="replies-of-{{c.id}}" class="d-none d-md-block">
{% for reply in c.children(v) %}
{{single_comment(reply, level=level+1)}}
{% endfor %}
</div>
<div id="morecomment-{{c.base36id}}" class="d-block d-md-none mt-2 more-comments text-small">
<div id="morecomment-{{c.id}}" class="d-block d-md-none mt-2 more-comments text-small">
<a href="{{c.permalink}}"{% if c.author.is_private %} rel="nofollow"{% endif %}>More comments <i class="fas fa-long-arrow-right ml-1"></i></a>
</div>
{% endif %}
@ -396,7 +396,7 @@
<!-- Comment Actions Modal -->
<div class="modal fade d-md-none" id="actionsModal-{{c.base36id}}" tabindex="-1" role="dialog" aria-labelledby="actionsModalTitle" aria-hidden="true">
<div class="modal fade d-md-none" id="actionsModal-{{c.id}}" tabindex="-1" role="dialog" aria-labelledby="actionsModalTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
@ -419,9 +419,9 @@
{% endif %}
{% if v and c.id in v.saved_comment_idlist() %}
<li class="list-group-item"><a href="javascript:void(0)" onclick="post('/unsave_comment/{{c.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-save"></i>Unsave</a></li>
<li class="list-group-item"><a href="javascript:void(0)" onclick="post('/unsave_comment/{{c.id}}', function(){window.location.reload(true);})"><i class="fas fa-save"></i>Unsave</a></li>
{% else %}
<li class="list-group-item"><a href="javascript:void(0)" onclick="post('/save_comment/{{c.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-save"></i>Save</a></li>
<li class="list-group-item"><a href="javascript:void(0)" onclick="post('/save_comment/{{c.id}}', function(){window.location.reload(true);})"><i class="fas fa-save"></i>Save</a></li>
{% endif %}
<li class="list-group-item"><a href="javascript:void(0);" role="button" class="d-block copy-link" data-dismiss="modal" data-clipboard-text="{{c.permalink | full_link}}?context=5#context"><i class="fas fa-copy"></i><span>Copy link</span></a></li>
@ -429,33 +429,33 @@
<li class="list-group-item"><a href="{{c.permalink}}?context=5#context"{% if c.author.is_private %} rel="nofollow"{% endif %}><i class="fas fa-dna"></i>Context</a></li>
{% if not (v and v.id==c.author_id) %}
<li class="list-group-item"><a href="javascript:void(0)" data-toggle="modal" data-dismiss="modal" data-target="#reportCommentModal" onclick="report_commentModal('{{c.base36id}}','{{c.author.username}}')" class="d-block"><i class="fas fa-flag"></i>Report</a></li>
<li class="list-group-item"><a href="javascript:void(0)" data-toggle="modal" data-dismiss="modal" data-target="#reportCommentModal" onclick="report_commentModal('{{c.id}}','{{c.author.username}}')" class="d-block"><i class="fas fa-flag"></i>Report</a></li>
{% endif %}
{% if v and c.parent_submission and c.author_id==v.id %}
<li class="list-group-item"><a href="javascript:void(0)" data-dismiss="modal" onclick="toggleEdit('{{c.base36id}}')" class="d-block"><i class="fas fa-edit"></i>Edit</a></li>
<li class="list-group-item"><a href="javascript:void(0)" data-dismiss="modal" onclick="toggleEdit('{{c.id}}')" class="d-block"><i class="fas fa-edit"></i>Edit</a></li>
{% if c.deleted_utc > 0 %}
<li class="list-group-item"><a class="d-block" href="javascript:void(0)" onclick="post('/undelete/comment/{{c.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-trash-alt"></i>Undelete</a></li>
<li class="list-group-item"><a class="d-block" href="javascript:void(0)" onclick="post('/undelete/comment/{{c.id}}', function(){window.location.reload(true);})"><i class="fas fa-trash-alt"></i>Undelete</a></li>
{% else %}
<li class="list-group-item"><a class="d-block" href="javascript:void(0)" data-toggle="modal" data-target="#deleteCommentModal" onclick="delete_commentModal('{{c.base36id}}')"><i class="fas fa-trash-alt"></i>Delete</a></li>
<li class="list-group-item"><a class="d-block" href="javascript:void(0)" data-toggle="modal" data-target="#deleteCommentModal" onclick="delete_commentModal('{{c.id}}')"><i class="fas fa-trash-alt"></i>Delete</a></li>
{% endif %}
{% endif %}
{% if v and c.parent_submission and (c.author_id==v.id or v.admin_level > 0) %}
<li class="list-group-item"><a class="d-block" href="javascript:void(0)" onclick="post('/api/toggle_comment_nsfw/{{c.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-eye-evil text-danger"></i>Toggle +18</a></li>
<li class="list-group-item"><a class="d-block" href="javascript:void(0)" onclick="post('/api/toggle_comment_nsfw/{{c.id}}', function(){window.location.reload(true);})"><i class="fas fa-eye-evil text-danger"></i>Toggle +18</a></li>
{% endif %}
{% if v %}
{% if v.admin_level>=1 and v.id==c.author_id %}
<li class="list-group-item"><a class="d-block" id="distinguish-{{c.base36id}}" href="javascript:void(0)" onclick="admin_comment('{{c.base36id}}')"><i class="fas fa-id-badge"></i>{{'Undistinguish' if c.distinguish_level else 'Distinguish'}}</a></li>
<li class="list-group-item"><a class="d-block" id="distinguish-{{c.id}}" href="javascript:void(0)" onclick="admin_comment('{{c.id}}')"><i class="fas fa-id-badge"></i>{{'Undistinguish' if c.distinguish_level else 'Distinguish'}}</a></li>
{% endif %}
{% if v.admin_level>=3 %}
<li class="list-group-item"><a class="d-block" href="javascript:void(0)" onclick="removeComment('{{c.base36id}}')"><i class="fas fa-ban text-danger"></i>Remove</a></li>
<li class="list-group-item"><a class="d-block" href="javascript:void(0)" onclick="approveComment('{{c.base36id}}')"><i class="fas fa-check text-success"></i>Approve</a></li>
<li class="list-group-item"><a class="d-block" href="javascript:void(0)" onclick="removeComment('{{c.id}}')"><i class="fas fa-ban text-danger"></i>Remove</a></li>
<li class="list-group-item"><a class="d-block" href="javascript:void(0)" onclick="approveComment('{{c.id}}')"><i class="fas fa-check text-success"></i>Approve</a></li>
{% endif %}
{% if v.admin_level >=4 and c.oauth_app %}
<li class="list-group-item"><a class="d-block" href="{{c.oauth_app.permalink}}/comments"><i class="fas fa-code"></i>API App</a></li>
@ -470,16 +470,16 @@
{% if v and c.post and (v.admin_level >= 1 or v.id == c.post.author_id) %}
{% if c.level == 1 %}
<li class="list-group-item"><a class="d-block text-info" id="pin-comment-{{c.base36id}}" href="javascript:void(0)" data-dismiss="modal" data-target="#actionsModal-{{c.base36id}}" onclick="post('/comment_pin/{{c.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-thumbtack fa-rotate--45 text-info"></i>{{'Unpin' if c.is_pinned else 'Pin'}}</a>
<li class="list-group-item"><a class="d-block text-info" id="pin-comment-{{c.id}}" href="javascript:void(0)" data-dismiss="modal" data-target="#actionsModal-{{c.id}}" onclick="post('/comment_pin/{{c.id}}', function(){window.location.reload(true);})"><i class="fas fa-thumbtack fa-rotate--45 text-info"></i>{{'Unpin' if c.is_pinned else 'Pin'}}</a>
</li>
{% endif %}
{% endif %}
{% if v and (c.post and v.admin_level == 6) %}
{% if c.author_id != v.id %}
{% if c.author.is_banned %}
<li class="list-group-item"><a class="d-block text-danger" id="unexile-comment2-{{c.base36id}}" href="javascript:void(0)" onclick="post_toast('/api/unban_user/{{c.author_id}}?toast=1')"><i class="fas fa-user-minus fa-fw text-danger"></i>Unban user</a></li>
<li class="list-group-item"><a class="d-block text-danger" id="unexile-comment2-{{c.id}}" href="javascript:void(0)" onclick="post_toast('/api/unban_user/{{c.author_id}}?toast=1')"><i class="fas fa-user-minus fa-fw text-danger"></i>Unban user</a></li>
{% else %}
<li class="list-group-item"><a class="d-block text-danger" id="exile-comment2-{{c.base36id}}" href="javascript:void(0)" onclick="post_toast('/api/ban_user/{{c.author_id}}?toast=1')"><i class="fas fa-user-minus fa-fw text-danger"></i>Ban user</a></li>
<li class="list-group-item"><a class="d-block text-danger" id="exile-comment2-{{c.id}}" href="javascript:void(0)" onclick="post_toast('/api/ban_user/{{c.author_id}}?toast=1')"><i class="fas fa-user-minus fa-fw text-danger"></i>Ban user</a></li>
{% endif %}
{% endif %}
{% endif %}

View File

@ -13,15 +13,15 @@
<span class="align-top"><a href="{{c.permalink}}">{{c.post.title | safe}}</a></span>
</div>
<div id="comment-{{c.base36id}}" class="comment">
<div id="comment-{{c.id}}" class="comment">
<span class="mr-2 d-block d-md-none"><a href="{{c.author.permalink}}"><img src="{{c.author.profile_url}}" class="profile-pic-25"></a></span>
<span class="comment-collapse d-md-block d-none" onclick="collapse_comment('{{c.base36id}}')"></span>
<span class="comment-collapse d-md-block d-none" onclick="collapse_comment('{{c.id}}')"></span>
<div class="comment-body">
<div id="comment-{{c.base36id}}-only">
<div id="comment-{{c.id}}-only">
<div class="user-info">{% if c.over_18 %}<span class="badge badge-danger">+18</span> {% endif %}{% if c.author.title and c.author.title.is_before %}<span style="color:#{{c.author.title.color}}">{{c.author.title.text}}</span> {% endif %}<a href="{{c.author.permalink}}" class="user-name {% if c.post.author_id==c.author_id %}text-info{% endif %}">{{c.author.username}}</a>{% if c.author.title and not c.author.title.is_before %}<span style="color:#{{c.author.title.color}}">{{c.author.title.text}}</span>{% endif %}
{% if c.distinguish_level or c.author_id==c.post.author_id %}
@ -39,26 +39,26 @@
<span class="time-edited" data-toggle="tooltip" data-placement="bottom" title="{{c.edited_datetime}}"><span>&#183;</span> <span class="font-italic">Edited {{c.edited_string}}</span></span>
{% endif %}
<span class="comment-collapse d-md-none" onclick="collapse_comment('{{c.base36id}}')"></span>
<span class="comment-collapse d-md-none" onclick="collapse_comment('{{c.id}}')"></span>
</div>
<div id="comment-text-{{c.base36id}}" class="comment-text">
<div id="comment-text-{{c.id}}" class="comment-text">
{{c.body_html | safe}}
</div>
<div id="comment-{{c.base36id}}-actions" class="comment-actions">
<div id="comment-{{c.id}}-actions" class="comment-actions">
<ul class="list-inline text-right text-md-left">
<li id="comment-{{c.base36id}}-up" class="list-inline-item arrow-up d-none d-md-inline-block mr-2">
<li id="comment-{{c.id}}-up" class="list-inline-item arrow-up d-none d-md-inline-block mr-2">
</li>
<li class="list-inline-item d-none d-md-inline-block mr-2">
<span id="comment-{{c.base36id}}-score-none"class="d-none text-black">{{score}}</span> </li>
<span id="comment-{{c.id}}-score-none"class="d-none text-black">{{score}}</span> </li>
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0);" role="button" class="copy-link" data-clipboard-text="{{c.permalink | full_link}}"><i class="fas fa-link"></i><span>Copy link</span></a>
</li>
<li class="list-inline-item d-none d-md-inline-block">
@ -77,16 +77,16 @@
</div>
</li>
<li class="list-inline-item d-inline-block d-md-none">
<a href="#" data-toggle="modal" data-target="#actionsModal-{{c.base36id}}" data-focus="false"><i class="fas fa-ellipsis-h"></i></a>
<a href="#" data-toggle="modal" data-target="#actionsModal-{{c.id}}" data-focus="false"><i class="fas fa-ellipsis-h"></i></a>
</li>
<li id="comment-{{c.base36id}}-up" class="list-inline-item arrow-up d-inline-block d-md-none mr-2">
<li id="comment-{{c.id}}-up" class="list-inline-item arrow-up d-inline-block d-md-none mr-2">
</li>
<li class="list-inline-item d-inline-block d-md-none mr-2">
<span id="comment-{{c.base36id}}-score-none" class="d-none text-black">{{score}}</span>
<span id="comment-{{c.id}}-score-none" class="d-none text-black">{{score}}</span>
</li>
<li id="comment-{{c.base36id}}-down" class="list-inline-item arrow-down d-inline-block d-md-none">
<li id="comment-{{c.id}}-down" class="list-inline-item arrow-down d-inline-block d-md-none">
</li>
</ul>
@ -95,7 +95,7 @@
<!-- Comment Actions Modal -->
<div class="modal fade d-md-none" id="actionsModal-{{c.base36id}}" tabindex="-1" role="dialog" aria-labelledby="actionsModalTitle" aria-hidden="true">
<div class="modal fade d-md-none" id="actionsModal-{{c.id}}" tabindex="-1" role="dialog" aria-labelledby="actionsModalTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">

View File

@ -11,14 +11,14 @@
<span class="align-top"><a href="{{c.permalink}}">{{c.post.title | safe}}</a></span>
</div>
<div id="comment-{{c.base36id}}" class="comment">
<div id="comment-{{c.id}}" class="comment">
<span class="comment-collapse"></span>
<div class="comment-body">
<div id="comment-{{c.base36id}}-only" class="">
<div id="comment-{{c.id}}-only" class="">
<div class="user-info">{% if c.over_18 %}<span class="badge badge-danger">+18</span> {% endif %}
{% if c.is_banned %}[Removed by administrators]{% else %}[Deleted by author]{% endif %}

View File

@ -17,7 +17,7 @@
<div class="col-12">
<div id="post-{{p.base36id}}" class="card border-0 mt-3{% if p.is_banned %} banned{% endif %}{% if p.stickied %} stickied{% endif %}{% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}">
<div id="post-{{p.id}}" class="card border-0 mt-3{% if p.is_banned %} banned{% endif %}{% if p.stickied %} stickied{% endif %}{% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}">
<div class="d-flex flex-row-reverse flex-nowrap justify-content-end">
{% if p.thumb_url %}
@ -62,10 +62,10 @@
<div id="voting" class="voting d-none d-md-block {% if p.body_html %} mb-auto {% else %} my-auto {% endif %} mr-3">
<div id="post-{{p.base36id}}-up" class="arrow-up mx-auto">
<div id="post-{{p.id}}-up" class="arrow-up mx-auto">
</div>
<span id="post-{{p.base36id}}-score-none" class="score text-muted">{{score}}</span>
<div id="post-{{p.base36id}}-down" class="arrow-down mx-auto">
<span id="post-{{p.id}}-score-none" class="score text-muted">{{score}}</span>
<div id="post-{{p.id}}-down" class="arrow-down mx-auto">
</div>
</div>
@ -76,15 +76,15 @@
<div class="card-footer d-none">
<div class="post-actions">
<ul class="list-inline text-right">
<li id="voting-{{p.base36id}}-mobile" class="voting list-inline-item d-md-none">
<span id="arrow-{{p.base36id}}-mobile-up" class="mr-2 arrow-mobile-up" onclick="vote('{{p.base36id}}','0')">
<li id="voting-{{p.id}}-mobile" class="voting list-inline-item d-md-none">
<span id="arrow-{{p.id}}-mobile-up" class="mr-2 arrow-mobile-up" onclick="vote('{{p.id}}','0')">
<i class="fas fa-chevron-up mx-0" aria-hidden="true"></i>
</span>
<span id="post-{{p.base36id}}-score-mobile-none" class="score text-muted">{{score}}</span>
<span id="post-{{p.id}}-score-mobile-none" class="score text-muted">{{score}}</span>
<span id="arrow-{{p.base36id}}-mobile-down" class="arrow-mobile-down ml-2 my-0" onclick="vote('{{p.base36id}}','-1')">
<span id="arrow-{{p.id}}-mobile-down" class="arrow-mobile-down ml-2 my-0" onclick="vote('{{p.id}}','-1')">
<i class="fas fa-chevron-down mx-0" aria-hidden="true"></i>
</span>
</li>
@ -121,15 +121,15 @@
<li class="list-inline-item"><a href="javascript:void(0);" role="button" class="copy-link" data-clipboard-text="{{p.permalink | full_link}}"><i class="fas fa-link"></i>Share</a></li>
<li id="voting-{{p.base36id}}-mobile" class="voting list-inline-item d-md-none">
<li id="voting-{{p.id}}-mobile" class="voting list-inline-item d-md-none">
<span id="arrow-{{p.base36id}}-mobile-up" class="mr-2 arrow-mobile-up">
<span id="arrow-{{p.id}}-mobile-up" class="mr-2 arrow-mobile-up">
<i class="fas fa-arrow-alt-up mx-0" aria-hidden="true"></i>
</span>
<span id="post-{{p.base36id}}-score-mobile-none" class="score text-muted">{{score}}</span>
<span id="post-{{p.id}}-score-mobile-none" class="score text-muted">{{score}}</span>
<span id="arrow-{{p.base36id}}-mobile-down" class="arrow-mobile-down ml-2 my-0">
<span id="arrow-{{p.id}}-mobile-down" class="arrow-mobile-down ml-2 my-0">
<i class="fas fa-arrow-alt-down mx-0" aria-hidden="true"></i>
</span>
</li>

View File

@ -29,7 +29,7 @@
<div class="rounded border bg-white mx-auto">
{% for ma in actions %}
<div id="action-{{ma.base36id}}" class="position-relative d-flex justify-content-between flex-wrap align-items-center h-min-16 px-3 py-3 mb-3 mb-md-2 bg-white{% if loop.index > 1 %} border-top{% endif %}">
<div id="action-{{ma.id}}" class="position-relative d-flex justify-content-between flex-wrap align-items-center h-min-16 px-3 py-3 mb-3 mb-md-2 bg-white{% if loop.index > 1 %} border-top{% endif %}">
<div class="d-flex flex-grow-1 align-items-center">
<div class="d-flex align-items-center justify-content-center {{ma.color}} mr-3 rounded-lg flex-shrink-0" style="width: 32px;height: 32px;"><i class="far text-center {{ma.icon}} text-lg text-white fa-fw"></i></div>

View File

@ -47,7 +47,7 @@
</div>
<div class="footer">
<div class="d-flex">
<a href="javascript:void(0)" class="btn btn-secondary ml-auto" onclick="post_toast('/oauth/reroll/{{app.base36id}}', callback=function(xhr){document.getElementById('edit-{{app.id}}-client-id').value=JSON.parse(xhr.response)['id'];document.getElementById('edit-{{app.id}}-client-secret').value=JSON.parse(xhr.response)['secret'];})">Reroll Tokens</a>
<a href="javascript:void(0)" class="btn btn-secondary ml-auto" onclick="post_toast('/oauth/reroll/{{app.id}}', callback=function(xhr){document.getElementById('edit-{{app.id}}-client-id').value=JSON.parse(xhr.response)['id'];document.getElementById('edit-{{app.id}}-client-secret').value=JSON.parse(xhr.response)['secret'];})">Reroll Tokens</a>
<input type="submit" class="btn btn-primary ml-2" value="Save Changes">
</div>
</div>
@ -104,7 +104,7 @@
{% for auth in v.authorizations.all() %}
<div id="auth-{{auth.base36id}}" class="settings-section rounded">
<div id="auth-{{auth.id}}" class="settings-section rounded">
<div class="d-lg-flex">
<div class="title w-lg-25">
<label for="over18">{{auth.application.app_name}}</label>
@ -119,7 +119,7 @@
</div>
<div class="footer">
<div class="d-flex">
<a href="javascript:void(0)" class="btn btn-primary ml-auto text-white" onclick="post_toast('/oauth/rescind/{{auth.base36id}}', callback=function(xhr){document.getElementById('auth-{{auth.base36id}}').classList.add('d-none')})">Revoke</a>
<a href="javascript:void(0)" class="btn btn-primary ml-auto text-white" onclick="post_toast('/oauth/rescind/{{auth.id}}', callback=function(xhr){document.getElementById('auth-{{auth.id}}').classList.add('d-none')})">Revoke</a>
</div>
</div>
</div>

View File

@ -96,21 +96,21 @@
<div class="modal-body">
<ul class="list-group post-actions">
{% if not (v and v.id==p.author_id) %}
<button class="btn btn-link btn-block btn-lg text-left text-muted" data-toggle="modal" data-dismiss="modal" data-target="#reportPostModal" onclick="report_postModal('{{p.base36id}}','{{'@'+p.author.username}}')" class="d-block"><i class="far fa-flag text-center text-muted mr-3"></i>Report</button>
<button class="btn btn-link btn-block btn-lg text-left text-muted" data-toggle="modal" data-dismiss="modal" data-target="#reportPostModal" onclick="report_postModal('{{p.id}}','{{'@'+p.author.username}}')" class="d-block"><i class="far fa-flag text-center text-muted mr-3"></i>Report</button>
{% endif %}
{% if v and v.id==p.author_id %}
{% if p.private %}
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post('/api/publish/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-globe text-center text-muted mr-3"></i>Publish</a></button>
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post('/api/publish/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-globe text-center text-muted mr-3"></i>Publish</a></button>
{% endif %}
<button class="btn btn-link btn-block btn-lg text-left text-muted" data-dismiss="modal" onclick="togglePostEdit('{{p.base36id}}')"><i class="far fa-edit text-center text-muted mr-3"></i>Edit</button>
<button class="btn btn-link btn-block btn-lg text-left text-muted" data-dismiss="modal" onclick="togglePostEdit('{{p.id}}')"><i class="far fa-edit text-center text-muted mr-3"></i>Edit</button>
<button class="btn btn-link btn-block btn-lg text-info text-left" id="pin-post-{{p.base36id}}" href="javascript:void(0)" onclick="post('/api/pin/{{p.base36id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-thumbtack text-center text-muted mr-3"></i>{% if p.is_pinned %}Unpin from your profile{% else %}Pin to your profile{% endif %}</button>
<button class="btn btn-link btn-block btn-lg text-info text-left" id="pin-post-{{p.id}}" href="javascript:void(0)" onclick="post('/api/pin/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-thumbtack text-center text-muted mr-3"></i>{% if p.is_pinned %}Unpin from your profile{% else %}Pin to your profile{% endif %}</button>
{% if p.deleted_utc > 0 %}
<button class="btn btn-link btn-block btn-lg text-left text-muted" href="javascript:void(0)" onclick="post('/undelete_post/{{p.base36id}}', function(){window.location.reload(true);})"><i class="far fa-trash-alt text-center text-muted mr-3"></i>Undelete</button>
<button class="btn btn-link btn-block btn-lg text-left text-muted" href="javascript:void(0)" onclick="post('/undelete_post/{{p.id}}', function(){window.location.reload(true);})"><i class="far fa-trash-alt text-center text-muted mr-3"></i>Undelete</button>
{% else %}
<button class="btn btn-link btn-block btn-lg text-left text-muted" data-toggle="modal" data-dismiss="modal" data-target="#deletePostModal" onclick="delete_postModal('{{p.base36id}}')"><i class="far fa-trash-alt text-center text-muted mr-3"></i>Delete</button>
<button class="btn btn-link btn-block btn-lg text-left text-muted" data-toggle="modal" data-dismiss="modal" data-target="#deletePostModal" onclick="delete_postModal('{{p.id}}')"><i class="far fa-trash-alt text-center text-muted mr-3"></i>Delete</button>
{% endif %}
{% endif %}
@ -127,24 +127,24 @@
{% endif %}
{% if v and p.id in v.saved_idlist() %}
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post('/unsave_post/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-save text-center text-muted mr-3"></i>Unsave</a></button>
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post('/unsave_post/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-save text-center text-muted mr-3"></i>Unsave</a></button>
{% elif v %}
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post('/save_post/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-save text-center text-muted mr-3"></i>Save</a></button>
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post('/save_post/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-save text-center text-muted mr-3"></i>Save</a></button>
{% endif %}
{% if v and (v.id==p.author_id or v.admin_level>=3) %}
<button class="btn btn-link btn-block btn-lg text-left text-muted" onclick="post('/api/toggle_post_nsfw/{{p.base36id}}', function(){window.location.reload(true);})"><i class="far fa-eye-evil text-center text-muted mr-3"></i>Toggle +18</button>
<button class="btn btn-link btn-block btn-lg text-left text-muted" onclick="post('/api/toggle_post_nsfw/{{p.id}}', function(){window.location.reload(true);})"><i class="far fa-eye-evil text-center text-muted mr-3"></i>Toggle +18</button>
{% endif %}
{% if v %}
{% if v.admin_level >=3 %}
<button class="btn btn-link btn-block btn-lg text-info text-left" id="sticky-post-{{p.base36id}}" href="javascript:void(0)" onclick="post('/api/sticky/{{p.base36id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-thumbtack text-center text-muted mr-3"></i>{% if p.stickied %}Unpin{% else %}Pin{% endif %}</button>
<button class="btn btn-link btn-block btn-lg text-info text-left" id="sticky-post-{{p.id}}" href="javascript:void(0)" onclick="post('/api/sticky/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-thumbtack text-center text-muted mr-3"></i>{% if p.stickied %}Unpin{% else %}Pin{% endif %}</button>
{% if v==p.author %}
<button class="btn btn-link btn-block btn-lg text-left text-warning" id="distinguish-post-{{p.base36id}}" href="javascript:void(0)" onclick="post('/api/distinguish/{{p.base36id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-crown text-center text-muted mr-3"></i>Distinguish</button>
<button class="btn btn-link btn-block btn-lg text-left text-warning" id="distinguish-post-{{p.id}}" href="javascript:void(0)" onclick="post('/api/distinguish/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-crown text-center text-muted mr-3"></i>Distinguish</button>
{% endif %}
<button class="btn btn-link btn-block btn-lg text-success text-left" id="moderate-post-{{p.base36id}}" href="javascript:void(0)" onclick="post('/api/unban_post/{{p.base36id}}',callback=function(){window.location.reload(true);})"><i class="far fa-check text-center text-success mr-3"></i>Approve</button>
<button class="btn btn-link btn-block btn-lg text-danger text-left" id="moderate-post-{{p.base36id}}" href="javascript:void(0)" onclick="post('/api/ban_post/{{p.base36id}}',callback=function(){window.location.reload(true);})"><i class="far fa-ban text-center text-danger mr-3"></i>Remove</button>
<button class="btn btn-link btn-block btn-lg text-success text-left" id="moderate-post-{{p.id}}" href="javascript:void(0)" onclick="post('/api/unban_post/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="far fa-check text-center text-success mr-3"></i>Approve</button>
<button class="btn btn-link btn-block btn-lg text-danger text-left" id="moderate-post-{{p.id}}" href="javascript:void(0)" onclick="post('/api/ban_post/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="far fa-ban text-center text-danger mr-3"></i>Remove</button>
{% endif %}
{% if v.admin_level >=4 and p.oauth_app %}
@ -154,9 +154,9 @@
{% endif %}
{% if v and v.id != p.author_id and v.admin_level == 0 %}
<button id="block-user-button-{{p.base36id}}" class="btn btn-link btn-block btn-lg text-left text-danger{% if p.is_blocking %} d-none{% endif %}" data-dismiss="modal" onclick="post_toast('/settings/block?username={{p.author.username}}', callback=function(){document.getElementById('block-user-button-{{p.base36id}}').classList.toggle('d-none');document.getElementById('unblock-user-button-{{p.base36id}}').classList.toggle('d-none');})"
<button id="block-user-button-{{p.id}}" class="btn btn-link btn-block btn-lg text-left text-danger{% if p.is_blocking %} d-none{% endif %}" data-dismiss="modal" onclick="post_toast('/settings/block?username={{p.author.username}}', callback=function(){document.getElementById('block-user-button-{{p.id}}').classList.toggle('d-none');document.getElementById('unblock-user-button-{{p.id}}').classList.toggle('d-none');})"
><i class="fas fa-eye-slash mr-3"></i>Block user</button>
<button id="unblock-user-button-{{p.base36id}}" class="btn btn-link btn-block btn-lg text-left text-danger{% if not p.is_blocking %} d-none{% endif %}" data-dismiss="modal" onclick="post_toast('/settings/unblock?username={{p.author.username}}', callback=function(){document.getElementById('block-user-button-{{p.base36id}}').classList.toggle('d-none');document.getElementById('unblock-user-button-{{p.base36id}}').classList.toggle('d-none');})"
<button id="unblock-user-button-{{p.id}}" class="btn btn-link btn-block btn-lg text-left text-danger{% if not p.is_blocking %} d-none{% endif %}" data-dismiss="modal" onclick="post_toast('/settings/unblock?username={{p.author.username}}', callback=function(){document.getElementById('block-user-button-{{p.id}}').classList.toggle('d-none');document.getElementById('unblock-user-button-{{p.id}}').classList.toggle('d-none');})"
><i class="fas fa-eye mr-3"></i>Unblock user</button>
{% endif %}
@ -194,7 +194,7 @@
<div class="col-12">
<div id="post-{{p.base36id}}" class="card border-0 mt-3{% if p.is_banned %} banned{% endif %}{% if p.stickied %} stickied{% endif %}{% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}">
<div id="post-{{p.id}}" class="card border-0 mt-3{% if p.is_banned %} banned{% endif %}{% if p.stickied %} stickied{% endif %}{% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}">
<div class="{% if p.deleted_utc > 0 %}deleted {% endif %}d-flex flex-row-reverse flex-nowrap justify-content-end">
{% if p.thumb_url and not p.embed_url %}
@ -281,21 +281,21 @@
</div>
{% if v and v.id==p.author_id and not v.is_banned %}
<div id="edit-post-body-{{p.base36id}}" class="d-none comment-write collapsed child">
<form id="post-edit-form-{{p.base36id}}" class="d-flex flex-column" action="/edit_post/{{p.base36id}}" method="post" class="input-group">
<div id="edit-post-body-{{p.id}}" class="d-none comment-write collapsed child">
<form id="post-edit-form-{{p.id}}" class="d-flex flex-column" action="/edit_post/{{p.id}}" method="post" class="input-group">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<input type="hidden" name="current_page" value="{{request.path}}">
<input name="title" required placeholder="title" value="{{title}}" />
<textarea name="body" id="post-edit-box-{{p.base36id}}" form="post-edit-form-{{p.base36id}}" class="comment-box form-control rounded" aria-label="With textarea" placeholder="Add text to your post..." rows="10">{{p.body}}</textarea>
<textarea name="body" id="post-edit-box-{{p.id}}" form="post-edit-form-{{p.id}}" class="comment-box form-control rounded" aria-label="With textarea" placeholder="Add text to your post..." rows="10">{{p.body}}</textarea>
<div class="comment-format">
<small class="format pl-0"><i class="fas fa-bold" aria-hidden="true" onclick="makeBold('post-edit-box-{{p.base36id}}')" data-toggle="tooltip" data-placement="bottom" title="Bold"></i></small>
<small class="format"><i class="fas fa-italic" aria-hidden="true" onclick="makeItalics('post-edit-box-{{p.base36id}}')" data-toggle="tooltip" data-placement="bottom" title="Italicize"></i></small>
<small class="format"><i class="fas fa-quote-right" aria-hidden="true" onclick="makeQuote('post-edit-box-{{p.base36id}}')" data-toggle="tooltip" data-placement="bottom" title="Quote"></i></small>
<small class="format"><span class="font-weight-bolder text-uppercase" onclick="commentForm('post-edit-box-{{p.base36id}}');getGif()" aria-hidden="true" data-toggle="modal" data-target="#gifModal" data-toggle="tooltip" data-placement="bottom" title="Add GIF">GIF</span></small>
<small class="format"><i class="fas fa-smile-beam" onclick="loadEmojis('post-edit-box-{{p.base36id}}')" aria-hidden="true" data-toggle="modal" data-target="#emojiModal" data-toggle="tooltip" data-placement="bottom" title="Add Emoji"></i></small>
<small class="format pl-0"><i class="fas fa-bold" aria-hidden="true" onclick="makeBold('post-edit-box-{{p.id}}')" data-toggle="tooltip" data-placement="bottom" title="Bold"></i></small>
<small class="format"><i class="fas fa-italic" aria-hidden="true" onclick="makeItalics('post-edit-box-{{p.id}}')" data-toggle="tooltip" data-placement="bottom" title="Italicize"></i></small>
<small class="format"><i class="fas fa-quote-right" aria-hidden="true" onclick="makeQuote('post-edit-box-{{p.id}}')" data-toggle="tooltip" data-placement="bottom" title="Quote"></i></small>
<small class="format"><span class="font-weight-bolder text-uppercase" onclick="commentForm('post-edit-box-{{p.id}}');getGif()" aria-hidden="true" data-toggle="modal" data-target="#gifModal" data-toggle="tooltip" data-placement="bottom" title="Add GIF">GIF</span></small>
<small class="format"><i class="fas fa-smile-beam" onclick="loadEmojis('post-edit-box-{{p.id}}')" aria-hidden="true" data-toggle="modal" data-target="#emojiModal" data-toggle="tooltip" data-placement="bottom" title="Add Emoji"></i></small>
<small class="format d-none"><i class="fas fa-link" aria-hidden="true"></i></small>
<a href="javascript:void(0)" onclick="togglePostEdit('{{p.base36id}}')" class="btn btn-link text-muted ml-auto cancel-form">Cancel</a>
<button form="post-edit-form-{{p.base36id}}" class="btn btn-primary ml-2">Save Edit</button> </div> </form>
<a href="javascript:void(0)" onclick="togglePostEdit('{{p.id}}')" class="btn btn-link text-muted ml-auto cancel-form">Cancel</a>
<button form="post-edit-form-{{p.id}}" class="btn btn-primary ml-2">Save Edit</button> </div> </form>
</div>
{% endif %}
@ -307,9 +307,9 @@
{% if v and v.id==p.author_id %}
{% if p.private %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/publish/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-globe"></i>Publish</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/publish/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-globe"></i>Publish</a></li>
{% endif %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="togglePostEdit('{{p.base36id}}')"><i class="fas fa-edit"></i>Edit</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="togglePostEdit('{{p.id}}')"><i class="fas fa-edit"></i>Edit</a></li>
{% endif %}
<li class="list-inline-item"><a href="/votes?link=https://rdrama.net{{p.permalink}}"><i class="fas fa-arrows-v"></i>Votes</a></li>
@ -327,40 +327,40 @@
{% endif %}
{% if v and p.id in v.saved_idlist() %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/unsave_post/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-save"></i>Unsave</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/unsave_post/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-save"></i>Unsave</a></li>
{% elif v %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/save_post/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-save"></i>Save</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/save_post/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-save"></i>Save</a></li>
{% endif %}
{% if not (v and v.id==p.author_id) %}
<li class="list-inline-item"><a href="javascript:void(0)" data-toggle="modal" data-dismiss="modal" data-target="#reportPostModal" onclick="report_postModal('{{p.base36id}}', '{{p.author.username}}')"><i class="fas fa-flag"></i>Report</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" data-toggle="modal" data-dismiss="modal" data-target="#reportPostModal" onclick="report_postModal('{{p.id}}', '{{p.author.username}}')"><i class="fas fa-flag"></i>Report</a></li>
{% endif %}
{% if v and v.id==p.author_id %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/pin/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-thumbtack"></i>{% if p.is_pinned %}Unpin from your profile{% else %}Pin to your profile{% endif %}</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/pin/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-thumbtack"></i>{% if p.is_pinned %}Unpin from your profile{% else %}Pin to your profile{% endif %}</a></li>
{% if p.deleted_utc > 0 %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/undelete_post/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-trash-alt"></i>Undelete</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/undelete_post/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-trash-alt"></i>Undelete</a></li>
{% else %}
<li class="list-inline-item"><a href="javascript:void(0)" data-toggle="modal" data-dismiss="modal" data-target="#deletePostModal" onclick="delete_postModal('{{p.base36id}}')"><i class="fas fa-trash-alt"></i>Delete</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" data-toggle="modal" data-dismiss="modal" data-target="#deletePostModal" onclick="delete_postModal('{{p.id}}')"><i class="fas fa-trash-alt"></i>Delete</a></li>
{% endif %}
{% endif %}
{% if v and v.admin_level>=3 %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/sticky/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-thumbtack"></i>{% if p.stickied %}Unpin{% else %}Pin{% endif %}</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/sticky/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-thumbtack"></i>{% if p.stickied %}Unpin{% else %}Pin{% endif %}</a></li>
{% if v==p.author %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/distinguish/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-crown"></i>Distinguish</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/distinguish/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-crown"></i>Distinguish</a></li>
{% endif %}
{% endif %}
{% if v %}
{% if v.id == p.author_id or v.admin_level >= 3 %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/toggle_post_nsfw/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-eye-evil text-danger"></i>Toggle +18</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/toggle_post_nsfw/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-eye-evil text-danger"></i>Toggle +18</a></li>
{% endif %}
{% if v.admin_level >=3 %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/unban_post/{{p.base36id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-check text-success"></i>Approve</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/ban_post/{{p.base36id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-ban text-danger"></i>Remove</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/unban_post/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-check text-success"></i>Approve</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/ban_post/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-ban text-danger"></i>Remove</a></li>
{% endif %}
{% if v.admin_level >= 4 and p.oauth_app %}
@ -368,16 +368,16 @@
{% endif %}
{% if not v.id==p.author_id and v.admin_level == 0 %}
<li id="block-user-{{p.base36id}}" class="list-inline-item{% if p.is_blocking %} d-none{% endif %}"><a href="javascript:void(0)" onclick="post_toast('/settings/block?username={{p.author.username}}', callback=function(){document.getElementById('block-user-{{p.base36id}}').classList.toggle('d-none');document.getElementById('unblock-user-{{p.base36id}}').classList.toggle('d-none');})"
<li id="block-user-{{p.id}}" class="list-inline-item{% if p.is_blocking %} d-none{% endif %}"><a href="javascript:void(0)" onclick="post_toast('/settings/block?username={{p.author.username}}', callback=function(){document.getElementById('block-user-{{p.id}}').classList.toggle('d-none');document.getElementById('unblock-user-{{p.id}}').classList.toggle('d-none');})"
><i class="fas fa-eye-slash text-danger"></i>Block user</a></li>
<li id="unblock-user-{{p.base36id}}" class="list-inline-item{% if not p.is_blocking %} d-none{% endif %}"><a href="javascript:void(0)" onclick="post_toast('/settings/unblock?username={{p.author.username}}', callback=function(){document.getElementById('block-user-{{p.base36id}}').classList.toggle('d-none');document.getElementById('unblock-user-{{p.base36id}}').classList.toggle('d-none');})"
<li id="unblock-user-{{p.id}}" class="list-inline-item{% if not p.is_blocking %} d-none{% endif %}"><a href="javascript:void(0)" onclick="post_toast('/settings/unblock?username={{p.author.username}}', callback=function(){document.getElementById('block-user-{{p.id}}').classList.toggle('d-none');document.getElementById('unblock-user-{{p.id}}').classList.toggle('d-none');})"
><i class="fas fa-eye text-danger"></i>Unblock user</a></li>
{% endif %}
{% if not v.id==p.author_id and v.admin_level == 1 %}
<li id="sex-user-{{p.base36id}}" class="list-inline-item{% if p.is_blocking %} d-none{% endif %}"><a href="javascript:void(0)" onclick="post_toast('/settings/block?username={{p.author.username}}', callback=function(){document.getElementById('block-user-{{p.base36id}}').classList.toggle('d-none');document.getElementById('unblock-user-{{p.base36id}}').classList.toggle('d-none');})"
<li id="sex-user-{{p.id}}" class="list-inline-item{% if p.is_blocking %} d-none{% endif %}"><a href="javascript:void(0)" onclick="post_toast('/settings/block?username={{p.author.username}}', callback=function(){document.getElementById('block-user-{{p.id}}').classList.toggle('d-none');document.getElementById('unblock-user-{{p.id}}').classList.toggle('d-none');})"
><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
<li id="unsex-user-{{p.base36id}}" class="list-inline-item{% if not p.is_blocking %} d-none{% endif %}"><a href="javascript:void(0)" onclick="post_toast('/settings/unblock?username={{p.author.username}}', callback=function(){document.getElementById('block-user-{{p.base36id}}').classList.toggle('d-none');document.getElementById('unblock-user-{{p.base36id}}').classList.toggle('d-none');})"
<li id="unsex-user-{{p.id}}" class="list-inline-item{% if not p.is_blocking %} d-none{% endif %}"><a href="javascript:void(0)" onclick="post_toast('/settings/unblock?username={{p.author.username}}', callback=function(){document.getElementById('block-user-{{p.id}}').classList.toggle('d-none');document.getElementById('unblock-user-{{p.id}}').classList.toggle('d-none');})"
><i class="fas fa-user-slash text-danger"></i>Unban user</a></li>
{% endif %}
@ -403,20 +403,20 @@
{% if v %}
<div id="voting" class="voting d-none d-md-block mb-auto">
<div id="post-{{p.base36id}}-up" tabindex="0" data-id-up="{{p.base36id}}" data-content-type="post" class="mx-auto arrow-up upvote-button post-{{p.base36id}}-up {% if voted==1 %}active{% endif %}"></div>
<div id="post-{{p.id}}-up" tabindex="0" data-id-up="{{p.id}}" data-content-type="post" class="mx-auto arrow-up upvote-button post-{{p.id}}-up {% if voted==1 %}active{% endif %}"></div>
<span id="post-score-{{p.base36id}}" class="score post-score-{{p.base36id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}" data-toggle="tooltip" data-placement="right" data-original-title="+{{ups}} | -{{downs}}">{{score}}</span>
<span id="post-score-{{p.id}}" class="score post-score-{{p.id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}" data-toggle="tooltip" data-placement="right" data-original-title="+{{ups}} | -{{downs}}">{{score}}</span>
<div id="post-{{p.base36id}}-down" tabindex="0" data-id-down="{{p.base36id}}" data-content-type="post" class="text-muted mx-auto arrow-down downvote-button post-{{p.base36id}}-down {% if voted==-1 %}active{% endif %}"></div>
<div id="post-{{p.id}}-down" tabindex="0" data-id-down="{{p.id}}" data-content-type="post" class="text-muted mx-auto arrow-down downvote-button post-{{p.id}}-down {% if voted==-1 %}active{% endif %}"></div>
</div>
{% else %}
<div id="voting" class="voting d-none d-md-block mb-auto">
<div id="post-{{p.base36id}}-up" tabindex="0" class="arrow-up mx-auto" onclick="location.href='/login?redirect={{request.path | urlencode}}';">
<div id="post-{{p.id}}-up" tabindex="0" class="arrow-up mx-auto" onclick="location.href='/login?redirect={{request.path | urlencode}}';">
</div>
<span id="post-{{p.base36id}}-score-none" class="score text-muted"{% if not p.is_banned %} data-toggle="tooltip" data-placement="right" data-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
<div id="post-{{p.base36id}}-down" tabindex="0" class="arrow-down mx-auto" onclick="location.href='/login?redirect={{request.path | urlencode}}';">
<span id="post-{{p.id}}-score-none" class="score text-muted"{% if not p.is_banned %} data-toggle="tooltip" data-placement="right" data-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
<div id="post-{{p.id}}-down" tabindex="0" class="arrow-down mx-auto" onclick="location.href='/login?redirect={{request.path | urlencode}}';">
</div>
</div>
@ -458,23 +458,23 @@
</a>
</li>
{% endif %}
<li id="voting-{{p.base36id}}-mobile" class="voting list-inline-item d-md-none{% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}">
<li id="voting-{{p.id}}-mobile" class="voting list-inline-item d-md-none{% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}">
{% if v %}
<span id="post-{{p.base36id}}-up-mobile" tabindex="0" data-id-up="{{p.base36id}}" data-content-type="post" class="mr-2 arrow-up upvote-button post-{{p.base36id}}-up {% if voted==1 %}active{% endif %}">
<span id="post-{{p.id}}-up-mobile" tabindex="0" data-id-up="{{p.id}}" data-content-type="post" class="mr-2 arrow-up upvote-button post-{{p.id}}-up {% if voted==1 %}active{% endif %}">
</span>
{% else %}
<span id="arrow-{{p.base36id}}-mobile-up" tabindex="0" class="mr-2 arrow-mobile-up" onclick="location.href='/login?redirect={{request.path | urlencode}}';">
<span id="arrow-{{p.id}}-mobile-up" tabindex="0" class="mr-2 arrow-mobile-up" onclick="location.href='/login?redirect={{request.path | urlencode}}';">
<i class="fas fa-arrow-alt-up mx-0" aria-hidden="true"></i>
</span>
{% endif %}
<span id="post-score-{{p.base36id}}" class="score post-score-{{p.base36id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}" data-toggle="tooltip" data-placement="top" data-original-title="+{{ups}} | -{{downs}}">{{score}}</span>
<span id="post-score-{{p.id}}" class="score post-score-{{p.id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}" data-toggle="tooltip" data-placement="top" data-original-title="+{{ups}} | -{{downs}}">{{score}}</span>
{% if v %}
<span id="post-{{p.base36id}}-down-mobile" tabindex="0" data-id-down="{{p.base36id}}" data-content-type="post" class="ml-2 my-0 arrow-down downvote-button post-{{p.base36id}}-down {% if voted==-1 %}active{% endif %}">
<span id="post-{{p.id}}-down-mobile" tabindex="0" data-id-down="{{p.id}}" data-content-type="post" class="ml-2 my-0 arrow-down downvote-button post-{{p.id}}-down {% if voted==-1 %}active{% endif %}">
</span>
{% else %}
<span id="arrow-{{p.base36id}}-mobile-down" tabindex="0" class="arrow-mobile-down ml-2 my-0" onclick="location.href='/login?redirect={{request.path | urlencode}}';">
<span id="arrow-{{p.id}}-mobile-down" tabindex="0" class="arrow-mobile-down ml-2 my-0" onclick="location.href='/login?redirect={{request.path | urlencode}}';">
<i class="fas fa-arrow-alt-down mx-0" aria-hidden="true"></i>
</span>
{% endif %}
@ -528,8 +528,8 @@
<div id="comment-form-space-{{p.fullname}}" class="comment-write mb-3">
<form id="reply-to-{{p.fullname}}" class="input-group" action="/api/comment" method="post">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<input type="hidden" name="parent_fullname" value="t2_{{p.base36id}}">
<input id="reply-form-submission-{{p.fullname}}" type="hidden" name="submission" value="{{p.base36id}}">
<input type="hidden" name="parent_fullname" value="t2_{{p.id}}">
<input id="reply-form-submission-{{p.fullname}}" type="hidden" name="submission" value="{{p.id}}">
{% if v %}
<textarea id="reply-form-body-{{p.fullname}}" class="comment-box form-control rounded" id="comment-form" name="body" form="reply-to-{{p.fullname}}" aria-label="With textarea" placeholder="Add your comment..." rows="3"></textarea>
{% endif %}
@ -548,8 +548,8 @@
<div id="emoji-reply-btn-{{p.fullname}}" onclick="loadEmojis('reply-form-body-{{p.fullname}}')" aria-hidden="true" data-toggle="modal" data-target="#emojiModal" data-toggle="tooltip" data-placement="bottom" title="Add Emoji"><i class="fas fa-smile-beam"></i></div>
</label>
<label class="format btn btn-secondary m-0 ml-1 {% if v %}d-inline-block{% else %}d-none{% endif %}" for="file-upload-reply-{{p.fullname}}">
<div id="filename-show-reply-{{p.base36id}}"><i class="far fa-image"></i></div>
<input id="file-upload-reply-{{p.fullname}}" type="file" name="file" accept="image/*" onchange="document.getElementById('filename-show-reply-{{p.base36id}}').innerHTML='image';" hidden>
<div id="filename-show-reply-{{p.id}}"><i class="far fa-image"></i></div>
<input id="file-upload-reply-{{p.fullname}}" type="file" name="file" accept="image/*" onchange="document.getElementById('filename-show-reply-{{p.id}}').innerHTML='image';" hidden>
</label>
<!-- &nbsp;&nbsp;
<div class="custom-control custom-checkbox">

View File

@ -20,25 +20,25 @@
{% block adminpanel %}
{% if v.admin_level >=3 %}
<form action="/api/sticky/{{p.base36id}}" method="post">
<form action="/api/sticky/{{p.id}}" method="post">
<input type="hidden" name="formkey", value="{{v.formkey}}">
<input type="submit" value="{% if p.stickied %}Un-sticky{% else %}Pin{% endif %}">
</form>
{% endif %}
{% if v.admin_level >=3 and v.id==p.author_id %}
<form action="/api/distinguish/{{p.base36id}}" method="post">
<form action="/api/distinguish/{{p.id}}" method="post">
<input type="hidden" name="formkey", value="{{v.formkey}}">
<input type="submit" value="{% if p.distinguish_level %}Un-distinguish{% else %}Distinguish{% endif %}">
</form>
{% endif %}
{% if v.admin_level >=1 and v.admin_level > p.author.admin_level %}
{% if p.is_banned %}
<form action="/api/unban_post/{{p.base36id}}" method="post">
<form action="/api/unban_post/{{p.id}}" method="post">
<input type="hidden" name="formkey", value="{{v.formkey}}">
<input type="submit" value="Approve Post">
</form>
{% else %}
<form action="/api/ban_post/{{p.base36id}}", method="post">
<form action="/api/ban_post/{{p.id}}", method="post">
<input type="hidden" name="formkey", value="{{v.formkey}}">
<input type="submit" value="Remove Post">
</form>
@ -52,7 +52,7 @@
<div class="col-12">
<div id="post-{{p.base36id}}" class="card d-flex flex-row-reverse flex-nowrap justify-content-end border-0 p-0 {% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}">
<div id="post-{{p.id}}" class="card d-flex flex-row-reverse flex-nowrap justify-content-end border-0 p-0 {% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}">
<div class="card-block my-md-auto{% if p.is_banned %} banned{% endif %}">
<div class="post-meta text-left d-block d-md-none mb-1">{% if p.over_18 %}<span class="badge badge-danger">+18</span> {% endif %}{% if p.is_banned %}[Removed by admins]{% else %}[Deleted by user]{% endif %}</div>
<h5 class="card-title post-title text-left mb-0 mb-md-1">{{p.title}}</h5>
@ -63,12 +63,12 @@
<!-- Voting on "medium" devices or larger, hidden on smaller devices -->
<div id="voting" class="d-md-block my-auto mr-3 text-center">
<div id="post-{{p.base36id}}-up" class="arrow-up mx-auto">
<div id="post-{{p.id}}-up" class="arrow-up mx-auto">
</div>
<span id="post-{{p.base36id}}-score-up" class="score-up text-muted{% if voted!=1 %} d-none{% endif %}"></span>
<span id="post-{{p.base36id}}-score-none" class="score text-muted{% if voted!=0 and voted!=-2 %} d-none{% endif %}"></span>
<span id="post-{{p.base36id}}-score-down" class="score-down text-muted{% if voted!=-1 %} d-none{% endif %}"></span>
<div id="post-{{p.base36id}}-down" class="arrow-down mx-auto">
<span id="post-{{p.id}}-score-up" class="score-up text-muted{% if voted!=1 %} d-none{% endif %}"></span>
<span id="post-{{p.id}}-score-none" class="score text-muted{% if voted!=0 and voted!=-2 %} d-none{% endif %}"></span>
<span id="post-{{p.id}}-score-down" class="score-down text-muted{% if voted!=-1 %} d-none{% endif %}"></span>
<div id="post-{{p.id}}-down" class="arrow-down mx-auto">
</div>
</div>
@ -130,9 +130,9 @@
<span id="post-{{p.base36id}}-score-mobile-up" class="score-up text-muted{% if voted!=1 %} d-none{% endif %}"></span>
<span id="post-{{p.base36id}}-score-mobile-none" class="score text-muted{% if voted!=0 and voted!=-2 %} d-none{% endif %}"></span>
<span id="post-{{p.base36id}}-score-mobile-down" class="score-down text-muted{% if voted!=-1 %} d-none{% endif %}"></span>
<span id="post-{{p.id}}-score-mobile-up" class="score-up text-muted{% if voted!=1 %} d-none{% endif %}"></span>
<span id="post-{{p.id}}-score-mobile-none" class="score text-muted{% if voted!=0 and voted!=-2 %} d-none{% endif %}"></span>
<span id="post-{{p.id}}-score-mobile-down" class="score-down text-muted{% if voted!=-1 %} d-none{% endif %}"></span>
<span id="arrow-mobile-down" class="arrow-mobile-down ml-2 my-0">

View File

@ -20,7 +20,7 @@
{% endif %}
<div id="post-{{p.base36id}}" class="card{% if p.is_banned %} banned{% endif %}{% if p.deleted_utc > 0 %} deleted{% endif %}{% if p.stickied %} stickied{% endif %}{% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}{% if p.over_18 %} nsfw{% endif %}">
<div id="post-{{p.id}}" class="card{% if p.is_banned %} banned{% endif %}{% if p.deleted_utc > 0 %} deleted{% endif %}{% if p.stickied %} stickied{% endif %}{% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}{% if p.over_18 %} nsfw{% endif %}">
<div class="d-flex flex-row-reverse flex-md-row flex-nowrap justify-content-end">
@ -30,30 +30,30 @@
{% if v and request.path.startswith('/@') and v.admin_level == 0 %}
{% if voted==1 %}
<div class="mx-auto arrow-up post-{{p.base36id}}-up active"></div>
<div class="mx-auto arrow-up post-{{p.id}}-up active"></div>
{% endif %}
<span id="post-score-{{p.base36id}}" class="score post-score-{{p.base36id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}"{% if not p.is_banned %} data-toggle="tooltip" data-placement="right" data-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
<span id="post-score-{{p.id}}" class="score post-score-{{p.id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}"{% if not p.is_banned %} data-toggle="tooltip" data-placement="right" data-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
{% if voted==-1 %}
<div class="text-muted mx-auto arrow-down post-{{p.base36id}}-down active"></div>
<div class="text-muted mx-auto arrow-down post-{{p.id}}-down active"></div>
{% endif %}
{% elif v %}
<div id="post-{{p.base36id}}-up" tabindex="0" data-id-up="{{p.base36id}}" data-content-type="post" class="mx-auto arrow-up upvote-button post-{{p.base36id}}-up {% if voted==1 %}active{% endif %}"></div>
<div id="post-{{p.id}}-up" tabindex="0" data-id-up="{{p.id}}" data-content-type="post" class="mx-auto arrow-up upvote-button post-{{p.id}}-up {% if voted==1 %}active{% endif %}"></div>
<span id="post-score-{{p.base36id}}" class="score post-score-{{p.base36id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}"{% if not p.is_banned %} data-toggle="tooltip" data-placement="right" data-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
<span id="post-score-{{p.id}}" class="score post-score-{{p.id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}"{% if not p.is_banned %} data-toggle="tooltip" data-placement="right" data-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
<div id="post-{{p.base36id}}-down" tabindex="0" data-id-down="{{p.base36id}}" data-content-type="post" class="text-muted mx-auto arrow-down downvote-button post-{{p.base36id}}-down {% if voted==-1 %}active{% endif %}"></div>
<div id="post-{{p.id}}-down" tabindex="0" data-id-down="{{p.id}}" data-content-type="post" class="text-muted mx-auto arrow-down downvote-button post-{{p.id}}-down {% if voted==-1 %}active{% endif %}"></div>
{% else %}
<div id="post-{{p.base36id}}-up" tabindex="0" class="mx-auto arrow-up" onclick="location.href='/login';"></div>
<div id="post-{{p.id}}-up" tabindex="0" class="mx-auto arrow-up" onclick="location.href='/login';"></div>
<span id="post-{{p.base36id}}-score-none" class="score"{% if not p.is_banned %} data-toggle="tooltip" data-placement="right" data-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
<span id="post-{{p.id}}-score-none" class="score"{% if not p.is_banned %} data-toggle="tooltip" data-placement="right" data-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
<div id="post-{{p.base36id}}-down" tabindex="0" class="text-muted mx-auto arrow-down" onclick="location.href='/login';"></div>
<div id="post-{{p.id}}-down" tabindex="0" class="text-muted mx-auto arrow-down" onclick="location.href='/login';"></div>
{% endif %}
@ -128,7 +128,7 @@
<div class="post-actions mt-2 d-none d-md-block">
<ul class="list-inline text-right d-flex">
{% if p.realbody(v) %}
<li class="list-inline-item"><a href="javascript:void(0)" class="text-expand" data-id="{{p.base36id}}"><i class="fas fa-expand-alt mr-0 text-expand-icon-{{p.base36id}}"></i></a></li>
<li class="list-inline-item"><a href="javascript:void(0)" class="text-expand" data-id="{{p.id}}"><i class="fas fa-expand-alt mr-0 text-expand-icon-{{p.id}}"></i></a></li>
{% endif %}
<li class="list-inline-item"><a {% if v and v.newtab %}target="_blank"{% endif %} href="{{p.permalink}}"><i class="fas fa-comment-dots"></i>{{p.comment_count}}</a></li>
@ -147,29 +147,29 @@
{% endif %}
{% if v and p.id in v.saved_idlist() %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/unsave_post/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-save"></i>Unsave</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/unsave_post/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-save"></i>Unsave</a></li>
{% elif v %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/save_post/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-save"></i>Save</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/save_post/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-save"></i>Save</a></li>
{% endif %}
{% if not (v and v.id==p.author_id) %}
<li class="list-inline-item"><a href="javascript:void(0)" data-toggle="modal" data-dismiss="modal" data-target="#reportPostModal" onclick="report_postModal('{{p.base36id}}', '{{p.author.username}}')"><i class="fas fa-flag"></i>Report</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" data-toggle="modal" data-dismiss="modal" data-target="#reportPostModal" onclick="report_postModal('{{p.id}}', '{{p.author.username}}')"><i class="fas fa-flag"></i>Report</a></li>
{% endif %}
{% if v and v.id==p.author_id %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/pin/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-thumbtack"></i>{% if p.is_pinned %}Unpin from your profile{% else %}Pin to your profile{% endif %}</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/pin/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-thumbtack"></i>{% if p.is_pinned %}Unpin from your profile{% else %}Pin to your profile{% endif %}</a></li>
{% if p.deleted_utc > 0 %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/undelete_post/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-trash-alt"></i>Undelete</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/undelete_post/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-trash-alt"></i>Undelete</a></li>
{% else %}
<li class="list-inline-item"><a href="javascript:void(0)" data-toggle="modal" data-dismiss="modal" data-target="#deletePostModal" onclick="delete_postModal('{{p.base36id}}')"><i class="fas fa-trash-alt"></i>Delete</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" data-toggle="modal" data-dismiss="modal" data-target="#deletePostModal" onclick="delete_postModal('{{p.id}}')"><i class="fas fa-trash-alt"></i>Delete</a></li>
{% endif %}
{% endif %}
{% if v and v.admin_level>=3 %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/sticky/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-thumbtack"></i>{% if p.stickied %}Unpin{% else %}Pin{% endif %}</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/sticky/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-thumbtack"></i>{% if p.stickied %}Unpin{% else %}Pin{% endif %}</a></li>
{% if v==p.author %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/distinguish/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-crown"></i>Distinguish</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/distinguish/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-crown"></i>Distinguish</a></li>
{% endif %}
{% endif %}
@ -177,13 +177,13 @@
{% if v and (v.id==p.author_id or v.admin_level>=3) %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/toggle_post_nsfw/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-eye-evil text-danger"></i>Toggle +18</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/api/toggle_post_nsfw/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-eye-evil text-danger"></i>Toggle +18</a></li>
{% endif %}
{% if v.admin_level >=3 %}
<li class="list-inline-item"><a id="moderate-post-{{p.base36id}}" href="javascript:void(0)" onclick="post('/api/unban_post/{{p.base36id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-check text-success"></i>Approve</a></li>
<li class="list-inline-item"><a id="moderate-post-{{p.base36id}}" href="javascript:void(0)" onclick="post('/api/ban_post/{{p.base36id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-ban text-danger"></i>Remove</a></li>
<li class="list-inline-item"><a id="moderate-post-{{p.id}}" href="javascript:void(0)" onclick="post('/api/unban_post/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-check text-success"></i>Approve</a></li>
<li class="list-inline-item"><a id="moderate-post-{{p.id}}" href="javascript:void(0)" onclick="post('/api/ban_post/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-ban text-danger"></i>Remove</a></li>
{% endif %}
{% if v.admin_level >= 4 and p.oauth_app %}
@ -191,16 +191,16 @@
{% endif %}
{% if not v.id==p.author_id and v.admin_level == 0 %}
<li id="block-user-{{p.base36id}}" class="list-inline-item {% if p.is_blocking %} d-none{% endif %}"><a href="javascript:void(0)" onclick="post_toast('/settings/block?username={{p.author.username}}', callback=function(){window.location.reload(true);})"><i class="fas fa-eye-slash"></i>Block user</a></li>
<li id="unblock-user-{{p.base36id}}" class="list-inline-item {% if not p.is_blocking %} d-none{% endif %}"><a href="javascript:void(0)" onclick="post_toast('/settings/unblock?username={{p.author.username}}', callback=function(){window.location.reload(true);})"><i class="fas fa-eye"></i>Unblock user</a></li>
<li id="block-user-{{p.id}}" class="list-inline-item {% if p.is_blocking %} d-none{% endif %}"><a href="javascript:void(0)" onclick="post_toast('/settings/block?username={{p.author.username}}', callback=function(){window.location.reload(true);})"><i class="fas fa-eye-slash"></i>Block user</a></li>
<li id="unblock-user-{{p.id}}" class="list-inline-item {% if not p.is_blocking %} d-none{% endif %}"><a href="javascript:void(0)" onclick="post_toast('/settings/unblock?username={{p.author.username}}', callback=function(){window.location.reload(true);})"><i class="fas fa-eye"></i>Unblock user</a></li>
{% endif %}
{% if v.admin_level >=3 and v.id!=p.author_id %}
{% if p.author.is_banned %}
<li class="list-inline-item"><a id="unexile2-user-{{p.base36id}}" href="javascript:void(0)" onclick="post_toast('/api/unban_user/{{p.author_id}}')"
<li class="list-inline-item"><a id="unexile2-user-{{p.id}}" href="javascript:void(0)" onclick="post_toast('/api/unban_user/{{p.author_id}}')"
><i class="fas fa-user-slash text-danger"></i>Unban user</a></li>
{% else %}
<li class="list-inline-item"><a id="exile2-user-{{p.base36id}}" href="javascript:void(0)" onclick="post_toast('/api/ban_user/{{p.author_id}}')"
<li class="list-inline-item"><a id="exile2-user-{{p.id}}" href="javascript:void(0)" onclick="post_toast('/api/ban_user/{{p.author_id}}')"
><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
{% endif %}
{% endif %}
@ -212,7 +212,7 @@
</div>
{% if p.realbody(v) %}
<div class="d-none card rounded border pb-0 pt-3 my-2" id="post-text-{{p.base36id}}">
<div class="d-none card rounded border pb-0 pt-3 my-2" id="post-text-{{p.id}}">
{{p.realbody(v) | safe}}
</div>
{% endif %}
@ -223,55 +223,55 @@
<li class="list-inline-item mr-auto"><a {% if v and v.newtab %}target="_blank"{% endif %} href="{{p.permalink}}"{% if p.author.is_private %} rel="nofollow"{% endif %}><i class="fas fa-comment-dots"></i>{{p.comment_count}}</a></li>
{% if p.realbody(v) and request.path != "/changelog"%}
<li class="list-inline-item"><a href="javascript:void(0)" class="text-expand" data-id="{{p.base36id}}"><i class="fas fa-expand-alt mr-0 text-expand-icon-{{p.base36id}}"></i></a></li>
<li class="list-inline-item"><a href="javascript:void(0)" class="text-expand" data-id="{{p.id}}"><i class="fas fa-expand-alt mr-0 text-expand-icon-{{p.id}}"></i></a></li>
{% endif %}
<li class="list-inline-item"><a href="javascript:void(0);" role="button" class="copy-link" data-clipboard-text="{{p.permalink | full_link}}"><i class="fas fa-link"></i>Share</a></li>
{% if v %}
<li class="list-inline-item">
<a href="#" data-toggle="modal" data-target="#actionsModal-{{p.base36id}}">
<a href="#" data-toggle="modal" data-target="#actionsModal-{{p.id}}">
<i class="fas fa-ellipsis-h"></i>
</a>
</li>
{% endif %}
{% if v and request.path.startswith('/@') and v.admin_level == 0 %}
<li id="voting-{{p.base36id}}-mobile" class="voting list-inline-item d-md-none">
<li id="voting-{{p.id}}-mobile" class="voting list-inline-item d-md-none">
{% if voted==1 %}
<span class="mr-2 arrow-up post-{{p.base36id}}-up active">
<span class="mr-2 arrow-up post-{{p.id}}-up active">
</span>
{% endif %}
<span id="post-score-{{p.base36id}}-mobile" class="score post-score-{{p.base36id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}"{% if not p.is_banned %} data-toggle="tooltip" data-placement="top" data-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
<span id="post-score-{{p.id}}-mobile" class="score post-score-{{p.id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}"{% if not p.is_banned %} data-toggle="tooltip" data-placement="top" data-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
{% if voted==-1 %}
<span class="ml-2 my-0 arrow-down post-{{p.base36id}}-down active">
<span class="ml-2 my-0 arrow-down post-{{p.id}}-down active">
</span>
{% endif %}
</li>
{% elif v %}
<li id="voting-{{p.base36id}}-mobile" class="voting list-inline-item d-md-none">
<li id="voting-{{p.id}}-mobile" class="voting list-inline-item d-md-none">
<span id="post-{{p.base36id}}-up-mobile" tabindex="0" data-id-up="{{p.base36id}}" data-content-type="post" class="mr-2 arrow-up upvote-button post-{{p.base36id}}-up {% if voted==1 %}active{% endif %}">
<span id="post-{{p.id}}-up-mobile" tabindex="0" data-id-up="{{p.id}}" data-content-type="post" class="mr-2 arrow-up upvote-button post-{{p.id}}-up {% if voted==1 %}active{% endif %}">
</span>
<span id="post-score-{{p.base36id}}-mobile" class="score post-score-{{p.base36id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}"{% if not p.is_banned %} data-toggle="tooltip" data-placement="top" data-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
<span id="post-score-{{p.id}}-mobile" class="score post-score-{{p.id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}"{% if not p.is_banned %} data-toggle="tooltip" data-placement="top" data-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
<span id="post-{{p.base36id}}-down-mobile" tabindex="0" data-id-down="{{p.base36id}}" data-content-type="post" class="ml-2 my-0 arrow-down downvote-button post-{{p.base36id}}-down {% if voted==-1 %}active{% endif %}">
<span id="post-{{p.id}}-down-mobile" tabindex="0" data-id-down="{{p.id}}" data-content-type="post" class="ml-2 my-0 arrow-down downvote-button post-{{p.id}}-down {% if voted==-1 %}active{% endif %}">
</span>
</li>
{% else %}
<li id="voting-{{p.base36id}}-mobile" class="voting list-inline-item d-md-none">
<span id="arrow-{{p.base36id}}-mobile-up" tabindex="0" class="mr-2 arrow-mobile-up" onclick="location.href='/login';">
<li id="voting-{{p.id}}-mobile" class="voting list-inline-item d-md-none">
<span id="arrow-{{p.id}}-mobile-up" tabindex="0" class="mr-2 arrow-mobile-up" onclick="location.href='/login';">
<i class="fas fa-arrow-alt-up mx-0" aria-hidden="true"></i>
</span>
<span id="post-score-{{p.base36id}}-mobile" class="score"{% if not p.is_banned %} data-toggle="tooltip" data-placement="top" data-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
<span id="post-score-{{p.id}}-mobile" class="score"{% if not p.is_banned %} data-toggle="tooltip" data-placement="top" data-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
<span id="arrow-{{p.base36id}}-mobile-down" tabindex="0" class="arrow-mobile-down ml-2 my-0" onclick="location.href='/login';">
<span id="arrow-{{p.id}}-mobile-down" tabindex="0" class="arrow-mobile-down ml-2 my-0" onclick="location.href='/login';">
<i class="fas fa-arrow-alt-down mx-0" aria-hidden="true"></i>
</span>
</li>
@ -282,7 +282,7 @@
</div>
<!-- Post Actions Modal -->
<div class="modal fade modal-sm-bottom d-md-none" id="actionsModal-{{p.base36id}}" tabindex="-1" role="dialog" aria-labelledby="actionsModalTitle" aria-hidden="true">
<div class="modal fade modal-sm-bottom d-md-none" id="actionsModal-{{p.id}}" tabindex="-1" role="dialog" aria-labelledby="actionsModalTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header p-3">
@ -306,25 +306,25 @@
{% endif %}
{% if v and p.id in v.saved_idlist() %}
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post('/unsave_post/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-save text-center text-muted mr-3"></i>Unsave</a></button>
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post('/unsave_post/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-save text-center text-muted mr-3"></i>Unsave</a></button>
{% elif v %}
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post('/save_post/{{p.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-save text-center text-muted mr-3"></i>Save</a></button>
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post('/save_post/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-save text-center text-muted mr-3"></i>Save</a></button>
{% endif %}
{% if not (v and v.id==p.author_id) %}
<button class="btn btn-link btn-block btn-lg text-left text-muted" data-toggle="modal" data-dismiss="modal" data-target="#reportPostModal" onclick="report_postModal('{{p.base36id}}','{{'@'+p.author.username}}')" class="d-block"><i class="far fa-flag text-center text-muted mr-3"></i>Report</button>
<button class="btn btn-link btn-block btn-lg text-left text-muted" data-toggle="modal" data-dismiss="modal" data-target="#reportPostModal" onclick="report_postModal('{{p.id}}','{{'@'+p.author.username}}')" class="d-block"><i class="far fa-flag text-center text-muted mr-3"></i>Report</button>
{% endif %}
{% if v and v.id==p.author_id %}
<button class="btn btn-link btn-block btn-lg text-info text-left" id="pin-post-{{p.base36id}}" href="javascript:void(0)" onclick="post('/api/pin/{{p.base36id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-thumbtack text-center text-muted mr-3"></i>{% if p.is_pinned %}Unpin from your profile{% else %}Pin to your profile{% endif %}</button>
<button class="btn btn-link btn-block btn-lg text-info text-left" id="pin-post-{{p.id}}" href="javascript:void(0)" onclick="post('/api/pin/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-thumbtack text-center text-muted mr-3"></i>{% if p.is_pinned %}Unpin from your profile{% else %}Pin to your profile{% endif %}</button>
{% if p.deleted_utc > 0 %}
<button class="btn btn-link btn-block btn-lg text-left text-muted" href="javascript:void(0)" onclick="post('/undelete_post/{{p.base36id}}', function(){window.location.reload(true);})"><i class="far fa-trash-alt text-center text-muted mr-3"></i>Undelete</button>
<button class="btn btn-link btn-block btn-lg text-left text-muted" href="javascript:void(0)" onclick="post('/undelete_post/{{p.id}}', function(){window.location.reload(true);})"><i class="far fa-trash-alt text-center text-muted mr-3"></i>Undelete</button>
{% else %}
<button class="btn btn-link btn-block btn-lg text-left text-muted" data-toggle="modal" data-dismiss="modal" data-target="#deletePostModal" onclick="delete_postModal('{{p.base36id}}')"><i class="far fa-trash-alt text-center text-muted mr-3"></i>Delete</button>
<button class="btn btn-link btn-block btn-lg text-left text-muted" data-toggle="modal" data-dismiss="modal" data-target="#deletePostModal" onclick="delete_postModal('{{p.id}}')"><i class="far fa-trash-alt text-center text-muted mr-3"></i>Delete</button>
{% endif %}
{% endif %}
{% if v and (v.id==p.author_id or v.admin_level>=3) %}
<button class="btn btn-link btn-block btn-lg text-left text-muted" onclick="post('/api/toggle_post_nsfw/{{p.base36id}}', function(){window.location.reload(true);})"><i class="far fa-eye-evil text-center text-muted mr-3"></i>Toggle +18</button>
<button class="btn btn-link btn-block btn-lg text-left text-muted" onclick="post('/api/toggle_post_nsfw/{{p.id}}', function(){window.location.reload(true);})"><i class="far fa-eye-evil text-center text-muted mr-3"></i>Toggle +18</button>
{% endif %}
{% if v %}
@ -337,15 +337,15 @@
{% endif %}
{% endif %}
<button class="btn btn-link btn-block btn-lg text-info text-left" id="sticky-post-{{p.base36id}}" href="javascript:void(0)" onclick="post('/api/sticky/{{p.base36id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-thumbtack text-center text-muted mr-3"></i>{% if p.stickied %}Unpin{% else %}Pin{% endif %}</button>
<button class="btn btn-link btn-block btn-lg text-info text-left" id="sticky-post-{{p.id}}" href="javascript:void(0)" onclick="post('/api/sticky/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-thumbtack text-center text-muted mr-3"></i>{% if p.stickied %}Unpin{% else %}Pin{% endif %}</button>
{% if v==p.author %}
<button class="btn btn-link btn-block btn-lg text-left text-warning" id="distinguish-post-{{p.base36id}}" href="javascript:void(0)" onclick="post('/api/distinguish/{{p.base36id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-crown text-center text-muted mr-3"></i>Distinguish</button>
<button class="btn btn-link btn-block btn-lg text-left text-warning" id="distinguish-post-{{p.id}}" href="javascript:void(0)" onclick="post('/api/distinguish/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-crown text-center text-muted mr-3"></i>Distinguish</button>
{% endif %}
<button class="btn btn-link btn-block btn-lg text-success text-left" id="moderate-post-{{p.base36id}}" href="javascript:void(0)" onclick="post('/api/unban_post/{{p.base36id}}',callback=function(){window.location.reload(true);})"><i class="far fa-check text-center text-success mr-3"></i>Approve</button>
<button class="btn btn-link btn-block btn-lg text-danger text-left" id="moderate-post-{{p.base36id}}" href="javascript:void(0)" onclick="post('/api/ban_post/{{p.base36id}}',callback=function(){window.location.reload(true);})"><i class="far fa-ban text-center text-danger mr-3"></i>Remove</button>
<button class="btn btn-link btn-block btn-lg text-success text-left" id="moderate-post-{{p.id}}" href="javascript:void(0)" onclick="post('/api/unban_post/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="far fa-check text-center text-success mr-3"></i>Approve</button>
<button class="btn btn-link btn-block btn-lg text-danger text-left" id="moderate-post-{{p.id}}" href="javascript:void(0)" onclick="post('/api/ban_post/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="far fa-ban text-center text-danger mr-3"></i>Remove</button>
{% endif %}
{% if v.admin_level >=4 and p.oauth_app %}
@ -355,9 +355,9 @@
{% endif %}
{% if v and not v.id==p.author_id and v.admin_level == 0 %}
<button id="block-user-button-{{p.base36id}}" class="btn btn-link btn-block btn-lg text-left text-danger{% if p.is_blocking %} d-none{% endif %}" data-dismiss="modal" onclick="post_toast('/settings/block?username={{p.author.username}}', callback=function(){window.location.reload(true);})"
<button id="block-user-button-{{p.id}}" class="btn btn-link btn-block btn-lg text-left text-danger{% if p.is_blocking %} d-none{% endif %}" data-dismiss="modal" onclick="post_toast('/settings/block?username={{p.author.username}}', callback=function(){window.location.reload(true);})"
><i class="fas fa-eye-slash mr-3"></i>Block user</button>
<button id="unblock-user-button-{{p.base36id}}" class="btn btn-link btn-block btn-lg text-left text-danger{% if not p.is_blocking %} d-none{% endif %}" data-dismiss="modal" onclick="post_toast('/settings/unblock?username={{p.author.username}}', callback=function(){window.location.reload(true);})"
<button id="unblock-user-button-{{p.id}}" class="btn btn-link btn-block btn-lg text-left text-danger{% if not p.is_blocking %} d-none{% endif %}" data-dismiss="modal" onclick="post_toast('/settings/unblock?username={{p.author.username}}', callback=function(){window.location.reload(true);})"
><i class="fas fa-eye mr-3"></i>Unblock user</button>
{% endif %}
</ul>

View File

@ -2,7 +2,7 @@
{% for u in users %}
<div class="col-12 col-sm-6 col-md-6 col-lg-4 col-xl-3 mb-4">
<div id="user-{{u.base36id}}" class="card h-100">
<div id="user-{{u.id}}" class="card h-100">
<div style="position: relative;"><img src="{{u.banner_url}}" class="card-img-top" alt="@{{u.username}} user banner" style="height: 175px; object-fit: cover">
<img src="{{u.profile_url}}" class="profile-pic-50 border-3 border-white" style="position: absolute; left: 15px; bottom: 15px; box-sizing: content-box;"></div>
@ -13,11 +13,11 @@
{% if v %}
{% if v.id!=u.id and not u.is_private and not u.is_nofollow %}
<div id="button-sub-{{u.base36id}}" style="z-index: 2" class="{% if u.has_follower(v) %}d-none{% endif %}"><a class="btn btn-primary btn-sm" href="javascript:void(0)" onclick="post('/api/follow/{{u.username}}', callback=function(){document.getElementById('button-unsub-{{u.base36id}}').classList.toggle('d-none');document.getElementById('button-sub-{{u.base36id}}').classList.toggle('d-none');})">Follow</a></div>
<div id="button-unsub-{{u.base36id}}" style="z-index: 2" class="{% if not u.has_follower(v) %} d-none{% endif %}"><a class="btn btn-secondary btn-sm" href="javascript:void(0)" onclick="post('/api/unfollow/{{u.username}}', callback=function(){document.getElementById('button-unsub-{{u.base36id}}').classList.toggle('d-none');document.getElementById('button-sub-{{u.base36id}}').classList.toggle('d-none');})">Unfollow</a></div>
<div id="button-sub-{{u.id}}" style="z-index: 2" class="{% if u.has_follower(v) %}d-none{% endif %}"><a class="btn btn-primary btn-sm" href="javascript:void(0)" onclick="post('/api/follow/{{u.username}}', callback=function(){document.getElementById('button-unsub-{{u.id}}').classList.toggle('d-none');document.getElementById('button-sub-{{u.id}}').classList.toggle('d-none');})">Follow</a></div>
<div id="button-unsub-{{u.id}}" style="z-index: 2" class="{% if not u.has_follower(v) %} d-none{% endif %}"><a class="btn btn-secondary btn-sm" href="javascript:void(0)" onclick="post('/api/unfollow/{{u.username}}', callback=function(){document.getElementById('button-unsub-{{u.id}}').classList.toggle('d-none');document.getElementById('button-sub-{{u.id}}').classList.toggle('d-none');})">Unfollow</a></div>
{% endif %}
{% else %}
<div id="button-sub-{{u.base36id}}" style="z-index: 2" "><a class="btn btn-primary btn-sm" href="/signup?redirect={{request.path}}">Follow</a></div>
<div id="button-sub-{{u.id}}" style="z-index: 2" "><a class="btn btn-primary btn-sm" href="/signup?redirect={{request.path}}">Follow</a></div>
{% endif %}
</div>