forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-08-11 19:01:19 +02:00
parent 4fdbbefe8e
commit 7e76d21ac0
26 changed files with 143 additions and 248 deletions

View File

@ -114,13 +114,11 @@ class Age_times:
class Scores:
@property
#@cache.memoize(timeout=60)
def score_percent(self):
return 101
@property
#@cache.memoize(timeout=60)
def score(self):
return int(self.score) or 0
@ -128,7 +126,6 @@ class Scores:
class Fuzzing:
@property
#@cache.memoize(timeout=60)
def score_fuzzed(self):
real = self.score

View File

@ -153,7 +153,7 @@ class User(Base, Stndrd, Age_times):
def strid(self):
return str(self.id)
@cache.memoize(300)
@cache.memoize()
def userpagelisting(self, v=None, page=1, sort="new", t="all"):
submissions = g.db.query(Submission).options(lazyload('*')).filter_by(author_id=self.id, is_pinned=False)
@ -195,7 +195,7 @@ class User(Base, Stndrd, Age_times):
listing = [x.id for x in submissions[firstrange:secondrange]]
return listing
@cache.memoize(300)
@cache.memoize()
def commentlisting(self, v=None, page=1, sort="new", t="all"):
comments = self.comments.options(lazyload('*')).filter(Comment.parent_submission != None).join(Comment.post)
@ -445,7 +445,7 @@ class User(Base, Stndrd, Age_times):
if self.bannerurl: return self.bannerurl
else: return f"https://{site}/assets/images/default_bg.png"
@cache.memoize(0)
@cache.memoize()
def defaultpicture(self):
pic = random.randint(1, 50)
return f"https://{site}/assets/images/defaultpictures/{pic}.png"

View File

@ -32,7 +32,6 @@ def send_notification(vid, user, text):
notif = Notification(comment_id=new_comment.id,
user_id=user.id)
g.db.add(notif)
g.db.commit()
def send_pm(vid, user, text):
@ -55,7 +54,6 @@ def send_pm(vid, user, text):
notif = Notification(comment_id=new_comment.id, user_id=user.id)
g.db.add(notif)
g.db.commit()
def send_follow_notif(vid, user, text):
@ -82,7 +80,6 @@ def send_follow_notif(vid, user, text):
user_id=user,
followsender=vid)
g.db.add(notif)
g.db.commit()
def send_unfollow_notif(vid, user, text):
@ -109,7 +106,6 @@ def send_unfollow_notif(vid, user, text):
user_id=user,
unfollowsender=vid)
g.db.add(notif)
g.db.commit()
def send_block_notif(vid, user, text):
@ -136,7 +132,6 @@ def send_block_notif(vid, user, text):
user_id=user,
blocksender=vid)
g.db.add(notif)
g.db.commit()
def send_unblock_notif(vid, user, text):
@ -163,7 +158,6 @@ def send_unblock_notif(vid, user, text):
user_id=user,
unblocksender=vid)
g.db.add(notif)
g.db.commit()
def send_admin(vid, text):
@ -187,4 +181,3 @@ def send_admin(vid, text):
for admin in admins:
notif = Notification(comment_id=new_comment.id, user_id=admin.id)
g.db.add(notif)
g.db.commit()

View File

@ -1,21 +1,4 @@
from os import environ, path
from .get import *
from files.__main__ import app, cache
@app.template_filter("total_users")
@cache.memoize(timeout=60)
def total_users(x):
return db.query(User).filter_by(is_banned=0).count()
@app.template_filter("source_code")
@cache.memoize(timeout=60 * 60 * 24)
def source_code(file_name):
return open(path.expanduser('~') + '/files/' +
file_name, mode="r+").read()
from files.__main__ import app
@app.template_filter("full_link")
@ -24,28 +7,6 @@ def full_link(url):
return f"https://{app.config['SERVER_NAME']}{url}"
@app.template_filter("env")
def env_var_filter(x):
x = environ.get(x, 1)
try:
return int(x)
except BaseException:
try:
return float(x)
except BaseException:
return x
@app.template_filter("js_str_escape")
def js_str_escape(s):
s = s.replace("'", r"\'")
return s
@app.template_filter("app_config")
def app_config(x):
return app.config.get(x)

View File

@ -66,7 +66,7 @@ def check_ban_evade(v):
)
g.db.add(ma)
g.db.commit()
g.db.flush()
for comment in g.db.query(Comment).filter_by(author_id=v.id).all():
if comment.is_banned:
@ -84,14 +84,14 @@ def check_ban_evade(v):
)
g.db.add(ma)
g.db.commit()
g.db.flush()
try: abort(403)
except Exception as e: print(e)
else:
v.ban_evade +=1
g.db.add(v)
g.db.commit()
g.db.flush()

View File

