master
Aevann1 2021-12-19 15:01:28 +02:00
parent 01f5c56b7b
commit 68bc992da1
111 changed files with 682 additions and 339 deletions

View File

@ -16,9 +16,7 @@ import gevent
from werkzeug.middleware.proxy_fix import ProxyFix
import redis
if int(environ.get("CHRISTMAS", 0)): templates = 'templates/CHRISTMAS'
else: templates = 'templates'
app = Flask(__name__, template_folder=templates)
app = Flask(__name__, template_folder='templates')
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=3)
app.url_map.strict_slashes = False

View File

@ -42,6 +42,7 @@ class User(Base):
theme = Column(String, default=defaulttheme)
themecolor = Column(String, default=defaultcolor)
cardview = Column(Boolean, default=cardview)
oldsite = Column(Boolean)
song = Column(String)
highres = Column(String)
profileurl = Column(String)

View File

@ -20,7 +20,9 @@ def post_embed(id, v):
p = get_post(id, v, graceful=True)
return render_template("submission_listing.html", listing=[p], v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}submission_listing.html", listing=[p], v=v)
@app.context_processor
def inject_constants():

View File

@ -61,7 +61,9 @@ def activate(v):
token = request.values.get("token", "").strip()
if int(time.time()) - timestamp > 3600:
return render_template("message.html", v=v, title="Verification link expired.",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}message.html", v=v, title="Verification link expired.",
message="That link has expired. Visit your settings to send yourself another verification email."), 410
if not validate_hash(f"{email}+{id}+{timestamp}", token):
@ -72,7 +74,9 @@ def activate(v):
abort(404)
if user.is_activated and user.email == email:
return render_template("message_success.html", v=v,
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}message_success.html", v=v,
title="Email already verified.", message="Email already verified."), 404
user.email = email
@ -86,4 +90,6 @@ def activate(v):
g.db.add(user)
g.db.commit()
return render_template("message_success.html", v=v, title="Email verified.", message=f"Your email {email} has been verified. Thank you.")
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}message_success.html", v=v, title="Email verified.", message=f"Your email {email} has been verified. Thank you.")

View File

@ -45,7 +45,9 @@ def distribute(v, cid):
@admin_level_required(2)
def truescore(v):
users = g.db.query(User).order_by(User.truecoins.desc()).limit(25).all()
return render_template("truescore.html", v=v, users=users)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}truescore.html", v=v, users=users)
@app.post("/@<username>/revert_actions")
@limiter.limit("1/second")
@ -252,7 +254,9 @@ def post_rules(v):
def shadowbanned(v):
if not (v and v.admin_level > 1): abort(404)
users = [x for x in g.db.query(User).filter(User.shadowbanned != None).all()]
return render_template("shadowbanned.html", v=v, users=users)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}shadowbanned.html", v=v, users=users)
@app.get("/admin/agendaposters")
@ -260,7 +264,9 @@ def shadowbanned(v):
def agendaposters(v):
if not (v and v.admin_level > 1): abort(404)
users = [x for x in g.db.query(User).filter_by(agendaposter = True).all()]
return render_template("agendaposters.html", v=v, users=users)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}agendaposters.html", v=v, users=users)
@app.get("/admin/image_posts")
@ -278,7 +284,9 @@ def image_posts_listing(v):
next_exists = (len(posts) > 25)
posts = get_posts(posts[:25], v=v)
return render_template("admin/image_posts.html", v=v, listing=posts, next_exists=next_exists, page=page, sort="new")
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/image_posts.html", v=v, listing=posts, next_exists=next_exists, page=page, sort="new")
@app.get("/admin/reported/posts")
@ -298,7 +306,9 @@ def reported_posts(v):
listing = get_posts(listing, v=v)
return render_template("admin/reported_posts.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/reported_posts.html",
next_exists=next_exists, listing=listing, page=page, v=v)
@ -320,7 +330,9 @@ def reported_comments(v):
listing = get_comments(listing, v=v)
return render_template("admin/reported_comments.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/reported_comments.html",
next_exists=next_exists,
listing=listing,
page=page,
@ -332,7 +344,9 @@ def reported_comments(v):
def admin_home(v):
with open('disablesignups', 'r') as f:
x = f.read()
return render_template("admin/admin_home.html", v=v, x=x)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/admin_home.html", v=v, x=x)
@app.post("/admin/disablesignups")
@admin_level_required(2)
@ -356,7 +370,9 @@ def badge_grant_get(v):
"no_user": "That user doesn't exist."
}
return render_template("admin/badge_grant.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/badge_grant.html",
v=v,
badge_types=BADGES,
error=errors.get(
@ -422,7 +438,9 @@ def users_list(v):
next_exists = (len(users) > 25)
users = users[:25]
return render_template("admin/new_users.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/new_users.html",
v=v,
users=users,
next_exists=next_exists,
@ -434,7 +452,9 @@ def users_list(v):
def alt_votes_get(v):
if not request.values.get("u1") or not request.values.get("u2"):
return render_template("admin/alt_votes.html", v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/alt_votes.html", v=v)
u1 = request.values.get("u1")
u2 = request.values.get("u2")
@ -530,7 +550,9 @@ def alt_votes_get(v):
data['u2_only_comment_downs'] // len(
u2_comment_downs) if u2_comment_downs else 0
return render_template("admin/alt_votes.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/alt_votes.html",
u1=u1,
u2=u2,
v=v,
@ -575,7 +597,9 @@ def admin_removed(v):
posts = get_posts(ids, v=v)
return render_template("admin/removed_posts.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/removed_posts.html",
v=v,
listing=posts,
page=page,
@ -599,7 +623,9 @@ def admin_removed_comments(v):
comments = get_comments(ids, v=v)
return render_template("admin/removed_comments.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/removed_comments.html",
v=v,
listing=comments,
page=page,
@ -1106,7 +1132,9 @@ def admin_dump_cache(v):
def admin_banned_domains(v):
banned_domains = g.db.query(BannedDomain).all()
return render_template("admin/banned_domains.html", v=v, banned_domains=banned_domains)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/banned_domains.html", v=v, banned_domains=banned_domains)
@app.post("/admin/banned_domains")
@limiter.limit("1/second")

View File

@ -69,7 +69,9 @@ def shop(v):
val["price"] = int(val["price"]*discount)
sales = g.db.query(Vote.id).count() + g.db.query(CommentVote.id).count() - g.db.query(func.sum(User.coins)).scalar()
return render_template("shop.html", awards=list(AWARDS.values()), v=v, sales=sales)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}shop.html", awards=list(AWARDS.values()), v=v, sales=sales)
@app.post("/buy/<award>")
@ -503,15 +505,21 @@ def award_comment(cid, v):
@app.get("/admin/awards")
@admin_level_required(2)
def admin_userawards_get(v):
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
if v.admin_level != 3: return render_template("admin/awards.html", awards=list(AWARDS3.values()), v=v)
return render_template("admin/awards.html", awards=list(AWARDS.values()), v=v)
if v.admin_level != 3:
return render_template(f"{template}admin/awards.html", awards=list(AWARDS3.values()), v=v)
return render_template(f"{template}admin/awards.html", awards=list(AWARDS.values()), v=v)
@app.post("/admin/awards")
@limiter.limit("1/second")
@admin_level_required(2)
@validate_formkey
def admin_userawards_post(v):
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
try: u = request.values.get("username").strip()
except: abort(404)
@ -551,5 +559,5 @@ def admin_userawards_post(v):
g.db.commit()
if v.admin_level != 3: return render_template("admin/awards.html", awards=list(AWARDS3.values()), v=v)
return render_template("admin/awards.html", awards=list(AWARDS.values()), v=v)
if v.admin_level != 3: return render_template(f"{template}admin/awards.html", awards=list(AWARDS3.values()), v=v)
return render_template(f"{template}admin/awards.html", awards=list(AWARDS.values()), v=v)

View File

@ -602,7 +602,9 @@ def api_comment(v):
g.db.commit()
if request.headers.get("Authorization"): return c.json
else: return render_template("comments.html", v=v, comments=[c])
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}comments.html", v=v, comments=[c])
@ -684,7 +686,9 @@ def edit_comment(cid, v):
if ban.reason: reason += f" {ban.reason}"
if request.headers.get("Authorization"): return {'error': f'A blacklisted domain was used.'}, 400
else: return render_template("comment_failed.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}comment_failed.html",
action=f"/edit_comment/{c.id}",
badlinks=[x.domain for x in bans],
body=body,

View File

@ -98,7 +98,9 @@ def discord_redirect(v):
requests.delete(url, headers=headers, timeout=5)
if g.db.query(User).filter(User.id!=v.id, User.discord_id==x["id"]).first():
return render_template("message.html", title="Discord account already linked.", error="That Discord account is already in use by another user.", v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}message.html", title="Discord account already linked.", error="That Discord account is already in use by another user.", v=v)
v.discord_id=x["id"]
g.db.add(v)

View File

@ -107,7 +107,9 @@ def notifications(v):
if request.headers.get("Authorization"): return {"data":[x.json for x in listing]}
return render_template("notifications.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}notifications.html",
v=v,
notifications=listing,
next_exists=next_exists,
@ -190,7 +192,9 @@ def front_all(v):
g.db.commit()
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)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}home.html", v=v, listing=posts, next_exists=next_exists, sort=sort, t=t, page=page)
@ -299,7 +303,9 @@ def changelog(v):
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("changelog.html", v=v, listing=posts, next_exists=next_exists, sort=sort, t=t, page=page)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}changelog.html", v=v, listing=posts, next_exists=next_exists, sort=sort, t=t, page=page)
@cache.memoize(timeout=86400)
@ -441,4 +447,6 @@ def all_comments(v):
idlist = idlist[:25]
if request.headers.get("Authorization"): return {"data": [x.json for x in comments]}
else: return render_template("home_comments.html", v=v, sort=sort, t=t, page=page, comments=comments, standalone=True, next_exists=next_exists)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}home_comments.html", v=v, sort=sort, t=t, page=page, comments=comments, standalone=True, next_exists=next_exists)

View File

@ -16,7 +16,9 @@ def login_get(v):
if v:
return redirect(redir)
return render_template("login.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}login.html",
failed=False,
redirect=redir)
@ -89,19 +91,25 @@ def login_post():
if not account:
time.sleep(random.uniform(0, 2))
return render_template("login.html", failed=True)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}login.html", failed=True)
if request.values.get("password"):
if not account.verifyPass(request.values.get("password")):
time.sleep(random.uniform(0, 2))
return render_template("login.html", failed=True)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}login.html", failed=True)
if account.mfa_secret:
now = int(time.time())
hash = generate_hash(f"{account.id}+{now}+2fachallenge")
return render_template("login_2fa.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}login_2fa.html",
v=account,
time=now,
hash=hash,
@ -121,7 +129,9 @@ def login_post():
if not account.validate_2fa(request.values.get("2fa_token", "").strip()):
hash = generate_hash(f"{account.id}+{time}+2fachallenge")
return render_template("login_2fa.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}login_2fa.html",
v=account,
time=now,
hash=hash,
@ -187,7 +197,9 @@ def sign_up_get(v):
ref_user = None
if ref_user and (ref_user.id in session.get("history", [])):
return render_template("sign_up_failed_ref.html")
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}sign_up_failed_ref.html")
now = int(time.time())
token = token_hex(16)
@ -204,7 +216,9 @@ def sign_up_get(v):
error = request.values.get("error", None)
return render_template("sign_up.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}sign_up.html",
formkey=formkey,
now=now,
redirect=redir,
@ -363,7 +377,9 @@ def sign_up_post(v):
@app.get("/forgot")
def get_forgot():
return render_template("forgot_password.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}forgot_password.html",
)
@ -401,7 +417,9 @@ def post_forgot():
v=user)
)
return render_template("forgot_password.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}forgot_password.html",
msg="If the username and email matches an account, you will be sent a password reset email. You have ten minutes to complete the password reset process.")
@ -415,7 +433,9 @@ def get_reset():
now = int(time.time())
if now - timestamp > 600:
return render_template("message.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}message.html",
title="Password reset link expired",
error="That password reset link has expired.")
@ -429,7 +449,9 @@ def get_reset():
reset_token = generate_hash(f"{user.id}+{timestamp}+reset+{user.login_nonce}")
return render_template("reset_password.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}reset_password.html",
v=user,
token=reset_token,
time=timestamp,
@ -454,7 +476,9 @@ def post_reset(v):
now = int(time.time())
if now - timestamp > 600:
return render_template("message.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}message.html",
title="Password reset expired",
error="That password reset form has expired.")
@ -466,7 +490,9 @@ def post_reset(v):
abort(404)
if not password == confirm_password:
return render_template("reset_password.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}reset_password.html",
v=user,
token=token,
time=timestamp,
@ -477,7 +503,9 @@ def post_reset(v):
g.db.commit()
return render_template("message_success.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}message_success.html",
title="Password reset successful!",
message="Login normally to access your account.")
@ -498,7 +526,9 @@ def request_2fa_disable():
username=request.values.get("username")
user=get_user(username, graceful=True)
if not user or not user.email or not user.mfa_secret:
return render_template("message.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}message.html",
title="Removal request received",
message="If username, password, and email match, we will send you an email.")
@ -510,14 +540,18 @@ def request_2fa_disable():
email=email.replace('.','').replace('_','')
email=f"{email}@gmail.com"
if email != user.email:
return render_template("message.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}message.html",
title="Removal request received",
message="If username, password, and email match, we will send you an email.")
password =request.values.get("password")
if not user.verifyPass(password):
return render_template("message.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}message.html",
title="Removal request received",
message="If username, password, and email match, we will send you an email.")
@ -533,7 +567,9 @@ def request_2fa_disable():
v=user)
)
return render_template("message.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}message.html",
title="Removal request received",
message="If username, password, and email match, we will send you an email.")
@ -544,7 +580,9 @@ def reset_2fa():
t=int(request.values.get("t"))
if now > t+3600*24:
return render_template("message.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}message.html",
title="Expired Link",
error="That link has expired.")
@ -562,6 +600,8 @@ def reset_2fa():
g.db.commit()
return render_template("message_success.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}message_success.html",
title="Two-factor authentication removed.",
message="Login normally to access your account.")

View File

@ -13,7 +13,9 @@ def authorize_prompt(v):
client_id = request.values.get("client_id")
application = g.db.query(OauthApp).filter_by(client_id=client_id).first()
if not application: return {"oauth_error": "Invalid `client_id`"}, 401
return render_template("oauth.html", v=v, application=application)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}oauth.html", v=v, application=application)
@app.post("/authorize")
@ -206,7 +208,9 @@ def admin_app_id(v, aid):
posts=get_posts(pids, v=v)
return render_template("admin/app.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/app.html",
v=v,
app=oauth,
listing=posts,
@ -233,7 +237,9 @@ def admin_app_id_comments(v, aid):
comments=get_comments(cids, v=v)
return render_template("admin/app.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/app.html",
v=v,
app=oauth,
comments=comments,
@ -248,7 +254,9 @@ def admin_apps_list(v):
apps = g.db.query(OauthApp).all()
return render_template("admin/apps.html", v=v, apps=apps)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/apps.html", v=v, apps=apps)
@app.post("/oauth/reroll/<aid>")

View File

@ -81,7 +81,9 @@ def publish(pid, v):
@auth_required
def submit_get(v):
return render_template("submit.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}submit.html",
v=v)
@app.get("/post/<pid>")
@ -214,7 +216,9 @@ def post_id(pid, anything=None, v=None):
g.db.add(post)
if request.host != 'old.rdrama.net' and post.over_18 and not (v and v.over_18) and session.get('over_18', 0) < int(time.time()):
if request.headers.get("Authorization"): return {"error":"Must be 18+ to view"}, 451
else: return render_template("errors/nsfw.html", v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}errors/nsfw.html", v=v)
g.db.commit()
if request.headers.get("Authorization"): return post.json
@ -320,7 +324,9 @@ def viewmore(v, pid, sort, offset):
if len(comments) == len(comments2): offset = None
comments = comments2
return render_template("comments.html", v=v, comments=comments, render_replies=True, pid=pid, sort=sort, offset=offset)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}comments.html", v=v, comments=comments, render_replies=True, pid=pid, sort=sort, offset=offset)
@app.post("/morecomments/<cid>")
@ -365,7 +371,9 @@ def morecomments(v, cid):
c = g.db.query(Comment).filter_by(id=cid).first()
comments = c.replies
return render_template("comments.html", v=v, comments=comments, render_replies=True)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}comments.html", v=v, comments=comments, render_replies=True)
@app.post("/edit_post/<pid>")
@limiter.limit("1/second")
@ -778,7 +786,9 @@ def submit_post(v):
domain_obj = get_domain(domain)
if domain_obj:
if request.headers.get("Authorization"): return {"error":domain_obj.reason}, 400
else: return render_template("submit.html", v=v, error=domain_obj.reason, title=title, url=url, body=request.values.get("body", "")), 400
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}submit.html", v=v, error=domain_obj.reason, title=title, url=url, body=request.values.get("body", "")), 400
elif "twitter.com" == domain:
try: embed = requests.get("https://publish.twitter.com/oembed", timeout=5, params={"url":url, "omit_script":"t"}).json()["html"]
except: embed = None
@ -799,11 +809,15 @@ def submit_post(v):
if not url and not request.values.get("body") and not request.files.get("file", None):
if request.headers.get("Authorization"): return {"error": "`url` or `body` parameter required."}, 400
else: return render_template("submit.html", v=v, error="Please enter a url or some text.", title=title, url=url, body=request.values.get("body", "")), 400
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}submit.html", v=v, error="Please enter a url or some text.", title=title, url=url, body=request.values.get("body", "")), 400
if not title:
if request.headers.get("Authorization"): return {"error": "Please enter a better title"}, 400
else: return render_template("submit.html", v=v, error="Please enter a better title.", title=title, url=url, body=request.values.get("body", "")), 400
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}submit.html", v=v, error="Please enter a better title.", title=title, url=url, body=request.values.get("body", "")), 400
elif len(title) > 500:
@ -893,12 +907,16 @@ def submit_post(v):
if len(str(body)) > 10000:
if request.headers.get("Authorization"): return {"error":"10000 character limit for text body."}, 400
else: return render_template("submit.html", v=v, error="10000 character limit for text body.", title=title, url=url, body=request.values.get("body", "")), 400
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}submit.html", v=v, error="10000 character limit for text body.", title=title, url=url, body=request.values.get("body", "")), 400
if len(url) > 2048:
if request.headers.get("Authorization"): return {"error":"2048 character limit for URLs."}, 400
else: return render_template("submit.html", v=v, error="2048 character limit for URLs.", title=title, url=url,body=request.values.get("body", "")), 400
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}submit.html", v=v, error="2048 character limit for URLs.", title=title, url=url,body=request.values.get("body", "")), 400
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE):
if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'![]({i.group(1)})')
@ -933,7 +951,9 @@ def submit_post(v):
body += f"\n\n{url}"
else:
if request.headers.get("Authorization"): return {"error": f"Image/Video files only"}, 400
else: return render_template("submit.html", v=v, error=f"Image/Video files only."), 400
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}submit.html", v=v, error=f"Image/Video files only."), 400
body_html = sanitize(CustomRenderer().render(mistletoe.Document(body)))
@ -952,7 +972,9 @@ def submit_post(v):
reason = f"Remove the {ban.domain} link from your post and try again."
if ban.reason: reason += f" {ban.reason}"
if request.headers.get("Authorization"): return {"error": reason}, 403
else: return render_template("submit.html", v=v, error=reason, title=title, url=url, body=request.values.get("body", "")), 403
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}submit.html", v=v, error=reason, title=title, url=url, body=request.values.get("body", "")), 403
if not v.club_banned: club = bool(request.values.get("club",""))
else: club = False
@ -1012,7 +1034,9 @@ def submit_post(v):
if not file.content_type.startswith(('image/', 'video/')):
if request.headers.get("Authorization"): return {"error": f"File type not allowed"}, 400
else: return render_template("submit.html", v=v, error=f"File type not allowed.", title=title, body=request.values.get("body", "")), 400
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}submit.html", v=v, error=f"File type not allowed.", title=title, body=request.values.get("body", "")), 400
if file.content_type.startswith('image/'):
name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp'