@ -158,7 +158,6 @@ def badge_grant_post(v):
if user.has_badge(badge_id):
g.db.query(Badge).filter_by(badge_id=badge_id, user_id=user.id,).delete()
g.db.commit()
return redirect(user.url)
new_badge = Badge(badge_id=badge_id,
@ -173,8 +172,6 @@ def badge_grant_post(v):
g.db.add(new_badge)
g.db.commit()
text = f"""
@{v.username} has given you the following profile badge:
\n\n![]({new_badge.path})
@ -370,7 +367,6 @@ def admin_link_accounts(v):
)
g.db.add(new_alt)
g.db.commit()
return redirect(f"/admin/alt_votes?u1={g.db.query(User).get(u1).username}&u2={g.db.query(User).get(u2).username}")
@ -463,7 +459,6 @@ def admin_image_ban(v):
)
g.db.add(new_bp)
g.db.commit()
return render_template("admin/image_ban.html", v=v, success=True)
@ -505,10 +500,9 @@ def agendaposter(user_id, v):
)
g.db.add(ma)
if 'toast' in request.args:
return "", 204
else:
return redirect(user.url)
user.refresh_selfset_badges()
return "", 204
@app.post("/shadowban/<user_id>")
@admin_level_required(6)
@ -601,8 +595,8 @@ def ban_user(user_id, v):
# check for number of days for suspension
days = int(request.form.get("days")) if request.form.get('days') else 0
reason = request.form.get("reason", "")
message = request.form.get("reason", "")
reason = request.values.get("reason", "")
message = request.values.get("reason", "")
if not user: abort(400)
@ -640,11 +634,9 @@ def ban_user(user_id, v):
note=f'reason: "{reason}", duration: {duration}'
)
g.db.add(ma)
g.db.commit()
if request.args.get("notoast"): return (redirect(user.url), user)
return {"message": f"@{user.username} was banned"}
if 'reason' in request.args: return {"message": f"@{user.username} was banned!"}
else: return redirect(user.url)
@app.post("/unban_user/<user_id>")
@ -673,10 +665,11 @@ def unban_user(user_id, v):
target_user_id=user.id,
)
g.db.add(ma)
g.db.commit()
if request.args.get("notoast"): return (redirect(user.url), user)
return {"message": f"@{user.username} was unbanned"}
if 'reason' in request.args:
return {"message": f"@{user.username} was unbanned!"}
else:
return redirect(user.url)
@app.post("/ban_post/<post_id>")
@admin_level_required(3)
@ -776,7 +769,6 @@ def api_sticky_post(post_id, v):
if post:
post.stickied = not (post.stickied)
g.db.add(post)
g.db.commit()
cache.delete_memoized(frontlist)
@ -852,7 +844,6 @@ def admin_distinguish_comment(c_id, v):
comment.distinguish_level = 0 if comment.distinguish_level else v.admin_level
g.db.add(comment)
g.db.commit()
html=render_template(
"comments.html",
v=v,
@ -864,18 +855,6 @@ def admin_distinguish_comment(c_id, v):
return html
@app.get("/admin/refund")
@admin_level_required(6)
def refund(v):
for u in g.db.query(User).all():
if u.id == 253: continue
posts=sum([x[0]+x[1]-1 for x in g.db.query(Submission.upvotes, Submission.downvotes).options(lazyload('*')).filter_by(author_id = u.id, is_banned = False, deleted_utc = 0).all()])
comments=sum([x[0]+x[1]-1 for x in g.db.query(Comment.upvotes, Comment.downvotes).options(lazyload('*')).filter_by(author_id = u.id, is_banned = False, deleted_utc = 0).all()])
u.coins = int(posts+comments)
g.db.add(u)
return "sex"
@app.get("/admin/dump_cache")
@admin_level_required(6)
def admin_dump_cache(v):
@ -970,7 +949,6 @@ def admin_nunuke_user(v):
@app.get("/admin/user_stat_data")
@admin_level_required(2)
@cache.memoize(timeout=60)
def user_stat_data(v):
days = int(request.args.get("days", 25))

View File

@ -150,7 +150,7 @@ def api_comment(v):
body = request.form.get("body", "")[:10000]
body = body.strip()
if not body and not request.files.get('file'): return jsonify({"error":"You need to actually write something!"}), 400
if not body and not request.files.get('file'): return {"error":"You need to actually write something!"}, 400
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").replace("\n\n\n", "\n\n")
@ -171,7 +171,7 @@ def api_comment(v):
v.ban(days=30, reason="Digitally malicious content")
if any([x.reason==7 for x in bans]):
v.ban( reason="Sexualizing minors")
return jsonify({"error": reason}), 401
return {"error": reason}, 401
# check existing
existing = g.db.query(Comment).join(CommentAux).filter(Comment.author_id == v.id,
@ -181,11 +181,10 @@ def api_comment(v):
CommentAux.body == body
).options(contains_eager(Comment.comment_aux)).first()
if existing:
return jsonify({"error": f"You already made that comment: {existing.permalink}"}), 409
return {"error": f"You already made that comment: {existing.permalink}"}, 409
if parent.author.any_block_exists(v) and not v.admin_level>=3:
return jsonify(
{"error": "You can't reply to users who have blocked you, or users you have blocked."}), 403
return {"error": "You can't reply to users who have blocked you, or users you have blocked."}, 403
# get bot status
is_bot = request.headers.get("X-User-Type","")=="Bot"
@ -235,8 +234,7 @@ def api_comment(v):
)
g.db.add(ma)
g.db.commit()
return jsonify({"error": "Too much spam!"}), 403
return {"error": "Too much spam!"}, 403
# check badlinks
soup = BeautifulSoup(body_html, features="html.parser")
@ -256,8 +254,7 @@ def api_comment(v):
literal(check_url).contains(
BadLink.link)).first()
if badlink:
return jsonify({"error": f"Remove the following link and try again: `{check_url}`. Reason: {badlink.reason}"}), 403
if badlink: return {"error": f"Remove the following link and try again: `{check_url}`. Reason: {badlink.reason}"}, 403
# create comment
parent_id = parent_fullname.split("_")[1]
c = Comment(author_id=v.id,
@ -273,10 +270,8 @@ def api_comment(v):
g.db.flush()
if request.files.get("file") and request.headers.get("cf-ipcountry") != "T1":
file=request.files["file"]
if not file.content_type.startswith('image/'):
return jsonify({"error": "That wasn't an image!"}), 400
if not file.content_type.startswith('image/'): return {"error": "That wasn't an image!"}, 400
name = f'comment/{c.id}/{secrets.token_urlsafe(8)}'
url = upload_file(file)
body = request.form.get("body") + f"\n![]({url})"
@ -507,7 +502,7 @@ def api_comment(v):
c=get_comment(c.id, v=v)
cache.delete_memoized(comment_idlist)
cache.delete_memoized(User.commentlisting, v)
cache.delete_memoized(User.commentlisting, v=v)
v.comment_count = v.comments.filter(Comment.parent_submission != None).filter_by(is_banned=False, deleted_utc=0).count()
g.db.add(v)
@ -618,7 +613,6 @@ def edit_comment(cid, v):
comment.ban_reason = "Automatic spam removal. This happened because the post's creator submitted too much similar content too quickly."
g.db.add(comment)
g.db.commit()
return {"error": "Too much spam!"}, 403
if request.files.get("file") and request.headers.get("cf-ipcountry") != "T1":
@ -680,9 +674,7 @@ def edit_comment(cid, v):
g.db.add(c)
g.db.commit()
path = request.form.get("current_page", "/")
g.db.flush()
# queue up notifications for username mentions
notify_users = set()
@ -727,9 +719,9 @@ def delete_comment(cid, v):
c.deleted_utc = int(time.time())
g.db.add(c)
g.db.commit()
cache.delete_memoized(User.commentlisting, v)
cache.delete_memoized(comment_idlist)
cache.delete_memoized(User.commentlisting, v=v)
return "", 204
@ -750,7 +742,8 @@ def undelete_comment(cid, v):
g.db.add(c)
cache.delete_memoized(User.commentlisting, v)
cache.delete_memoized(comment_idlist)
cache.delete_memoized(User.commentlisting, v=v)
return "", 204
@ -768,7 +761,7 @@ def toggle_comment_pin(cid, v):
comment.is_pinned = not comment.is_pinned
g.db.add(comment)
g.db.commit()
g.db.flush()
if v.admin_level == 6:
ma=ModAction(

View File

@ -101,7 +101,6 @@ def discord_redirect(v):
v.discord_id=x["id"]
g.db.add(v)
g.db.commit()
url=f"https://discord.com/api/guilds/{SERVER_ID}/members/{x['id']}"

View File

@ -12,7 +12,7 @@ def feeds_user(sort='hot', t='all'):
page = int(request.args.get("page", 1))
posts = frontlist(
posts, next_exists = frontlist(
sort=sort,
page=page,
t=t,

View File

@ -72,7 +72,7 @@ def notifications(v):
render_replies=True,
is_notification_page=True)
@cache.memoize(timeout=1500)
@cache.memoize()
def frontlist(v=None, sort="hot", page=1,t="all", ids_only=True, filter_words='', **kwargs):
posts = g.db.query(Submission).options(lazyload('*')).filter_by(is_banned=False,stickied=False,private=False).filter(Submission.deleted_utc == 0)
@ -174,10 +174,13 @@ def frontlist(v=None, sort="hot", page=1,t="all", ids_only=True, filter_words=''
posts = [x for x in posts if not (x.author and x.author.shadowbanned) or (v and v.id == x.author_id)][:26]
if ids_only:
posts = [x.id for x in posts]
return posts
return posts
next_exists = (len(posts) == 26)
posts = posts[:25]
if ids_only: posts = [x.id for x in posts]
return posts, next_exists
@app.get("/")
@auth_desired
@ -201,7 +204,7 @@ def front_all(v):
sort=request.args.get("sort", defaultsorting)
t=request.args.get('t', defaulttime)
ids = frontlist(sort=sort,
ids, next_exists = frontlist(sort=sort,
page=page,
t=t,
v=v,
@ -210,17 +213,12 @@ def front_all(v):
filter_words=v.filter_words if v else [],
)
# check existence of next page
next_exists = (len(ids) == 26)
ids = ids[:25]
# check if ids exist
posts = get_posts(ids, v=v)
if request.headers.get("Authorization"): return {"data": [x.json for x in posts], "next_exists": next_exists}
else: return render_template("home.html", v=v, listing=posts, next_exists=next_exists, sort=sort, t=t, page=page)
@cache.memoize(timeout=1500)
@cache.memoize()
def changeloglist(v=None, sort="new", page=1 ,t="all", **kwargs):
posts = g.db.query(Submission).options(lazyload('*')).filter_by(is_banned=False,stickied=False,private=False,).filter(Submission.deleted_utc == 0)
@ -334,7 +332,7 @@ def random_post(v):
post = x.order_by(Submission.id.asc()).offset(n).limit(1).first()
return redirect(post.permalink)
@cache.memoize(600)
@cache.memoize()
def comment_idlist(page=1, v=None, nsfw=False, sort="new", t="all", **kwargs):
posts = g.db.query(Submission).options(lazyload('*'))

View File

@ -346,7 +346,7 @@ def sign_up_post(v):
return new_signup("Please enter a valid email")
g.db.add(new_user)
g.db.commit()
g.db.flush()
# give a beta badge
beta_badge = Badge(user_id=new_user.id,
@ -570,7 +570,6 @@ def reset_2fa():
user.mfa_secret=None
g.db.add(user)
g.db.commit()
return render_template("message_success.html",
title="Two-factor authentication removed.",

View File

@ -63,8 +63,6 @@ def delete_oauth_app(v, aid):
for auth in g.db.query(ClientAuth).filter_by(oauth_client=app.id).all():
g.db.delete(auth)
g.db.commit()
g.db.delete(app)
return redirect('/apps')

View File

@ -16,7 +16,7 @@ from flask import *
from io import BytesIO
from files.__main__ import app, limiter, cache
from PIL import Image as PILimage
from .front import frontlist
from .front import frontlist, changeloglist
site = environ.get("DOMAIN").strip()
@ -201,7 +201,6 @@ def post_id(pid, anything=None, v=None):
post.views += 1
g.db.add(post)
g.db.commit()
if isinstance(session.get('over_18', 0), dict): session["over_18"] = 0
if post.over_18 and not (v and v.over_18) and not session.get('over_18', 0) >= int(time.time()):
if request.headers.get("Authorization"): return {"error":"Must be 18+ to view"}, 451
@ -483,7 +482,6 @@ def thumbs(new_post):
post.thumburl = upload_file(resize=True)
g.db.add(post)
g.db.commit()
def archiveorg(url):
try: requests.get(f'https://web.archive.org/save/{url}', headers={'User-Agent': 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'}, timeout=100)
@ -702,7 +700,6 @@ def submit_post(v):
note="spam"
)
g.db.add(ma)
g.db.commit()
return redirect("/notifications")
# catch too-long body
@ -830,17 +827,12 @@ def submit_post(v):
new_post.url = upload_file(file)
g.db.add(new_post)
g.db.add(new_post.submission_aux)
g.db.commit()
g.db.commit()
g.db.flush()
# spin off thumbnail generation and csam detection as new threads
if (new_post.url or request.files.get('file')) and (v.is_activated or request.headers.get('cf-ipcountry')!="T1"): thumbs(new_post)
cache.delete_memoized(User.userpagelisting)
g.db.commit()
notify_users = set()
soup = BeautifulSoup(body_html, features="html.parser")
@ -857,7 +849,7 @@ def submit_post(v):
send_notification(2360, user, f"@{v.username} has made a new post: [{title}](https://{site}{new_post.permalink})")
g.db.add(new_post)
g.db.commit()
g.db.flush()
if v.agendaposter and "trans lives matter" not in new_post_aux.body_html.lower():
@ -928,13 +920,15 @@ def submit_post(v):
g.db.flush()
n = Notification(comment_id=c.id, user_id=v.id)
g.db.add(n)
g.db.commit()
g.db.flush()
send_message(f"https://{site}{new_post.permalink}")
v.post_count = v.submissions.filter_by(is_banned=False, deleted_utc=0).count()
g.db.add(v)
cache.delete_memoized(User.userpagelisting, v=v)
cache.delete_memoized(frontlist)
if "[changelog]" in new_post.title: cache.delete_memoized(changeloglist)
if request.headers.get("Authorization"): return new_post.json
else: return redirect(new_post.permalink)

View File

@ -30,7 +30,6 @@ def searchparse(text):
return criteria
@cache.memoize(300)
def searchlisting(criteria, v=None, page=1, t="None", sort="top", b=None):
posts = g.db.query(Submission).options(
@ -144,7 +143,6 @@ def searchlisting(criteria, v=None, page=1, t="None", sort="top", b=None):
return total, [x.id for x in posts]
@cache.memoize(300)
def searchcommentlisting(criteria, v=None, page=1, t="None", sort="top"):
comments = g.db.query(Comment).options(lazyload('*')).filter(Comment.parent_submission != None).join(Comment.comment_aux)

View File

@ -160,7 +160,7 @@ def changelogsub(v):
v.changelogsub = not v.changelogsub
g.db.add(v)
cache.delete_memoized(frontlist)
cache.delete_memoized(frontlist, v=v)
return "", 204
@ -467,11 +467,9 @@ def settings_block_user(v):
existing = g.db.query(Notification).filter_by(blocksender=v.id, user_id=user.id).first()
if not existing: send_block_notif(v.id, user.id, f"@{v.username} has blocked you!")
if request.args.get("notoast"): return "", 204
if v.admin_level == 1: return {"message": f"@{user.username} banned!"}
cache.delete_memoized(frontlist)
cache.delete_memoized(frontlist, v=v)
return {"message": f"@{user.username} blocked."}
@ -494,11 +492,9 @@ def settings_unblock_user(v):
existing = g.db.query(Notification).filter_by(unblocksender=v.id, user_id=user.id).first()
if not existing: send_unblock_notif(v.id, user.id, f"@{v.username} has unblocked you!")
if request.args.get("notoast"): return "", 204
if v.admin_level == 1: return {"message": f"@{user.username} unbanned!"}
cache.delete_memoized(frontlist)
cache.delete_memoized(frontlist, v=v)
return {"message": f"@{user.username} unblocked."}
@ -523,7 +519,6 @@ def settings_remove_discord(v):
v.discord_id=None
g.db.add(v)
g.db.commit()
return redirect("/settings/profile")
@ -578,7 +573,6 @@ def settings_name_change(v):
set_nick(v, new_name)
g.db.add(v)
g.db.commit()
return redirect("/settings/profile")
@ -610,7 +604,6 @@ def settings_song_change(v):
if path.isfile(f'/songs/{id}.mp3'):
v.song=id
g.db.add(v)
g.db.commit()
return redirect("/settings/profile")
@ -691,8 +684,6 @@ def settings_title_change(v):
v.customtitle = new_name
g.db.add(v)
g.db.commit()
return redirect("/settings/profile")
@app.post("/settings/badges")

View File

@ -62,8 +62,6 @@ def transfer_coins(v, username):
g.db.add(receiver)
g.db.add(v)
g.db.commit()
transfer_message = f"🤑 [@{v.username}]({v.url}) has gifted you {amount} {app.config['COINS_NAME']}!"
send_notification(v.id, receiver, transfer_message)
return {"message": f"{amount} {app.config['COINS_NAME']} transferred!"}, 200
@ -132,7 +130,6 @@ def messagereply(v, username, id):
g.db.add(new_aux)
notif = Notification(comment_id=new_comment.id, user_id=user.id)
g.db.add(notif)
g.db.commit()
return redirect('/notifications?all=true')
@app.get("/songs/<id>")
@ -147,7 +144,6 @@ def songs(id):
def subscribe(v, post_id):
new_sub = Subscription(user_id=v.id, submission_id=post_id)
g.db.add(new_sub)
g.db.commit()
return "", 204
@app.post("/unsubscribe/<post_id>")

View File

@ -66,7 +66,7 @@
{% block content %}
{% if v %}
<a class="btn btn-primary followbutton " href="javascript:void(0)" onclick="post('/changelogsub', function(){window.location.reload(true);})">{{"Unubscribe" if v.changelogsub else "Subscribe"}}</a>
<a class="btn btn-primary followbutton " href="javascript:void(0)" onclick="post_toast('/changelogsub')">{{"Unubscribe" if v.changelogsub else "Subscribe"}}</a>
{% endif %}
<div class="row no-gutters {% if listing %}mt-md-3{% elif not listing %}my-md-3{% endif %}">

View File

@ -244,9 +244,9 @@
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="/votes?link={{c.fullname}}"><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.id}}', 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_toast('/unsave_comment/{{c.id}}')"><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.id}}', 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_toast('/save_comment/{{c.id}}')"><i class="fas fa-save"></i>Save</a></li>
{% endif %}
{% if v %}
@ -274,7 +274,7 @@
<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.id}}', 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_toast('/undelete/comment/{{c.id}}')"><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.id}}')"><i class="fas fa-trash-alt fa-fw"></i>Delete</a></li>
{% endif %}
@ -291,7 +291,7 @@
{% endif %}
{% if v and c.post and (v.admin_level >= 1 or v.id == c.post.author_id) and c.level == 1 %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a class="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 fa-fw"></i>{{'Unpin' if c.is_pinned else 'Pin'}}</a></li>
<li class="list-inline-item text-muted d-none d-md-inline-block"><a class="text-info" id="pin-comment-{{c.id}}" href="javascript:void(0)" data-dismiss="modal" data-target="#actionsModal-{{c.id}}" onclick="post_toast('/comment_pin/{{c.id}}')"><i class="fas fa-thumbtack fa-rotate--45 text-info fa-fw"></i>{{'Unpin' if c.is_pinned else 'Pin'}}</a></li>
</li>
{% endif %}
@ -302,14 +302,14 @@
{% endif %}
{% if v and c.parent_submission and (c.author_id==v.id or v.admin_level > 0) %}
<li class="list-inline-item d-none d-md-inline-block"><a class="text-danger" href="javascript:void(0)" onclick="post('/toggle_comment_nsfw/{{c.id}}', function(){window.location.reload(true);})"><i class="fas fa-eye-evil text-danger fa-fw"></i>Toggle +18</a></li>
<li class="list-inline-item d-none d-md-inline-block"><a class="text-danger" href="javascript:void(0)" onclick="post_toast('/toggle_comment_nsfw/{{c.id}}')"><i class="fas fa-eye-evil text-danger fa-fw"></i>Toggle +18</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 d-none d-md-inline-block"><a class="text-success" id="unexile-comment-{{c.id}}" href="javascript:void(0)" onclick="post_toast('/unban_user/{{c.author_id}}?toast=1')"><i class="fas fa-user-slash text-success fa-fw"></i>Unban user</a></li>
{% else %}
<li class="list-inline-item d-none d-md-inline-block"><a class="text-danger" id="exile-comment-{{c.id}}" href="javascript:void(0)" onclick="post_toast('/ban_user/{{c.author_id}}?toast=1')"><i class="fas fa-user-slash text-danger fa-fw"></i>Ban user</a></li>
<li class="list-inline-item d-none d-md-inline-block"><a class="text-danger" id="exile-comment-{{c.id}}" href="javascript:void(0)" onclick="post_toast('/ban_user/{{c.author_id}}/?reason={{c.permalink}}')"><i class="fas fa-user-slash text-danger fa-fw"></i>Ban user</a></li>
{% endif %}
{% endif %}
@ -411,9 +411,9 @@
<li class="list-group-item"><a href="/votes?link={{c.fullname}}"><i class="fas fa-arrows-v"></i>Votes</a></li>
{% 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.id}}', 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_toast('/unsave_comment/{{c.id}}')"><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.id}}', 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_toast('/save_comment/{{c.id}}')"><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>
@ -427,7 +427,7 @@
{% if c.deleted_utc > 0 %}
<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>
<li class="list-group-item"><a class="d-block" href="javascript:void(0)" onclick="post_toast('/undelete/comment/{{c.id}}')"><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.id}}')"><i class="fas fa-trash-alt"></i>Delete</a></li>
{% endif %}
@ -436,7 +436,7 @@
{% endif %}
{% if v and c.post and (v.admin_level >= 1 or v.id == c.post.author_id) and c.level == 1 %}
<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 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_toast('/comment_pin/{{c.id}}')"><i class="fas fa-thumbtack fa-rotate--45 text-info"></i>{{'Unpin' if c.is_pinned else 'Pin'}}</a>
</li>
{% endif %}
@ -460,7 +460,7 @@
{% 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="text-danger d-block" href="javascript:void(0)" onclick="post('/toggle_comment_nsfw/{{c.id}}', 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="text-danger d-block" href="javascript:void(0)" onclick="post_toast('/toggle_comment_nsfw/{{c.id}}')"><i class="fas fa-eye-evil text-danger"></i>Toggle +18</a></li>
{% endif %}
{% if v and (c.post and v.admin_level == 6) %}
@ -468,7 +468,7 @@
{% if c.author.is_banned %}
<li class="list-group-item"><a class="text-success d-block" id="unexile-comment2-{{c.id}}" href="javascript:void(0)" onclick="post_toast('/unban_user/{{c.author_id}}?toast=1')"><i class="fas fa-user-minus fa-fw text-success"></i>Unban user</a></li>
{% else %}
<li class="list-group-item"><a class="text-danger d-block" id="exile-comment2-{{c.id}}" href="javascript:void(0)" onclick="post_toast('/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="text-danger d-block" id="exile-comment2-{{c.id}}" href="javascript:void(0)" onclick="post_toast('/ban_user/{{c.author_id}}/?reason={{c.permalink}}')"><i class="fas fa-user-minus fa-fw text-danger"></i>Ban user</a></li>
{% endif %}
{% endif %}
{% endif %}

View File

@ -107,7 +107,7 @@
</div>
<hr class="my-2">
<div class="px-2">
<a class="dropdown-item" href="javascript:void(0)", onclick="post('/logout', callback=function(){window.location.reload(true)})"><i class="fas fa-sign-out fa-fw text-left mr-3"></i>Log out</a>
<a class="dropdown-item" href="javascript:void(0)", onclick="post_toast('/logout')"><i class="fas fa-sign-out fa-fw text-left mr-3"></i>Log out</a>
</div>
</div>
</div>

View File

@ -68,7 +68,7 @@
<i class="fas fa-ellipsis-h text-muted"></i>
</a>
<div class="dropdown-menu border-0 shadow dropdown-menu-right mt-2" aria-labelledby="dropdownMoreLink" x-placement="bottom-end" style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(21px, 18px, 0px);">
<a class="dropdown-item" href="javascript:void(0)" onclick="post('/settings/unblock?username={{block.target.username}}&formkey={{v.formkey}}', callback=function(){window.location.reload(true)})"><i class="fas fa-check"></i>Unblock</a>
<a class="dropdown-item" href="javascript:void(0)" onclick="post_toast('/settings/unblock?username={{block.target.username}}&formkey={{v.formkey}}')"><i class="fas fa-check"></i>Unblock</a>
</div>
</div>
</td>

View File

@ -24,7 +24,7 @@
<div class="body w-lg-100">
<p>Change the theme for the website.</p>
<div class="input-group mb2">
<select id='theme' class="form-control" form="profile-settings" name="theme" onchange="post('/settings/profile?theme='+document.getElementById('theme').value, function(){window.location.reload(true);})">
<select id='theme' class="form-control" form="profile-settings" name="theme" onchange="post('/settings/profile?theme='+document.getElementById('theme').value)">
{% for entry in ["dark", "light", "coffee", "tron", "4chan", "midnight"] %}
<option value="{{entry}}" {% if v.theme==entry %} selected {% endif %}>
{{entry}}

View File

@ -108,7 +108,7 @@
<input class="form-control" id="new_email" {% if v.email %}placeholder="{{v.email}}"{% else %}placeholder="Your email"{% endif %}
aria-describedby="new_email" type="email" name="new_email" required>
{% if v.email and not v.is_activated %}
<div class="text-danger text-small-extra mt-1" id="email-verify-text">Email not verified. You will not be able to recover your account with this email until you verify it. <u><a href="javascript:void(0)" onclick="post('/verify_email');emailVerifyText();" class="text-danger">Verify now.</a></u></div>
<div class="text-danger text-small-extra mt-1" id="email-verify-text">Email not verified. You will not be able to recover your account with this email until you verify it. <u><a href="javascript:void(0)" onclick="post_toast('/verify_email');emailVerifyText();" class="text-danger">Verify now.</a></u></div>
{% elif not v.email %}
<div class="text-danger text-small-extra mt-1" id="email-verify-text">Add an email to secure your account in case you forget your password.</div>
{% endif %}

View File

@ -98,15 +98,15 @@
<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>
{% 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('/publish/{{p.id}}', 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_toast('/publish/{{p.id}}')"><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.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-muted text-left" id="pin-post-{{p.id}}" href="javascript:void(0)" onclick="post('/pin/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-thumbtack text-center 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-muted text-left" id="pin-post-{{p.id}}" href="javascript:void(0)" onclick="post_toast('/pin/{{p.id}}')"><i class="fas fa-thumbtack text-center 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.id}}', 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_toast('/undelete_post/{{p.id}}')"><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.id}}')"><i class="far fa-trash-alt text-center text-muted mr-3"></i>Delete</button>
{% endif %}
@ -119,26 +119,26 @@
{% endif %}
{% if v and p.id in v.subscribed_idlist() %}
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post('/unsubscribe/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-eye-slash text-center text-muted mr-3"></i>Unsubscribe</a></button>
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post_toast('/unsubscribe/{{p.id}}')"><i class="fas fa-eye-slash text-center text-muted mr-3"></i>Unsubscribe</a></button>
{% elif v %}
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post('/subscribe/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-eye text-center text-muted mr-3"></i>Subscribe</a></button>
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post_toast('/subscribe/{{p.id}}')"><i class="fas fa-eye text-center text-muted mr-3"></i>Subscribe</a></button>
{% 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.id}}', 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_toast('/unsave_post/{{p.id}}')"><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.id}}', 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_toast('/save_post/{{p.id}}')"><i class="fas fa-save text-center text-muted mr-3"></i>Save</a></button>
{% endif %}
{% if v %}
{% if v.admin_level >=3 %}
<button class="btn btn-link btn-block btn-lg text-left" id="sticky-post-{{p.id}}" href="javascript:void(0)" onclick="post('/sticky/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-thumbtack text-center mr-3"></i>{% if p.stickied %}Unpin{% else %}Pin{% endif %}</button>
<button class="btn btn-link btn-block btn-lg text-left" id="sticky-post-{{p.id}}" href="javascript:void(0)" onclick="post_toast('/sticky/{{p.id}}')"><i class="fas fa-thumbtack text-center 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" id="distinguish-post-{{p.id}}" href="javascript:void(0)" onclick="post('/distinguish/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-crown text-center mr-3"></i>Distinguish</button>
<button class="btn btn-link btn-block btn-lg text-left" id="distinguish-post-{{p.id}}" href="javascript:void(0)" onclick="post_toast('/distinguish/{{p.id}}')"><i class="fas fa-crown text-center mr-3"></i>Distinguish</button>
{% endif %}
<button class="btn btn-link btn-block btn-lg text-success text-left" id="moderate-post-{{p.id}}" href="javascript:void(0)" onclick="post('/unban_post/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="far fa-check text-center 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('/ban_post/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="far fa-ban text-center 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_toast('/unban_post/{{p.id}}')"><i class="far fa-check text-center 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_toast('/ban_post/{{p.id}}')"><i class="far fa-ban text-center mr-3"></i>Remove</button>
{% endif %}
{% if v.admin_level >=4 and p.oauth_app %}
@ -155,14 +155,14 @@
{% 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-danger" onclick="post('/toggle_post_nsfw/{{p.id}}', function(){window.location.reload(true);})"><i class="far fa-eye-evil text-center text-danger mr-3"></i>Toggle +18</button>
<button class="btn btn-link btn-block btn-lg text-left text-danger" onclick="post_toast('/toggle_post_nsfw/{{p.id}}')"><i class="far fa-eye-evil text-center text-danger mr-3"></i>Toggle +18</button>
{% endif %}
{% if v and v.admin_level == 6 and v.id!=p.author_id %}
{% if p.author.is_banned %}
<button class="btn btn-link btn-block btn-lg text-success text-left" href="javascript:void(0)" onclick="post_toast('/unban_user/{{p.author_id}}?toast=1')"><i class="fas fa-user-minus mr-3"></i>Unban user</a></button>
{% else %}
<button class="btn btn-link btn-block btn-lg text-danger text-left" href="javascript:void(0)" onclick="post_toast('/ban_user/{{p.author_id}}?toast=1')"><i class="fas fa-user-minus mr-3"></i>Ban user</a></button>
<button class="btn btn-link btn-block btn-lg text-danger text-left" href="javascript:void(0)" onclick="post_toast('/ban_user/{{p.author_id}}/?reason={{p.permalink}}')"><i class="fas fa-user-minus mr-3"></i>Ban user</a></button>
{% endif %}
{% endif %}
@ -300,7 +300,7 @@
{% if v and v.id==p.author_id %}
{% if p.private %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/publish/{{p.id}}', 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_toast('/publish/{{p.id}}')"><i class="fas fa-globe"></i>Publish</a></li>
{% endif %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="togglePostEdit('{{p.id}}')"><i class="fas fa-edit"></i>Edit</a></li>
{% endif %}
@ -315,44 +315,44 @@
{% if v and not (v.admin_level == 6 and v.id == p.author_id) %}
{% if p.id in v.subscribed_idlist() %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/unsubscribe/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-eye-slash"></i>Unsubscribe</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post_toast('/unsubscribe/{{p.id}}')"><i class="fas fa-eye-slash"></i>Unsubscribe</a></li>
{% else %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/subscribe/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-eye"></i>Subscribe</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post_toast('/subscribe/{{p.id}}')"><i class="fas fa-eye"></i>Subscribe</a></li>
{% endif %}
{% 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.id}}', 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_toast('/unsave_post/{{p.id}}')"><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.id}}', 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_toast('/save_post/{{p.id}}')"><i class="fas fa-save"></i>Save</a></li>
{% endif %}
<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>
{% if v and v.id==p.author_id %}
<li class="list-inline-item"><a class="text-muted" href="javascript:void(0)" onclick="post('/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>
<li class="list-inline-item"><a class="text-muted" href="javascript:void(0)" onclick="post_toast('/pin/{{p.id}}')"><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.id}}', 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_toast('/undelete_post/{{p.id}}')"><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.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 class="text-info" href="javascript:void(0)" onclick="post('/sticky/{{p.id}}', 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 class="text-info" href="javascript:void(0)" onclick="post_toast('/sticky/{{p.id}}')"><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 class="text-info" href="javascript:void(0)" onclick="post('/distinguish/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-crown"></i>Distinguish</a></li>
<li class="list-inline-item"><a class="text-info" href="javascript:void(0)" onclick="post_toast('/distinguish/{{p.id}}')"><i class="fas fa-crown"></i>Distinguish</a></li>
{% endif %}
{% endif %}
{% if v %}
{% if v.admin_level >=3 %}
<li class="list-inline-item"><a class="text-success" href="javascript:void(0)" onclick="post('/unban_post/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-check"></i>Approve</a></li>
<li class="list-inline-item"><a class="text-danger" href="javascript:void(0)" onclick="post('/ban_post/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-ban"></i>Remove</a></li>
<li class="list-inline-item"><a class="text-success" href="javascript:void(0)" onclick="post_toast('/unban_post/{{p.id}}')"><i class="fas fa-check"></i>Approve</a></li>
<li class="list-inline-item"><a class="text-danger" href="javascript:void(0)" onclick="post_toast('/ban_post/{{p.id}}')"><i class="fas fa-ban"></i>Remove</a></li>
{% endif %}
{% if v.id == p.author_id or v.admin_level >= 3 %}
<li class="list-inline-item"><a class="text-danger" href="javascript:void(0)" onclick="post('/toggle_post_nsfw/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-eye-evil"></i>Toggle +18</a></li>
<li class="list-inline-item"><a class="text-danger" href="javascript:void(0)" onclick="post_toast('/toggle_post_nsfw/{{p.id}}')"><i class="fas fa-eye-evil"></i>Toggle +18</a></li>
{% endif %}
{% if v.admin_level >= 4 and p.oauth_app %}
@ -378,7 +378,7 @@
<li class="list-inline-item"><a class="text-success" href="javascript:void(0)" onclick="post_toast('/unban_user/{{p.author_id}}')"
><i class="fas fa-user-slash text-success"></i>Unban user</a></li>
{% else %}
<li class="list-inline-item "><a class="text-danger" href="javascript:void(0)" onclick="post_toast('/ban_user/{{p.author_id}}')"
<li class="list-inline-item "><a class="text-danger" href="javascript:void(0)" onclick="post_toast('/ban_user/{{p.author_id}}/?reason={{p.permalink}}')"
><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
{% endif %}
{% endif %}

View File

@ -139,24 +139,24 @@
{% if v and not (v.admin_level == 6 and v.id == p.author_id) %}
{% if p.id in v.subscribed_idlist() %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/unsubscribe/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-eye-slash"></i>Unsubscribe</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post_toast('/unsubscribe/{{p.id}}')"><i class="fas fa-eye-slash"></i>Unsubscribe</a></li>
{% else %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/subscribe/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-eye"></i>Subscribe</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post_toast('/subscribe/{{p.id}}')"><i class="fas fa-eye"></i>Subscribe</a></li>
{% endif %}
{% 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.id}}', 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_toast('/unsave_post/{{p.id}}')"><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.id}}', 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_toast('/save_post/{{p.id}}')"><i class="fas fa-save"></i>Save</a></li>
{% endif %}
<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>
{% if v and v.id==p.author_id %}
<li class="list-inline-item"><a class="text-muted" href="javascript:void(0)" onclick="post('/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>
<li class="list-inline-item"><a class="text-muted" href="javascript:void(0)" onclick="post_toast('/pin/{{p.id}}')"><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.id}}', 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_toast('/undelete_post/{{p.id}}')"><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.id}}')"><i class="fas fa-trash-alt"></i>Delete</a></li>
{% endif %}
@ -164,17 +164,17 @@
{% if v and v.admin_level>=3 %}
<li class="list-inline-item"><a class="text-info" href="javascript:void(0)" onclick="post('/sticky/{{p.id}}', 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 class="text-info" href="javascript:void(0)" onclick="post_toast('/sticky/{{p.id}}')"><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 class="text-info" href="javascript:void(0)" onclick="post('/distinguish/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-crown"></i>Distinguish</a></li>
<li class="list-inline-item"><a class="text-info" href="javascript:void(0)" onclick="post_toast('/distinguish/{{p.id}}')"><i class="fas fa-crown"></i>Distinguish</a></li>
{% endif %}
{% endif %}
{% if v %}
{% if v.admin_level >=3 %}
<li class="list-inline-item"><a class="text-success" id="moderate-post-{{p.id}}" href="javascript:void(0)" onclick="post('/unban_post/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-check"></i>Approve</a></li>
<li class="list-inline-item"><a class="text-danger" id="moderate-post-{{p.id}}" href="javascript:void(0)" onclick="post('/ban_post/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-ban"></i>Remove</a></li>
<li class="list-inline-item"><a class="text-success" id="moderate-post-{{p.id}}" href="javascript:void(0)" onclick="post_toast('/unban_post/{{p.id}}')"><i class="fas fa-check"></i>Approve</a></li>
<li class="list-inline-item"><a class="text-danger" id="moderate-post-{{p.id}}" href="javascript:void(0)" onclick="post_toast('/ban_post/{{p.id}}')"><i class="fas fa-ban"></i>Remove</a></li>
{% endif %}
@ -183,13 +183,13 @@
{% endif %}
{% if not v.id==p.author_id and v.admin_level == 0 %}
<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>
<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}}')"><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}}')"><i class="fas fa-eye"></i>Unblock user</a></li>
{% endif %}
{% if v and (v.id==p.author_id or v.admin_level>=3) %}
<li class="list-inline-item"><a class="text-danger" href="javascript:void(0)" onclick="post('/toggle_post_nsfw/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-eye-evil"></i>Toggle +18</a></li>
<li class="list-inline-item"><a class="text-danger" href="javascript:void(0)" onclick="post_toast('/toggle_post_nsfw/{{p.id}}')"><i class="fas fa-eye-evil"></i>Toggle +18</a></li>
{% endif %}
@ -198,7 +198,7 @@
<li class="list-inline-item"><a class="text-danger" id="unexile2-user-{{p.id}}" href="javascript:void(0)" onclick="post_toast('/unban_user/{{p.author_id}}')"
><i class="fas fa-user-slash"></i>Unban user</a></li>
{% else %}
<li class="list-inline-item"><a class="text-danger" id="exile2-user-{{p.id}}" href="javascript:void(0)" onclick="post_toast('/ban_user/{{p.author_id}}')"
<li class="list-inline-item"><a class="text-danger" id="exile2-user-{{p.id}}" href="javascript:void(0)" onclick="post_toast('/ban_user/{{p.author_id}}/?reason={{p.permalink}}')"
><i class="fas fa-user-slash"></i>Ban user</a></li>
{% endif %}
{% endif %}
@ -298,23 +298,23 @@
{% endif %}
{% if v and p.id in v.subscribed_idlist() %}
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post('/unsubscribe/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-eye-slash text-center text-muted mr-3"></i>Unsubscribe</a></button>
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post_toast('/unsubscribe/{{p.id}}')"><i class="fas fa-eye-slash text-center text-muted mr-3"></i>Unsubscribe</a></button>
{% elif v %}
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post('/subscribe/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-eye text-center text-muted mr-3"></i>Subscribe</a></button>
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post_toast('/subscribe/{{p.id}}')"><i class="fas fa-eye text-center text-muted mr-3"></i>Subscribe</a></button>
{% 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.id}}', 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_toast('/unsave_post/{{p.id}}')"><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.id}}', 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_toast('/save_post/{{p.id}}')"><i class="fas fa-save text-center text-muted mr-3"></i>Save</a></button>
{% endif %}
<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>
{% if v and v.id==p.author_id %}
<button class="btn btn-link btn-block btn-lg text-muted text-left" id="pin-post-{{p.id}}" href="javascript:void(0)" onclick="post('/pin/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-thumbtack text-center 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-muted text-left" id="pin-post-{{p.id}}" href="javascript:void(0)" onclick="post_toast('/pin/{{p.id}}')"><i class="fas fa-thumbtack text-center 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.id}}', 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_toast('/undelete_post/{{p.id}}')"><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.id}}')"><i class="far fa-trash-alt text-center text-muted mr-3"></i>Delete</button>
{% endif %}
@ -322,26 +322,26 @@
{% if v %}
{% if v.admin_level >=3 %}
<button class="btn btn-link btn-block btn-lg text-left" id="sticky-post-{{p.id}}" href="javascript:void(0)" onclick="post('/sticky/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-thumbtack text-center mr-3"></i>{% if p.stickied %}Unpin{% else %}Pin{% endif %}</button>
<button class="btn btn-link btn-block btn-lg text-left" id="sticky-post-{{p.id}}" href="javascript:void(0)" onclick="post_toast('/sticky/{{p.id}}')"><i class="fas fa-thumbtack text-center 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" id="distinguish-post-{{p.id}}" href="javascript:void(0)" onclick="post('/distinguish/{{p.id}}',callback=function(){window.location.reload(true);})"><i class="fas fa-crown text-center mr-3"></i>Distinguish</button>
<button class="btn btn-link btn-block btn-lg text-left" id="distinguish-post-{{p.id}}" href="javascript:void(0)" onclick="post_toast('/distinguish/{{p.id}}')"><i class="fas fa-crown text-center mr-3"></i>Distinguish</button>
{% endif %}
<button class="btn btn-link btn-block btn-lg text-success text-left" id="moderate-post-{{p.id}}" href="javascript:void(0)" onclick="post('/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('/ban_post/{{p.id}}',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_toast('/unban_post/{{p.id}}')"><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_toast('/ban_post/{{p.id}}')"><i class="far fa-ban text-center text-danger mr-3"></i>Remove</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-danger" onclick="post('/toggle_post_nsfw/{{p.id}}', function(){window.location.reload(true);})"><i class="far fa-eye-evil text-center mr-3"></i>Toggle +18</button>
<button class="btn btn-link btn-block btn-lg text-left text-danger" onclick="post_toast('/toggle_post_nsfw/{{p.id}}')"><i class="far fa-eye-evil text-center mr-3"></i>Toggle +18</button>
{% endif %}
{% if v.admin_level >=3 and v.id!=p.author_id %}
{% if p.author.is_banned %}
<button class="btn btn-link btn-block btn-lg text-left text-danger" href="javascript:void(0)" onclick="post_toast('/unban_user/{{p.author_id}}')"><i class="fas fa-user-minus mr-3"></i>Unban user</a></button>
{% else %}
<button class="btn btn-link btn-block btn-lg text-left text-danger" href="javascript:void(0)" onclick="post_toast('/ban_user/{{p.author_id}}')"><i class="fas fa-user-minus mr-3"></i>Ban user</a></button>
<button class="btn btn-link btn-block btn-lg text-left text-danger" href="javascript:void(0)" onclick="post_toast('/ban_user/{{p.author_id}}/?reason={{p.permalink}}')"><i class="fas fa-user-minus mr-3"></i>Ban user</a></button>
{% endif %}
{% endif %}
@ -352,9 +352,9 @@
{% endif %}
{% if v and not v.id==p.author_id and v.admin_level == 0 %}
<button id="block-user-button-{{p.id}}" class="btn btn-link btn-block btn-lg text-left text-muted{% 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-muted{% if p.is_blocking %} d-none{% endif %}" data-dismiss="modal" onclick="post_toast('/settings/block?username={{p.author.username}}')"
><i class="fas fa-eye-slash mr-3"></i>Block user</button>
<button id="unblock-user-button-{{p.id}}" class="btn btn-link btn-block btn-lg text-left text-muted{% 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-muted{% if not p.is_blocking %} d-none{% endif %}" data-dismiss="modal" onclick="post_toast('/settings/unblock?username={{p.author.username}}')"
><i class="fas fa-eye mr-3"></i>Unblock user</button>
{% endif %}
</ul>

View File

@ -13,8 +13,8 @@
{% if v %}
{% if v.id!=u.id and not u.is_private and not u.is_nofollow %}
<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('/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('/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>
<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_toast('/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_toast('/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.id}}" style="z-index: 2" "><a class="btn btn-primary btn-sm" href="/signup?redirect={{request.path}}">Follow</a></div>

View File

@ -169,12 +169,12 @@
<div class="d-flex justify-content-between align-items-center">
<div>
{% if v and v.id != u.id %}
<a id="button-unsub" class="btn btn-secondary {% if not is_following %}d-none{% endif %}" href="javascript:void(0)" onclick="post('/unfollow/{{u.username}}', callback=function(){document.getElementById('button-unsub').classList.toggle('d-none');document.getElementById('button-sub').classList.toggle('d-none');})">Unfollow</a>
<a id="button-sub" class="btn btn-primary {% if is_following or u.is_nofollow or u.is_blocked %}d-none{% endif %}" href="javascript:void(0)" onclick="post('/follow/{{u.username}}', callback=function(){document.getElementById('button-sub').classList.toggle('d-none');document.getElementById('button-unsub').classList.toggle('d-none');})">Follow</a>
<a id="button-unsub" class="btn btn-secondary {% if not is_following %}d-none{% endif %}" href="javascript:void(0)" onclick="post_toast('/unfollow/{{u.username}}', callback=function(){document.getElementById('button-unsub').classList.toggle('d-none');document.getElementById('button-sub').classList.toggle('d-none');})">Unfollow</a>
<a id="button-sub" class="btn btn-primary {% if is_following or u.is_nofollow or u.is_blocked %}d-none{% endif %}" href="javascript:void(0)" onclick="post_toast('/follow/{{u.username}}', callback=function(){document.getElementById('button-sub').classList.toggle('d-none');document.getElementById('button-unsub').classList.toggle('d-none');})">Follow</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="toggleElement('profile-toggleable', 'message')">Message</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="post('/@{{u.username}}/suicide', function(){window.location.reload(true);})">Get them help</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/suicide')">Get them help</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="toggleElement('profile-toggleable', 'coin-transfer')">Gift {{"COINS_NAME" | app_config}}</a>
<form class="d-none profile-toggleable" id="message" action="/@{{u.username}}/message" method="post">
<pre></pre>
@ -226,7 +226,7 @@
</div>
<pre></pre>
{% if u.is_banned %}
<form action="/unban_user/{{u.id}}/?notoast=1" method="post" action="">
<form action="/unban_user/{{u.id}}/" method="post" action="">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<div class="custom-control custom-checkbox">
<input type="checkbox" id="alts-1-desktop" class="custom-control-input" name="alts" value="1">
@ -235,7 +235,7 @@
<input type="submit" class="btn btn-success" value="Unban user">
</form>
{% else %}
<form action="/ban_user/{{u.id}}?notoast=1" method="post" action="">
<form action="/ban_user/{{u.id}}" method="post" action="">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<input style="font-size:11px;" type="text" class="form-control" name="reason" placeholder="Ban Reason" onchange="document.getElementById('user-ban-submit').disabled=false">
<input style="font-size:11px;" type="number" class="form-control" name="days" placeholder="Days (blank = permanent)">
@ -250,7 +250,7 @@
<pre></pre>
{% if u.agendaposter %}
<a class="btn btn-success" href="javascript:void(0)" onclick="post('/agendaposter/{{u.id}}?toast', function(){window.location.reload(true);})">Disable Agendaposter Theme</a>
<a class="btn btn-success" href="javascript:void(0)" onclick="post_toast('/agendaposter/{{u.id}}?toast')">Disable Agendaposter Theme</a>
{% else %}
<form action="/agendaposter/{{u.id}}" method="post">
<input type="hidden" name="formkey", value="{{v.formkey}}">
@ -262,9 +262,9 @@
<pre></pre>
{% if u.shadowbanned %}
<a class="btn btn-success" href="javascript:void(0)" onclick="post('/unshadowban/{{u.id}}', function(){window.location.reload(true);})">Unshadowban</a>
<a class="btn btn-success" href="javascript:void(0)" onclick="post_toast('/unshadowban/{{u.id}}')">Unshadowban</a>
{% else %}
<a class="btn btn-danger" href="javascript:void(0)" onclick="post('/shadowban/{{u.id}}', function(){window.location.reload(true);})">Shadowban</a>
<a class="btn btn-danger" href="javascript:void(0)" onclick="post_toast('/shadowban/{{u.id}}')">Shadowban</a>
{% endif %}
<pre></pre>
@ -377,11 +377,11 @@
<a href="/views" class="btn btn-secondary btn-sm">Profile views</a>
{% endif %}
{% if v and v.id != u.id %}
<a id="button-unsub2" class="btn btn-secondary {% if not is_following %}d-none{% endif %}" href="javascript:void(0)" onclick="post('/unfollow/{{u.username}}', callback=function(){document.getElementById('button-unsub2').classList.toggle('d-none');document.getElementById('button-sub2').classList.toggle('d-none');})">Unfollow</a>
<a id="button-sub2" class="btn btn-primary {% if is_following or u.is_nofollow or u.is_blocked %}d-none{% endif %}" href="javascript:void(0)" onclick="post('/follow/{{u.username}}', callback=function(){document.getElementById('button-sub2').classList.toggle('d-none');document.getElementById('button-unsub2').classList.toggle('d-none');})">Follow</a>
<a id="button-unsub2" class="btn btn-secondary {% if not is_following %}d-none{% endif %}" href="javascript:void(0)" onclick="post_toast('/unfollow/{{u.username}}', callback=function(){document.getElementById('button-unsub2').classList.toggle('d-none');document.getElementById('button-sub2').classList.toggle('d-none');})">Unfollow</a>
<a id="button-sub2" class="btn btn-primary {% if is_following or u.is_nofollow or u.is_blocked %}d-none{% endif %}" href="javascript:void(0)" onclick="post_toast('/follow/{{u.username}}', callback=function(){document.getElementById('button-sub2').classList.toggle('d-none');document.getElementById('button-unsub2').classList.toggle('d-none');})">Follow</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="toggleElement('profile-toggleable-mobile', 'message-mobile')">Message</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="post('/@{{u.username}}/suicide', function(){window.location.reload(true);})">Get them help</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/suicide')">Get them help</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="toggleElement('profile-toggleable-mobile', 'coin-transfer-mobile')">Gift {{"COINS_NAME" | app_config}}</a>
<form class="d-none profile-toggleable-mobile" id='message-mobile' action="/@{{u.username}}/message" method="post">
@ -431,7 +431,7 @@
</div>
<pre></pre>
{% if u.is_banned %}
<form action="/unban_user/{{u.id}}/?notoast=1" method="post">
<form action="/unban_user/{{u.id}}" method="post">
<input type="hidden" name="formkey", value="{{v.formkey}}">
<br />
<div class="custom-control custom-checkbox">
@ -442,7 +442,7 @@
<input type="submit" class="btn btn-success" value="Unban user">
</form>
{% else %}
<form action="/ban_user/{{u.id}}/?notoast=1" method="post">
<form action="/ban_user/{{u.id}}/" method="post">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<input style="font-size:11px;" type="text" class="form-control" name="reason" placeholder="Ban Reason" onchange="document.getElementById('user-ban-submit2').disabled=false">
<input style="font-size:11px;" type="number" class="form-control" name="days" placeholder="Days (blank = permanent)">
@ -459,7 +459,7 @@
<pre></pre>
{% if u.agendaposter %}
<a class="btn btn-success" href="javascript:void(0)" onclick="post('/agendaposter/{{u.id}}?toast', function(){window.location.reload(true);})">Disable Agendaposter Theme</a>
<a class="btn btn-success" href="javascript:void(0)" onclick="post_toast('/agendaposter/{{u.id}}?toast')">Disable Agendaposter Theme</a>
{% else %}
<form action="/agendaposter/{{u.id}}" method="post">
<input type="hidden" name="formkey", value="{{v.formkey}}">
@ -471,9 +471,9 @@
<pre></pre>
{% if u.shadowbanned %}
<a class="btn btn-success" href="javascript:void(0)" onclick="post('/unshadowban/{{u.id}}', function(){window.location.reload(true);})">Unshadowban</a>
<a class="btn btn-success" href="javascript:void(0)" onclick="post_toast('/unshadowban/{{u.id}}')">Unshadowban</a>
{% else %}
<a class="btn btn-danger" href="javascript:void(0)" onclick="post('/shadowban/{{u.id}}', function(){window.location.reload(true);})">Shadowban</a>
<a class="btn btn-danger" href="javascript:void(0)" onclick="post_toast('/shadowban/{{u.id}}')">Shadowban</a>
{% endif %}
<pre></pre>