View File

@ -161,7 +161,9 @@ def searchposts(v):
domain_obj=None
if request.headers.get("Authorization"): return {"total":total, "data":[x.json for x in posts]}
else: return render_template("search.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}search.html",
v=v,
query=query,
total=total,
@ -250,7 +252,9 @@ def searchcomments(v):
comments = get_comments(ids, v=v)
if request.headers.get("Authorization"): return {"total":total, "data":[x.json for x in comments]}
else: return render_template("search_comments.html", v=v, query=query, total=total, page=page, comments=comments, sort=sort, t=t, next_exists=next_exists)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}search_comments.html", v=v, query=query, total=total, page=page, comments=comments, sort=sort, t=t, next_exists=next_exists)
@app.get("/search/users")
@ -279,4 +283,6 @@ def searchusers(v):
if request.headers.get("Authorization"): return [x.json for x in users]
else: return render_template("search_users.html", v=v, query=query, total=total, page=page, users=users, sort=sort, t=t, next_exists=next_exists)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}search_users.html", v=v, query=query, total=total, page=page, users=users, sort=sort, t=t, next_exists=next_exists)

View File

@ -89,6 +89,10 @@ def settings_profile_post(v):
updated = True
v.oldreddit = request.values.get("oldreddit", None) == 'true'
elif request.values.get("oldsite", v.oldsite) != v.oldsite:
updated = True
v.oldsite = request.values.get("oldsite", None) == 'true'
elif request.values.get("teddit", v.teddit) != v.teddit:
updated = True
v.teddit = request.values.get("teddit", None) == 'true'
@ -122,28 +126,36 @@ def settings_profile_post(v):
v.bio_html = None
g.db.add(v)
g.db.commit()
return render_template("settings_profile.html", v=v, msg="Your bio has been updated.")
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html", v=v, msg="Your bio has been updated.")
elif request.values.get("sig") == "":
v.sig = None
v.sig_html = None
g.db.add(v)
g.db.commit()
return render_template("settings_profile.html", v=v, msg="Your sig has been updated.")
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html", v=v, msg="Your sig has been updated.")
elif request.values.get("friends") == "":
v.friends = None
v.friends_html = None
g.db.add(v)
g.db.commit()
return render_template("settings_profile.html", v=v, msg="Your friends list has been updated.")
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html", v=v, msg="Your friends list has been updated.")
elif request.values.get("enemies") == "":
v.enemies = None
v.enemies_html = None
g.db.add(v)
g.db.commit()
return render_template("settings_profile.html", v=v, msg="Your enemies list has been updated.")
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html", v=v, msg="Your enemies list has been updated.")
elif (v.patron or v.id == 1904) and request.values.get("sig"):
sig = request.values.get("sig")[:200]
@ -165,7 +177,9 @@ def settings_profile_post(v):
return {"error": reason}, 401
if len(sig_html) > 1000:
return render_template("settings_profile.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html",
v=v,
error="Your sig is too long")
@ -173,7 +187,9 @@ def settings_profile_post(v):
v.sig_html=sig_html
g.db.add(v)
g.db.commit()
return render_template("settings_profile.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html",
v=v,
msg="Your sig has been updated.")
@ -197,7 +213,9 @@ def settings_profile_post(v):
return {"error": reason}, 401
if len(friends_html) > 2000:
return render_template("settings_profile.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html",
v=v,
error="Your friends list is too long")
@ -216,7 +234,9 @@ def settings_profile_post(v):
v.friends_html=friends_html
g.db.add(v)
g.db.commit()
return render_template("settings_profile.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html",
v=v,
msg="Your friends list has been updated.")
@ -238,7 +258,9 @@ def settings_profile_post(v):
return {"error": reason}, 401
if len(enemies_html) > 2000:
return render_template("settings_profile.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html",
v=v,
error="Your enemies list is too long")
@ -258,7 +280,9 @@ def settings_profile_post(v):
v.enemies_html=enemies_html
g.db.add(v)
g.db.commit()
return render_template("settings_profile.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html",
v=v,
msg="Your enemies list has been updated.")
@ -283,14 +307,18 @@ def settings_profile_post(v):
bio += f"\n\n{url}"
else:
if request.headers.get("Authorization"): return {"error": f"Image/Video files only"}, 400
else: return render_template("settings_profile.html", v=v, error=f"Image/Video files only."), 400
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html", v=v, error=f"Image/Video files only."), 400
bio_html = CustomRenderer().render(mistletoe.Document(bio))
bio_html = sanitize(bio_html)
bans = filter_comment_html(bio_html)
if len(bio_html) > 10000:
return render_template("settings_profile.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html",
v=v,
error="Your bio is too long")
@ -319,7 +347,9 @@ def settings_profile_post(v):
v.bio_html=bio_html
g.db.add(v)
g.db.commit()
return render_template("settings_profile.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html",
v=v,
msg="Your bio has been updated.")
@ -409,12 +439,17 @@ def settings_profile_post(v):
def filters(v):
filters=request.values.get("filters")[:1000].strip()
if filters == v.custom_filter_list: return render_template("settings_filters.html", v=v, error="You didn't change anything")
if filters == v.custom_filter_list:
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_filters.html", v=v, error="You didn't change anything")
v.custom_filter_list=filters
g.db.add(v)
g.db.commit()
return render_template("settings_filters.html", v=v, msg="Your custom filters have been updated.")
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_filters.html", v=v, msg="Your custom filters have been updated.")
@app.post("/changelogsub")
@auth_required
@ -434,9 +469,12 @@ def changelogsub(v):
@auth_required
@validate_formkey
def namecolor(v):
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
color = str(request.values.get("color", "")).strip()
if color.startswith('#'): color = color[1:]
if len(color) != 6: return render_template("settings_security.html", v=v, error="Invalid color code")
if len(color) != 6: return render_template(f"{template}settings_security.html", v=v, error="Invalid color code")
v.namecolor = color
g.db.add(v)
g.db.commit()
@ -447,9 +485,12 @@ def namecolor(v):
@auth_required
@validate_formkey
def themecolor(v):
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
themecolor = str(request.values.get("themecolor", "")).strip()
if themecolor.startswith('#'): themecolor = themecolor[1:]
if len(themecolor) != 6: return render_template("settings_security.html", v=v, error="Invalid color code")
if len(themecolor) != 6: return render_template(f"{template}settings_security.html", v=v, error="Invalid color code")
v.themecolor = themecolor
g.db.add(v)
g.db.commit()
@ -520,9 +561,12 @@ def gumroad(v):
@auth_required
@validate_formkey
def titlecolor(v):
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
titlecolor = str(request.values.get("titlecolor", "")).strip()
if titlecolor.startswith('#'): titlecolor = titlecolor[1:]
if len(titlecolor) != 6: return render_template("settings_profile.html", v=v, error="Invalid color code")
if len(titlecolor) != 6: return render_template(f"{template}settings_profile.html", v=v, error="Invalid color code")
v.titlecolor = titlecolor
g.db.add(v)
g.db.commit()
@ -533,9 +577,12 @@ def titlecolor(v):
@auth_required
@validate_formkey
def verifiedcolor(v):
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
verifiedcolor = str(request.values.get("verifiedcolor", "")).strip()
if verifiedcolor.startswith('#'): verifiedcolor = verifiedcolor[1:]
if len(verifiedcolor) != 6: return render_template("settings_profile.html", v=v, error="Invalid color code")
if len(verifiedcolor) != 6: return render_template(f"{template}settings_profile.html", v=v, error="Invalid color code")
v.verifiedcolor = verifiedcolor
g.db.add(v)
g.db.commit()
@ -662,7 +709,9 @@ def settings_log_out_others(v):
submitted_password = request.values.get("password", "").strip()
if not v.verifyPass(submitted_password):
return render_template("settings_security.html", v=v, error="Incorrect Password"), 401
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_security.html", v=v, error="Incorrect Password"), 401
v.login_nonce += 1
@ -672,7 +721,9 @@ def settings_log_out_others(v):
g.db.commit()
return render_template("settings_security.html", v=v, msg="All other devices have been logged out")
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_security.html", v=v, msg="All other devices have been logged out")
@app.post("/settings/images/profile")
@ -708,7 +759,9 @@ def settings_images_profile(v):
g.db.commit()
return render_template("settings_profile.html", v=v, msg="Profile picture successfully updated.")
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html", v=v, msg="Profile picture successfully updated.")
@app.post("/settings/images/banner")
@ -734,7 +787,9 @@ def settings_images_banner(v):
g.db.add(v)
g.db.commit()
return render_template("settings_profile.html", v=v, msg="Banner successfully updated.")
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html", v=v, msg="Banner successfully updated.")
@app.post("/settings/delete/profile")
@ -748,7 +803,9 @@ def settings_delete_profile(v):
g.db.add(v)
g.db.commit()
return render_template("settings_profile.html", v=v,
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html", v=v,
msg="Profile picture successfully removed.")
@app.post("/settings/delete/banner")
@ -762,20 +819,26 @@ def settings_delete_banner(v):
g.db.add(v)
g.db.commit()
return render_template("settings_profile.html", v=v, msg="Banner successfully removed.")
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html", v=v, msg="Banner successfully removed.")
@app.get("/settings/blocks")
@auth_required
def settings_blockedpage(v):
return render_template("settings_blocks.html", v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_blocks.html", v=v)
@app.get("/settings/css")
@auth_required
def settings_css_get(v):
return render_template("settings_css.html", v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_css.html", v=v)
@app.post("/settings/css")
@limiter.limit("1/second")
@ -788,14 +851,18 @@ def settings_css(v):
g.db.add(v)
g.db.commit()
return render_template("settings_css.html", v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_css.html", v=v)
@app.get("/settings/profilecss")
@auth_required
def settings_profilecss_get(v):
if v.truecoins < 1000 and not v.patron and v.admin_level == 0 : return f"You must have +1000 {COINS_NAME} or be a paypig to set profile css."
return render_template("settings_profilecss.html", v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profilecss.html", v=v)
@app.post("/settings/profilecss")
@limiter.limit("1/second")
@ -808,7 +875,9 @@ def settings_profilecss(v):
g.db.add(v)
g.db.commit()
return render_template("settings_profilecss.html", v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profilecss.html", v=v)
@app.post("/settings/block")
@limiter.limit("1/second")
@ -876,7 +945,9 @@ def settings_unblock_user(v):
@auth_required
def settings_apps(v):
return render_template("settings_apps.html", v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_apps.html", v=v)
@app.post("/settings/remove_discord")
@ -898,7 +969,9 @@ def settings_remove_discord(v):
@auth_required
def settings_content_get(v):
return render_template("settings_filters.html", v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_filters.html", v=v)
@app.post("/settings/name_change")
@limiter.limit("1/second")
@ -911,12 +984,16 @@ def settings_name_change(v):
new_name=request.values.get("name").strip()
if new_name==v.username:
return render_template("settings_profile.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html",
v=v,
error="You didn't change anything")
if not re.match(valid_username_regex, new_name):
return render_template("settings_profile.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html",
v=v,
error=f"This isn't a valid username.")
@ -930,7 +1007,9 @@ def settings_name_change(v):
).first()
if x and x.id != v.id:
return render_template("settings_profile.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html",
v=v,
error=f"Username `{new_name}` is already in use.")
@ -966,7 +1045,9 @@ def settings_song_change(v):
id = song.split("v=")[1]
elif song.startswith("https://youtu.be/"):
id = song.split("https://youtu.be/")[1]
else: return render_template("settings_profile.html", v=v, error=f"Not a youtube link.")
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html", v=v, error=f"Not a youtube link.")
if "?" in id: id = id.split("?")[0]
if "&" in id: id = id.split("&")[0]
@ -981,15 +1062,21 @@ def settings_song_change(v):
req = requests.get(f"https://www.googleapis.com/youtube/v3/videos?id={id}&key={YOUTUBE_KEY}&part=contentDetails", timeout=5).json()
duration = req['items'][0]['contentDetails']['duration']
if duration == 'P0D':
return render_template("settings_profile.html", v=v, error=f"Can't use a live youtube video!")
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html", v=v, error=f"Can't use a live youtube video!")
if "H" in duration:
return render_template("settings_profile.html", v=v, error=f"Duration of the video must not exceed 10 minutes.")
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html", v=v, error=f"Duration of the video must not exceed 10 minutes.")
if "M" in duration:
duration = int(duration.split("PT")[1].split("M")[0])
if duration > 10:
return render_template("settings_profile.html", v=v, error=f"Duration of the video must not exceed 10 minutes.")
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html", v=v, error=f"Duration of the video must not exceed 10 minutes.")
if v.song and path.isfile(f"/songs/{v.song}.mp3") and g.db.query(User.id).filter_by(song=v.song).count() == 1:
@ -1009,7 +1096,9 @@ def settings_song_change(v):
try: ydl.download([f"https://youtube.com/watch?v={id}"])
except Exception as e:
print(e)
return render_template("settings_profile.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html",
v=v,
error=f"Age-restricted videos aren't allowed.")
@ -1030,12 +1119,14 @@ def settings_song_change(v):
@auth_required
@validate_formkey
def settings_title_change(v):
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
if v.flairchanged: abort(403)
new_name=request.values.get("title").strip()[:100].replace("𒐪","")
if new_name==v.customtitle: return render_template("settings_profile.html", v=v, error="You didn't change anything")
if new_name==v.customtitle: return render_template(f"{template}settings_profile.html", v=v, error="You didn't change anything")
v.customtitleplain = new_name

View File

@ -16,7 +16,9 @@ site_name = environ.get("SITE_NAME").strip()
@auth_desired
def emojis(v):
emojis = (x.replace('.webp','') for x in os.listdir("files/assets/images/emojis"))
return render_template("emojis.html", v=v, emojis=emojis)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}emojis.html", v=v, emojis=emojis)
@app.get('/rules')
@auth_desired
@ -68,7 +70,9 @@ def participation_stats(v):
}
return render_template("admin/content_stats.html", v=v, title="Content Statistics", data=data)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/content_stats.html", v=v, title="Content Statistics", data=data)
@app.get("/chart")
@ -157,14 +161,18 @@ def cached_chart(days):
def patrons(v):
users = g.db.query(User).filter(User.patron > 0).order_by(User.patron.desc(), User.id).all()
return render_template("patrons.html", v=v, users=users)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}patrons.html", v=v, users=users)
@app.get("/admins")
@app.get("/badmins")
@auth_desired
def admins(v):
admins = g.db.query(User).filter(User.admin_level>0).order_by(User.truecoins.desc()).all()
return render_template("admins.html", v=v, admins=admins)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admins.html", v=v, admins=admins)
@app.get("/log")
@ -197,7 +205,9 @@ def log(v):
admins = [x[0] for x in g.db.query(User.username).filter(User.admin_level > 1).all()]
return render_template("log.html", v=v, admins=admins, types=types, admin=admin, type=kind, actions=actions, next_exists=next_exists, page=page)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}log.html", v=v, admins=admins, types=types, admin=admin, type=kind, actions=actions, next_exists=next_exists, page=page)
@app.get("/log/<id>")
@auth_desired
@ -221,7 +231,9 @@ def log_item(id, v):
if v and v.admin_level > 1: types = ACTIONTYPES
else: types = ACTIONTYPES2
return render_template("log.html", v=v, actions=[action], next_exists=False, page=1, action=action, admins=admins, types=types)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}log.html", v=v, actions=[action], next_exists=False, page=1, action=action, admins=admins, types=types)
@app.get("/assets/favicon.ico")
def favicon():
@ -230,7 +242,9 @@ def favicon():
@app.get("/api")
@auth_desired
def api(v):
return render_template("api.html", v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}api.html", v=v)
@app.get("/contact")
@app.get("/press")
@ -238,7 +252,9 @@ def api(v):
@auth_required
def contact(v):
return render_template("contact.html", v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}contact.html", v=v)
@app.post("/contact")
@limiter.limit("1/second")
@ -248,7 +264,9 @@ def submit_contact(v):
message = f'This message has been sent automatically to all admins via [/contact](/contact), user email is "{v.email}"\n\nMessage:\n\n' + request.values.get("message", "")
send_admin(v.id, message)
g.db.commit()
return render_template("contact.html", v=v, msg="Your message has been sent.")
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}contact.html", v=v, msg="Your message has been sent.")
@app.get('/archives')
def archivesindex():
@ -318,13 +336,17 @@ def settings(v):
def settings_profile(v):
return render_template("settings_profile.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_profile.html",
v=v)
@app.get("/badges")
@auth_desired
def badges(v):
return render_template("badges.html", v=v, badges=BADGES)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}badges.html", v=v, badges=BADGES)
@app.get("/blocks")
@auth_desired
@ -338,20 +360,26 @@ def blocks(v):
users.append(get_account(x.user_id))
targets.append(get_account(x.target_id))
return render_template("blocks.html", v=v, users=users, targets=targets)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}blocks.html", v=v, users=users, targets=targets)
@app.get("/banned")
@auth_desired
def banned(v):
users = [x for x in g.db.query(User).filter(User.is_banned > 0, User.unban_utc == 0).all()]
return render_template("banned.html", v=v, users=users)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}banned.html", v=v, users=users)
@app.get("/formatting")
@auth_desired
def formatting(v):
return render_template("formatting.html", v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}formatting.html", v=v)
@app.get("/service-worker.js")
def serviceworker():
@ -362,7 +390,9 @@ def serviceworker():
def settings_security(v):
return render_template("settings_security.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}settings_security.html",
v=v,
mfa_secret=pyotp.random_base32() if not v.mfa_secret else None,
error=request.values.get("error") or None,

View File

@ -35,7 +35,9 @@ def upvoters(v, username):
users = sorted(users2, key=lambda x: x[1], reverse=True)[:25]
return render_template("voters.html", v=v, users=users, name='Up', name2=f'@{username} biggest simps')
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}voters.html", v=v, users=users, name='Up', name2=f'@{username} biggest simps')
@app.get("/@<username>/downvoters")
@auth_desired
@ -54,7 +56,9 @@ def downvoters(v, username):
users = sorted(users2, key=lambda x: x[1], reverse=True)[:25]
return render_template("voters.html", v=v, users=users, name='Down', name2=f'@{username} biggest haters')
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}voters.html", v=v, users=users, name='Down', name2=f'@{username} biggest haters')
@app.get("/@<username>/upvoting")
@auth_desired
@ -73,7 +77,9 @@ def upvoting(v, username):
users = sorted(users2, key=lambda x: x[1], reverse=True)[:25]
return render_template("voters.html", v=v, users=users, name='Up', name2=f'Who @{username} simps for')
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}voters.html", v=v, users=users, name='Up', name2=f'Who @{username} simps for')
@app.get("/@<username>/downvoting")
@auth_desired
@ -92,7 +98,9 @@ def downvoting(v, username):
users = sorted(users2, key=lambda x: x[1], reverse=True)[:25]
return render_template("voters.html", v=v, users=users, name='Down', name2=f'Who @{username} hates')
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}voters.html", v=v, users=users, name='Down', name2=f'Who @{username} hates')
@app.post("/pay_rent")
@limiter.limit("1/second")
@ -154,7 +162,9 @@ def steal(v):
@auth_desired
def rentoids(v):
users = g.db.query(User).filter(User.rent_utc > 0).all()
return render_template("rentoids.html", v=v, users=users)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}rentoids.html", v=v, users=users)
@app.get("/thiefs")
@ -163,7 +173,9 @@ def thiefs(v):
successful = g.db.query(User).filter(User.steal_utc > 0).all()
failed = g.db.query(User).filter(User.fail_utc > 0).all()
failed2 = g.db.query(User).filter(User.fail2_utc > 0).all()
return render_template("thiefs.html", v=v, successful=successful, failed=failed, failed2=failed2)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}thiefs.html", v=v, successful=successful, failed=failed, failed2=failed2)
@app.post("/@<username>/suicide")
@ -275,8 +287,12 @@ def leaderboard(v):
if 'pcmemes.net' == request.host:
users6 = users.order_by(User.basedcount.desc()).limit(10).all()
return render_template("leaderboard.html", v=v, users1=users1, users2=users2, users3=users3, users4=users4, users5=users5, users6=users6, users7=users7, users9=users9)
return render_template("leaderboard.html", v=v, users1=users1, users2=users2, users3=users3, users4=users4, users5=users5, users7=users7, users9=users9)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}leaderboard.html", v=v, users1=users1, users2=users2, users3=users3, users4=users4, users5=users5, users6=users6, users7=users7, users9=users9)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}leaderboard.html", v=v, users1=users1, users2=users2, users3=users3, users4=users4, users5=users5, users7=users7, users9=users9)
@app.get("/@<username>/css")
@ -437,7 +453,9 @@ def messagereply(v):
g.db.commit()
return render_template("comments.html", v=v, comments=[new_comment])
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}comments.html", v=v, comments=[new_comment])
@app.get("/2faqr/<secret>")
@auth_required
@ -496,7 +514,9 @@ def followers(username, v):
# if 'rdrama.net' in request.host and u.id == 147: abort(404)
ids = [x[0] for x in g.db.query(Follow.user_id).filter_by(target_id=u.id).all()]
users = g.db.query(User).filter(User.id.in_(ids)).all()
return render_template("followers.html", v=v, u=u, users=users)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}followers.html", v=v, u=u, users=users)
@app.get("/@<username>/following")
@auth_required
@ -505,14 +525,21 @@ def following(username, v):
# if 'rdrama.net' in request.host and u.id == 147: abort(404)
ids = [x[0] for x in g.db.query(Follow.target_id).filter_by(user_id=u.id).all()]
users = g.db.query(User).filter(User.id.in_(ids)).all()
return render_template("following.html", v=v, u=u, users=users)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}following.html", v=v, u=u, users=users)
@app.get("/views")
@auth_required
def visitors(v):
if 'rdrama.net' in request.host and v.admin_level < 1 and not v.patron: return render_template("errors/patron.html", v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
if 'rdrama.net' in request.host and v.admin_level < 1 and not v.patron: return render_template(f"{template}errors/patron.html", v=v)
viewers=sorted(v.viewers, key = lambda x: x.last_view_utc, reverse=True)
return render_template("viewers.html", v=v, viewers=viewers)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}viewers.html", v=v, viewers=viewers)
@app.get("/@<username>")
@ -535,7 +562,9 @@ def u_username(username, v=None):
if u.reserved:
if request.headers.get("Authorization"): return {"error": f"That username is reserved for: {u.reserved}"}
else: return render_template("userpage_reserved.html", u=u, v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}userpage_reserved.html", u=u, v=v)
if v and u.id != v.id:
view = g.db.query(ViewerRelationship).filter(
@ -560,20 +589,28 @@ def u_username(username, v=None):
if v and u.id == LLM_ID:
if int(time.time()) - v.rent_utc > 600:
if request.headers.get("Authorization"): return {"error": "That userpage is private"}
else: return render_template("userpage_private.html", time=int(time.time()), u=u, v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}userpage_private.html", time=int(time.time()), u=u, v=v)
else:
if request.headers.get("Authorization"): return {"error": "That userpage is private"}
else: return render_template("userpage_private.html", time=int(time.time()), u=u, v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}userpage_private.html", time=int(time.time()), u=u, v=v)
if v and hasattr(u, 'is_blocking') and u.is_blocking:
if request.headers.get("Authorization"): return {"error": f"You are blocking @{u.username}."}
else: return render_template("userpage_blocking.html", u=u, v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}userpage_blocking.html", u=u, v=v)
if v and v.admin_level < 2 and hasattr(u, 'is_blocked') and u.is_blocked:
if request.headers.get("Authorization"): return {"error": "This person is blocking you."}
else: return render_template("userpage_blocked.html", u=u, v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}userpage_blocked.html", u=u, v=v)
sort = request.values.get("sort", "new")
@ -597,7 +634,9 @@ def u_username(username, v=None):
if u.unban_utc:
if request.headers.get("Authorization"): {"data": [x.json for x in listing]}
else: return render_template("userpage.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}userpage.html",
unban=u.unban_string,
u=u,
v=v,
@ -611,7 +650,9 @@ def u_username(username, v=None):
if request.headers.get("Authorization"): return {"data": [x.json for x in listing]}
else: return render_template("userpage.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}userpage.html",
u=u,
v=v,
listing=listing,
@ -643,7 +684,9 @@ def u_username_comments(username, v=None):
if u.reserved:
if request.headers.get("Authorization"): return {"error": f"That username is reserved for: {u.reserved}"}
else: return render_template("userpage_reserved.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}userpage_reserved.html",
u=u,
v=v)
@ -652,18 +695,26 @@ def u_username_comments(username, v=None):
if v and u.id == LLM_ID:
if int(time.time()) - v.rent_utc > 600:
if request.headers.get("Authorization"): return {"error": "That userpage is private"}
else: return render_template("userpage_private.html", time=int(time.time()), u=u, v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}userpage_private.html", time=int(time.time()), u=u, v=v)
else:
if request.headers.get("Authorization"): return {"error": "That userpage is private"}
else: return render_template("userpage_private.html", time=int(time.time()), u=u, v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}userpage_private.html", time=int(time.time()), u=u, v=v)
if v and hasattr(u, 'is_blocking') and u.is_blocking:
if request.headers.get("Authorization"): return {"error": f"You are blocking @{u.username}."}
else: return render_template("userpage_blocking.html", u=u, v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}userpage_blocking.html", u=u, v=v)
if v and v.admin_level < 2 and hasattr(u, 'is_blocked') and u.is_blocked:
if request.headers.get("Authorization"): return {"error": "This person is blocking you."}
else: return render_template("userpage_blocked.html", u=u, v=v)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}userpage_blocked.html", u=u, v=v)
page = int(request.values.get("page", "1"))
@ -714,7 +765,9 @@ def u_username_comments(username, v=None):
is_following = (v and user.has_follower(v))
if request.headers.get("Authorization"): return {"data": [c.json for c in listing]}
else: return render_template("userpage_comments.html", u=user, v=v, listing=listing, page=page, sort=sort, t=t,next_exists=next_exists, is_following=is_following, standalone=True)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}userpage_comments.html", u=user, v=v, listing=listing, page=page, sort=sort, t=t,next_exists=next_exists, is_following=is_following, standalone=True)
@app.get("/@<username>/info")
@ -840,7 +893,9 @@ def saved_posts(v, username):
listing = get_posts(ids, v=v)
if request.headers.get("Authorization"): return {"data": [x.json for x in listing]}
else: return render_template("userpage.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}userpage.html",
u=v,
v=v,
listing=listing,
@ -868,7 +923,9 @@ def saved_comments(v, username):
if request.headers.get("Authorization"): return {"data": [x.json for x in listing]}
else: return render_template("userpage_comments.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}userpage_comments.html",
u=v,
v=v,
listing=listing,

View File

@ -15,11 +15,13 @@ defaultcolor = environ.get("DEFAULT_COLOR").strip()
@limiter.limit("5/second;60/minute;200/hour")
@auth_desired
def admin_vote_info_get(v):
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
if v and v.shadowbanned: return render_template('errors/500.html', error=True, v=v), 500
link = request.values.get("link")
if not link: return render_template("votes.html", v=v)
if not link: return render_template(f"{template}votes.html", v=v)
try:
if "t2_" in link: thing = get_post(int(link.split("t2_")[1]), v=v)
@ -55,7 +57,9 @@ def admin_vote_info_get(v):
else: abort(400)
return render_template("votes.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}votes.html",
v=v,
thing=thing,
ups=ups,

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>{{'SITE_NAME' | app_config}}</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>{{'SITE_NAME' | app_config}}</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>API App Administration</title>
@ -43,9 +43,9 @@
</div>
{% if listing %}
{% include "submission_listing.html" %}
{% include "CHRISTMAS/submission_listing.html" %}
{% elif comments %}
{% include "comments.html" %}
{% include "CHRISTMAS/comments.html" %}
{% endif %}
</div>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>API App Administration</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>Grant User Award</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>Badge Grant</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>Banned Domains</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>{{'SITE_NAME' | app_config}}</title>

View File

@ -1,4 +1,4 @@
{% extends "userpage.html" %}
{% extends "CHRISTMAS/userpage.html" %}
{% block adminpanel %}{% endblock %}
{% block pagetype %}userpage{% endblock %}
@ -27,7 +27,7 @@
{% block listing %}
<div class="posts">
{% include "submission_listing.html" %}
{% include "CHRISTMAS/submission_listing.html" %}
</div>
{% endblock %}
</div>

View File

@ -1,9 +1,9 @@
{% extends "mine.html" %}
{% extends "CHRISTMAS/mine.html" %}
{% block maincontent %}
<img loading="lazy" src="{{single_plot}}">
<img loading="lazy" src="{{multi_plot}}">
{% include "user_listing.html" %}
{% include "CHRISTMAS/user_listing.html" %}
{% endblock %}
{% block navbar %}{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "admin/image_posts.html" %}
{% extends "CHRISTMAS/admin/image_posts.html" %}
{% block title %}
@ -33,7 +33,7 @@
<div class="posts">
{% with comments=listing %}
{% include "comments.html" %}
{% include "CHRISTMAS/comments.html" %}
{% endwith %}
{% if not listing %}
<div class="row no-gutters">

View File

@ -1,4 +1,4 @@
{% extends "admin/image_posts.html" %}
{% extends "CHRISTMAS/admin/image_posts.html" %}
{% block title %}
@ -30,7 +30,7 @@
{% block listing %}
<div class="posts">
{% include "submission_listing.html" %}
{% include "CHRISTMAS/submission_listing.html" %}
</div>
{% endblock %}
</div>

View File

@ -1,4 +1,4 @@
{% extends "admin/reported_posts.html" %}
{% extends "CHRISTMAS/admin/reported_posts.html" %}
@ -7,7 +7,7 @@
<div class="posts">
{% with comments=listing %}
{% include "comments.html" %}
{% include "CHRISTMAS/comments.html" %}
{% endwith %}
{% if not listing %}
<div class="row no-gutters">

View File

@ -1,4 +1,4 @@
{% extends "userpage.html" %}
{% extends "CHRISTMAS/userpage.html" %}
{% block adminpanel %}{% endblock %}
{% block pagetype %}userpage{% endblock %}
@ -54,7 +54,7 @@
{% block listing %}
<div class="posts">
{% include "submission_listing.html" %}
{% include "CHRISTMAS/submission_listing.html" %}
</div>
{% endblock %}
</div>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block pagetitle %}Edit {{'SITE_NAME' | app_config}} rules{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "settings2.html" %}
{% extends "CHRISTMAS/settings2.html" %}
{% block pagetitle %}Admins{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "settings2.html" %}
{% extends "CHRISTMAS/settings2.html" %}
{% block content %}
<table class="table table-striped mb-5">

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>{{'SITE_NAME' | app_config}} - API</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block content %}
<pre>

View File

@ -1,4 +1,4 @@
{% extends "settings2.html" %}
{% extends "CHRISTMAS/settings2.html" %}
{% block content %}
<table class="table table-striped mb-5">

View File

@ -1,4 +1,4 @@
{% extends "settings2.html" %}
{% extends "CHRISTMAS/settings2.html" %}
{% block pagetitle %}Blocks{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "settings2.html" %}
{% extends "CHRISTMAS/settings2.html" %}
{% block pagetitle %}Changelog{% endblock %}
@ -77,7 +77,7 @@
<div class="posts" id="posts">
{% include "submission_listing.html" %}
{% include "CHRISTMAS/submission_listing.html" %}
</div>
</div>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>Unable to post comment</title>

View File

@ -1,5 +1,5 @@
{% if v %}
{% include "award_modal.html" %}
{% include "CHRISTMAS/award_modal.html" %}
<script defer src="/assets/CHRISTMAS/js/marked.js?v=202"></script>
<script defer src="/assets/CHRISTMAS/js/comments_v.js?v=200"></script>
{% endif %}
@ -10,7 +10,7 @@
<script defer src="/assets/CHRISTMAS/js/comments.js?v=200"></script>
{% include "expanded_image_modal.html" %}
{% include "CHRISTMAS/expanded_image_modal.html" %}
<script defer>
function poll_vote(cid, parentid) {
@ -347,24 +347,24 @@
<i class="fas fa-reply fa-sm fa-fw mr-1"></i>
Reply
</button>
{% include "/comments/CommentMessageReplyForm.html" %}
{% include "CHRISTMAS/comments/CommentMessageReplyForm.html" %}
{% endif %}
</div>
{% if c.parent_submission %}
<!-- Author's edit comment form -->
{% if v and v.id==c.author_id %}
{% include "/comments/CommentEditForm.html" %}
{% include "CHRISTMAS/comments/CommentEditForm.html" %}
{% endif %}
<!-- Comment actions -->
<div id="comment-{{c.id}}-actions" class="hidden-on-collapse py-3 {% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}">
{% include "/comments/CommentActions.html" %}
{% include "CHRISTMAS/comments/CommentActions.html" %}
</div>
{% endif %}
</div>
<div id="reply-to-{{c.id}}" class="hidden hidden-on-collapse">
{% include "/comments/CommentReplyForm.html" %}
{% include "CHRISTMAS/comments/CommentReplyForm.html" %}
</div>
{% if render_replies %}
@ -395,7 +395,7 @@
{% endif %}
</div>
{% include "/modals/ModalCommentActions.html" %}
{% include "CHRISTMAS/modals/ModalCommentActions.html" %}
</div>
@ -414,10 +414,10 @@
</div>
{% if v %}
{% include "gif_modal.html" %}
{% include "emoji_modal.html" %}
{% include "CHRISTMAS/gif_modal.html" %}
{% include "CHRISTMAS/emoji_modal.html" %}
{% if v.admin_level > 1 %}
{% include "ban_modal.html" %}
{% include "CHRISTMAS/ban_modal.html" %}
{% endif %}
<div class="modal fade" id="deleteCommentModal" tabindex="-1" role="dialog" aria-labelledby="deleteCommentModalTitle" aria-hidden="true">
@ -445,7 +445,7 @@
</div>
</div>
{% include "/modals/ModalReportComment.html" %}
{% include "CHRISTMAS/modals/ModalReportComment.html" %}
{% endif %}
{% if offset %}

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>{{'SITE_NAME' | app_config}} - Contact</title>

View File

@ -222,7 +222,7 @@
{% block Banner %}
{% endblock %}
{% include "header-tw.html" %}
{% include "CHRISTMAS/header-tw.html" %}
{% block mobileUserBanner %}
{% endblock %}
@ -267,7 +267,7 @@
</div>
</div>
{% include "footer.html" %}
{% include "CHRISTMAS/footer.html" %}
</div>
</div>
@ -275,10 +275,10 @@
<div id="formkey" class="hidden">{{ v.formkey }}</div>
{% endif %}
{% include "ProfilePopover.html" %}
{% include "CHRISTMAS/ProfilePopover.html" %}
{% block mobilenavbar %}
{% include "mobile_navigation_bar.html" %}
{% include "CHRISTMAS/mobile_navigation_bar.html" %}
{% endblock %}
{% block actionsModal %}
@ -295,7 +295,7 @@
<!-- Import toast notifications -->
{% include "/toasts/toasts.html" %}
{% include "CHRISTMAS/toasts/toasts.html" %}
{% block modals %}
{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "email/default.html" %}
{% extends "CHRISTMAS/email/default.html" %}
{% block title %}Remove Two-Factor Authentication{% endblock %}</h1>

View File

@ -1,4 +1,4 @@
{% extends "email/default.html" %}
{% extends "CHRISTMAS/email/default.html" %}
{% block title %}Verify Your Email{% endblock %}</h1>

View File

@ -1,4 +1,4 @@
{% extends "email/default.html" %}
{% extends "CHRISTMAS/email/default.html" %}
{% block title %}Welcome to {{'SITE_NAME' | app_config}}!{% endblock %}</h1>

View File

@ -1,4 +1,4 @@
{% extends "email/default.html" %}
{% extends "CHRISTMAS/email/default.html" %}
{% block title %}Reset Your Password{% endblock %}
{% block preheader %}Reset your {{'SITE_NAME' | app_config}} password.{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block content %}
<pre>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>400 Bad Request</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>401 Not Authorized</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>403 Forbidden</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>404 Page Not Found</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>405 Method Not Allowed</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>429 Too Many Requests</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>500 Internal Server Error</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>+18</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>401 Not Authorized</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block content %}
<div class="col-span-full">
<pre>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block content %}
<div class="col-span-full my-4">
<h5>Users followed by @{{u.username}}</h5>

View File

@ -1,4 +1,4 @@
{% extends "authforms.html" %}
{% extends "CHRISTMAS/authforms.html" %}
{% block pagetitle %}{{'SITE_NAME' | app_config}} Password Reset{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "settings2.html" %}
{% extends "CHRISTMAS/settings2.html" %}
{% block title %}
<title>{{'SITE_NAME' | app_config}} - Formatting</title>
<meta name="description" content="{{'SITE_NAME' | app_config}} Formatting">
@ -514,6 +514,6 @@ line breaks
</tbody>
</table>
{% include "expanded_image_modal.html" %}
{% include "CHRISTMAS/expanded_image_modal.html" %}
{% endblock %}

View File

@ -62,7 +62,7 @@
Leaderboard
</a>
{% include "/dropdowns/NavbarExtraLinks.html" %}
{% include "CHRISTMAS/dropdowns/NavbarExtraLinks.html" %}
<a href="/shop" class="hidden xl:flex items-center relative px-3 py-2.5 rounded text-sm text-yellow-500 leading-normal {{ 'font-bold text-shadow' if request.path == '/shop' else 'font-medium' }}">
<img src="https://i.ibb.co/xFgG6yf/Coinfixed.gif" width="15px" height="12px" class="object-contain mr-2.5"/>
@ -77,7 +77,7 @@
{% if v %}
<!-- Profile dropdown -->
<div class="ml-3 relative hidden sm:block">
{% include "/dropdowns/NavbarProfile.html" %}
{% include "CHRISTMAS/dropdowns/NavbarProfile.html" %}
</div>
{% if v.admin_level > 1 %}
<!-- Admin link -->

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block subHeader %}
<div class="relative max-w-screen-2xl mx-auto px-4 py-4 grid grid-cols-12 rounded-t">
@ -15,7 +15,7 @@
</small>
</div>
<div class="ml-auto">
{% include "/dropdowns/SubmissionSorts.html" %}
{% include "CHRISTMAS/dropdowns/SubmissionSorts.html" %}
</div>
</div>
</div>
@ -28,7 +28,7 @@
<div class="col-span-full xl:col-span-9">
<ul class="flex flex-col sm:py-4 my-2.5 sm:my-0" id="posts">
{% include "submission_listing.html" %}
{% include "CHRISTMAS/submission_listing.html" %}
</ul>
{% if listing %}
@ -57,12 +57,12 @@
<!-- Sidebar -->
{% block sidebar %}
{% include "/sidebars/HomeSidebar.html" %}
{% include "CHRISTMAS/sidebars/HomeSidebar.html" %}
{% endblock %}
{% block modals %}
{% if v %}
{% include "award_modal.html" %}
{% include "CHRISTMAS/award_modal.html" %}
{% endif %}
{% if v.agendaposter %}

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block subHeader %}
<div class="relative max-w-screen-2xl mx-auto px-4 py-4 grid grid-cols-12 rounded-t">
@ -15,7 +15,7 @@
</small>
</div>
<div class="ml-auto">
{% include "/dropdowns/SubmissionSorts.html" %}
{% include "CHRISTMAS/dropdowns/SubmissionSorts.html" %}
</div>
</div>
</div>
@ -24,7 +24,7 @@
{% block content %}
<!-- Comments list -->
<div class="col-span-full px-2.5 md:px-0" id="posts">
{% include "comments.html" %}
{% include "CHRISTMAS/comments.html" %}
</div>
<!-- Pagination -->
<div class="col-span-full">

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block pagetitle %}Leaderboard{% endblock %}
@ -328,7 +328,7 @@
{% block modals %}
<div class="frost"></div>
{% include '/awards/Christmas/Snow.html' %}
{% include 'CHRISTMAS//awards/Christmas/Snow.html' %}
{% endblock %}
{% block scripts %}

View File

@ -1,4 +1,4 @@
{% extends "settings2.html" %}
{% extends "CHRISTMAS/settings2.html" %}
{% block pagetitle %}Moderation Log{% endblock %}

View File

@ -94,7 +94,7 @@
</div>
{% include '/awards/Christmas/Snow.html' %}
{% include 'CHRISTMAS//awards/Christmas/Snow.html' %}
</div>

View File

@ -1,4 +1,4 @@
{% extends "authforms.html" %}
{% extends "CHRISTMAS/authforms.html" %}
{% block pagetitle %}{{'SITE_NAME' | app_config}} Two-Factor Removal{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>{{title}}</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>{{title}}</title>

View File

@ -1,4 +1,4 @@
{% extends "home.html" %}
{% extends "CHRISTMAS/home.html" %}
{% block PseudoSubmitForm %}{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block content %}
<pre>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>Not configured</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block fixedMobileBarJS %}{% endblock %}
@ -56,7 +56,7 @@
<div class="col-span-full px-2.5 md:px-0">
{% with comments=notifications %}
{% include "comments.html" %}
{% include "CHRISTMAS/comments.html" %}
{% endwith %}
</div>

View File

@ -1,4 +1,4 @@
{% extends "login.html" %}
{% extends "CHRISTMAS/login.html" %}
{% block title %}
<title>Application Request for Access</title>

View File

@ -1,4 +1,4 @@
{% extends "settings2.html" %}
{% extends "CHRISTMAS/settings2.html" %}
{% block content %}
<table class="table table-striped mb-5">

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block content %}
<pre></pre>
<h5>Rentoids</h5>

View File

@ -1,4 +1,4 @@
{% extends "authforms.html" %}
{% extends "CHRISTMAS/authforms.html" %}
{% block pagetitle %}{{'SITE_NAME' | app_config}} Password Reset{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>{{'SITE_NAME' | app_config}} Rules</title>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block pagetype %}search{% endblock %}
@ -46,7 +46,7 @@
</div>
{% if not '/users/' in request.path %}
<div class="ml-auto pl-3 md:pl-0">
{% include "/dropdowns/SearchSorts.html" %}
{% include "CHRISTMAS/dropdowns/SearchSorts.html" %}
</div>
{% endif %}
</div>
@ -65,7 +65,7 @@
<div class="col-span-full px-4 md:px-0">
<div class="posts" id="posts">
{% block listing_template %}
{% include "submission_listing.html" %}
{% include "CHRISTMAS/submission_listing.html" %}
{% endblock %}
</div>
</div>

View File

@ -1,9 +1,9 @@
{% extends "search.html" %}
{% extends "CHRISTMAS/search.html" %}
{% block listing_template %}
<div class="posts p-3 p-md-0">
{% with comments=comments %}
{% include "comments.html" %}
{% include "CHRISTMAS/comments.html" %}
{% endwith %}
</div>
{% endblock %}

View File

@ -1,8 +1,8 @@
{% extends "search.html" %}
{% extends "CHRISTMAS/search.html" %}
{% block listing_template %}
<div class="flex flex-wrap -mx-2 overflow-hidden">
{% include "user_listing.html" %}
{% include "CHRISTMAS/user_listing.html" %}
</div>
{% endblock %}

View File

@ -60,7 +60,7 @@
<body class="overflow-hidden overflow-y-auto sm:overflow-y-none antialiased bg-cover bg-center bg-gray-500 text-gray-900" {% if v and v.background %}style="background:url(/assets/CHRISTMAS/images/backgrounds/{{v.background}})"{% endif %}>
{% include "header-tw.html" %}
{% include "CHRISTMAS/header-tw.html" %}
<div class="flex h-screen pt-16 bg-gray-500">
<div class="w-full sm:overflow-y-auto">
@ -144,12 +144,12 @@
{% endblock %}
</div>
{% include "/sidebars/SettingsSidebar.html" %}
{% include "CHRISTMAS/sidebars/SettingsSidebar.html" %}
</div>
</div>
{% include "footer.html" %}
{% include "CHRISTMAS/footer.html" %}
</div>
</div>
@ -177,7 +177,7 @@
{% endif %}
{% if v %}
{% include "/modals/Modal2FA.html" %}
{% include "CHRISTMAS/modals/Modal2FA.html" %}
{% endif %}
{% block modals %}{% endblock %}

View File

@ -49,7 +49,7 @@
<body id="settings2" style="overflow-x: hidden; {% if v and v.background %} background:url(/assets/CHRISTMAS/images/backgrounds/{{v.background}}) no-repeat center center fixed !important; background-size: cover!important; background-color: #000!important;{% endif %}">
{% include "header.html" %}
{% include "CHRISTMAS/header.html" %}
{% block subNav %}
@ -150,7 +150,7 @@
</div>
{% block mobilenavbar %}
{% include "mobile_navigation_bar.html" %}
{% include "CHRISTMAS/mobile_navigation_bar.html" %}
{% endblock %}
{% block invitationModal %}

View File

@ -1,4 +1,4 @@
{% extends "settings.html" %}
{% extends "CHRISTMAS/settings.html" %}
{% block title %}
<title>{{'SITE_NAME' | app_config}} - FAQ</title>

View File

@ -1,4 +1,4 @@
{% extends "settings.html" %}
{% extends "CHRISTMAS/settings.html" %}
{% block pagetitle %}Block Settings - {{'SITE_NAME' | app_config}}{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "settings.html" %}
{% extends "CHRISTMAS/settings.html" %}
{% block pagetitle %}Custom CSS - {{'SITE_NAME' | app_config}}{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "settings.html" %}
{% extends "CHRISTMAS/settings.html" %}
{% block pagetitle %}Profile Settings - {{'SITE_NAME' | app_config}}{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "settings.html" %}
{% extends "CHRISTMAS/settings.html" %}
{% block pagetitle %}Profile Settings - {{'SITE_NAME' | app_config}}{% endblock %}
@ -8,6 +8,13 @@
<!-- Avatar section -->
<div class="rounded-lg divide-y divide-gray-300 bg-gray-100 border border-gray-300 shadow-inset-t-white-10">
<div class="px-4 py-4">
<h2 class="label text-black">Use Old Site</h2>
<div class="mb-4">
<input type="checkbox" id="oldsite" name="oldsite"{% if v.oldsite%} checked{% endif %} onchange="post_toast('/settings/profile?oldsite='+document.getElementById('oldsite').checked);location.reload(true)">
<label for="oldsite" class="inline-block pl-2 text-gray-400">Use the old version of the site.</label>
</div>
<h2 class="label text-black">Avatar</h2>
<div class="flex flex-col md:flex-row gap-3">
<!-- Avatar -->
@ -400,8 +407,8 @@
{% endblock %}
{% block modals %}
{% include "emoji_modal.html" %}
{% include "gif_modal.html" %}
{% include "CHRISTMAS/emoji_modal.html" %}
{% include "CHRISTMAS/gif_modal.html" %}
{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "settings.html" %}
{% extends "CHRISTMAS/settings.html" %}
{% block pagetitle %}Custom profilecss - {{'SITE_NAME' | app_config}}{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "settings.html" %}
{% extends "CHRISTMAS/settings.html" %}
{% block pagetitle %}Security Settings - {{'SITE_NAME' | app_config}}{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "settings2.html" %}
{% extends "CHRISTMAS/settings2.html" %}
{% block content %}
<table class="table table-striped mb-5">

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block title %}
<title>Shop</title>
@ -145,7 +145,7 @@
{% block modals %}
<div class="frost"></div>
{% include '/awards/Christmas/Snow.html' %}
{% include 'CHRISTMAS//awards/Christmas/Snow.html' %}
{% endblock %}
{% block scripts %}

View File

@ -150,7 +150,7 @@
</div>
{% include '/awards/Christmas/Snow.html' %}
{% include 'CHRISTMAS//awards/Christmas/Snow.html' %}
</div>

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% set ups=p.upvotes %}
{% set downs=p.downvotes %}
@ -367,12 +367,12 @@
<!-- Polls -->
{% if p.options.count() %}
{% include "Poll.html" %}
{% include "CHRISTMAS/Poll.html" %}
{% endif %}
<!-- Bets -->
{% if p.bet_options.count() %}
{% include "Bets.html" %}
{% include "CHRISTMAS/Bets.html" %}
{% endif %}
</div>
@ -405,7 +405,7 @@
{% if v and (v.id==p.author_id or v.admin_level > 1 and v.admin_level > 2) %}
<div class="py-2">
{% include "/submission/SubmissionEditForm.html" %}
{% include "CHRISTMAS/submission/SubmissionEditForm.html" %}
</div>
{% endif %}
@ -425,7 +425,7 @@
<!-- Post actions -->
<div class="hidden md:block pt-4">
{% include "/submission/SubmissionActions.html" %}
{% include "CHRISTMAS/submission/SubmissionActions.html" %}
</div>
</div>
@ -472,7 +472,7 @@
</div>
<div class="md:hidden px-2.5 mt-4">
{% include "/submission/SubmissionActionsMobile.html" %}
{% include "CHRISTMAS/submission/SubmissionActionsMobile.html" %}
</div>
</div>
@ -534,7 +534,7 @@
<div class="hidden md:block relative flex-shrink-0 mr-4 {{ 'santa' if p.author.patron else 'cap' }}">
<img loading="lazy" src="{{v.profile_url}}" class="w-14 h-14 p-[3px] bg-white border border-gray-300 object-cover" alt="my avatar"/>
</div>
{% include "/comments/CommentForm.html" %}
{% include "CHRISTMAS/comments/CommentForm.html" %}
</div>
{% endif %}
@ -557,7 +557,7 @@
{% if p.replies %}
<div class="comment-section px-2.5 md:px-0" id="comment-section">
{% with comments=p.replies %}
{% include "comments.html" %}
{% include "CHRISTMAS/comments.html" %}
{% endwith %}
</div>
{% elif not p.replies and p.deleted_utc == 0 %}
@ -587,32 +587,32 @@
<!-- Sidebar -->
{% block sidebar %}
{% include "/sidebars/SubmissionSidebar.html" %}
{% include "CHRISTMAS/sidebars/SubmissionSidebar.html" %}
{% endblock %}
{% block modals %}
{% if v %}
{% if v.id == p.author_id %}
{% include "delete_post_modal.html" %}
{% include "CHRISTMAS/delete_post_modal.html" %}
{% endif %}
{% include "report_post_modal.html" %}
{% include "award_modal.html" %}
{% include "emoji_modal.html" %}
{% include "gif_modal.html" %}
{% include "CHRISTMAS/report_post_modal.html" %}
{% include "CHRISTMAS/award_modal.html" %}
{% include "CHRISTMAS/emoji_modal.html" %}
{% include "CHRISTMAS/gif_modal.html" %}
{% if v.admin_level == 6 %}
{% include "ban_modal.html" %}
{% include "CHRISTMAS/ban_modal.html" %}
{% endif %}
{% endif %}
{% include "/modals/ModalSubmissionActions.html" %}
{% include "expanded_image_modal.html" %}
{% include "CHRISTMAS/modals/ModalSubmissionActions.html" %}
{% include "CHRISTMAS/expanded_image_modal.html" %}
{% endblock %}
{% block scripts %}
<!-- This file contains minimal html and javascript required for awards, needs to be near </body> closing tag -->
{% include "/submission/SubmissionAwards.html" %}
{% include "CHRISTMAS/submission/SubmissionAwards.html" %}
{% if v %}
<script defer src="/assets/CHRISTMAS/js/vote.js?v=200"></script>

View File

@ -1,6 +1,6 @@
<!-- Train award -->
{% if p.award_count("train") %}
{% include "/awards/Christmas/Sleighs.html" %}
{% include "CHRISTMAS/awards/Christmas/Sleighs.html" %}
{% endif %}
<!-- Poop award -->
@ -39,13 +39,13 @@
<!-- Ginger Marsey award -->
{% if p.award_count("gingerbread") %}
{% include "/awards/Christmas/Gingerbread.html" %}
{% include "CHRISTMAS/awards/Christmas/Gingerbread.html" %}
{% endif %}
<!-- Snow award -->
{% if p.award_count("snow") %}
{% include "/awards/Christmas/Snow.html" %}
{% include "CHRISTMAS/awards/Christmas/Snow.html" %}
{% if p.award_count("snow") > 5 %}
<div class="frost"></div>
{% endif %}
@ -143,6 +143,6 @@
<!-- Fireplace award -->
{% if p.award_count("fireplace")%}
{% include "/awards/Christmas/Fireplace.html" %}
{% include "CHRISTMAS/awards/Christmas/Fireplace.html" %}
{% endif %}

View File

@ -1,4 +1,4 @@
{% extends "submission.html" %}
{% extends "CHRISTMAS/submission.html" %}
{% set score=p.score %}
{% if v %}
@ -99,7 +99,7 @@
<div class="comment-section">
{% with comments=p.replies %}
{% include "comments.html" %}
{% include "CHRISTMAS/comments.html" %}
{% endwith %}
</div>

View File

@ -1,5 +1,5 @@
{% if v %}
{% include "award_modal.html" %}
{% include "CHRISTMAS/award_modal.html" %}
{% endif %}
{% for p in listing %}
@ -242,7 +242,7 @@
{% endif %}
<div class="relative z-20 hidden md:block pt-3">
{% include "/submission/SubmissionActions.html" %}
{% include "CHRISTMAS/submission/SubmissionActions.html" %}
</div>
</div>
@ -273,10 +273,10 @@
</div>
<div class="relative z-10 md:hidden pt-3">
{% include "/submission/SubmissionActionsMobile.html" %}
{% include "CHRISTMAS/submission/SubmissionActionsMobile.html" %}
</div>
{% include "/modals/ModalSubmissionActions.html" %}
{% include "CHRISTMAS/modals/ModalSubmissionActions.html" %}
{% if p.is_image and not p.over_18 and ((v and v.cardview) or (not v and environ.get('CARD_VIEW') == '1')) %}
<div class="md:ml-[4.5rem] mt-4">
@ -371,14 +371,14 @@
{% endfor %}
{% if v %}
{% include "delete_post_modal.html" %}
{% include "report_post_modal.html" %}
{% include "CHRISTMAS/delete_post_modal.html" %}
{% include "CHRISTMAS/report_post_modal.html" %}
{% if v.admin_level == 6 %}
{% include "ban_modal.html" %}
{% include "CHRISTMAS/ban_modal.html" %}
{% endif %}
{% endif %}
{% include "expanded_image_modal.html" %}
{% include "CHRISTMAS/expanded_image_modal.html" %}
<script defer src="/assets/CHRISTMAS/js/new_comments_count.js?v=200"></script>
<script defer src="/assets/CHRISTMAS/js/submission_listing.js?v=201"></script>

View File

@ -2,7 +2,7 @@
<title>Create a post - {{'SITE_NAME' | app_config}}</title>
{% endblock %}
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block subHeader %}
<div class="relative max-w-screen-2xl mx-auto px-4 py-4 grid grid-cols-12 rounded-t">
@ -156,13 +156,13 @@
{% endblock %}
{% block sidebar %}
{% include '/sidebars/SubmitSidebar.html' %}
{% include 'CHRISTMAS//sidebars/SubmitSidebar.html' %}
{% endblock %}
{% block modals %}
{% include "emoji_modal.html" %}
{% include "gif_modal.html" %}
{% include '/awards/Christmas/Snow.html' %}
{% include "CHRISTMAS/emoji_modal.html" %}
{% include "CHRISTMAS/gif_modal.html" %}
{% include 'CHRISTMAS//awards/Christmas/Snow.html' %}
{% endblock %}
{% block scripts %}

View File

@ -1,4 +1,4 @@
{% extends "default.html" %}
{% extends "CHRISTMAS/default.html" %}
{% block content %}
<pre></pre>
<h5>Successful thiefs</h5>

Some files were not shown because too many files have changed in this diff Show More