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 from werkzeug.middleware.proxy_fix import ProxyFix
import redis import redis
if int(environ.get("CHRISTMAS", 0)): templates = 'templates/CHRISTMAS' app = Flask(__name__, template_folder='templates')
else: templates = 'templates'
app = Flask(__name__, template_folder=templates)
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=3) app.wsgi_app = ProxyFix(app.wsgi_app, x_for=3)
app.url_map.strict_slashes = False app.url_map.strict_slashes = False

View File

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

View File

@ -20,7 +20,9 @@ def post_embed(id, v):
p = get_post(id, v, graceful=True) 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 @app.context_processor
def inject_constants(): def inject_constants():

View File

@ -61,7 +61,9 @@ def activate(v):
token = request.values.get("token", "").strip() token = request.values.get("token", "").strip()
if int(time.time()) - timestamp > 3600: 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 message="That link has expired. Visit your settings to send yourself another verification email."), 410
if not validate_hash(f"{email}+{id}+{timestamp}", token): if not validate_hash(f"{email}+{id}+{timestamp}", token):
@ -72,7 +74,9 @@ def activate(v):
abort(404) abort(404)
if user.is_activated and user.email == email: 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 title="Email already verified.", message="Email already verified."), 404
user.email = email user.email = email
@ -86,4 +90,6 @@ def activate(v):
g.db.add(user) g.db.add(user)
g.db.commit() 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) @admin_level_required(2)
def truescore(v): def truescore(v):
users = g.db.query(User).order_by(User.truecoins.desc()).limit(25).all() 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") @app.post("/@<username>/revert_actions")
@limiter.limit("1/second") @limiter.limit("1/second")
@ -252,7 +254,9 @@ def post_rules(v):
def shadowbanned(v): def shadowbanned(v):
if not (v and v.admin_level > 1): abort(404) if not (v and v.admin_level > 1): abort(404)
users = [x for x in g.db.query(User).filter(User.shadowbanned != None).all()] 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") @app.get("/admin/agendaposters")
@ -260,7 +264,9 @@ def shadowbanned(v):
def agendaposters(v): def agendaposters(v):
if not (v and v.admin_level > 1): abort(404) if not (v and v.admin_level > 1): abort(404)
users = [x for x in g.db.query(User).filter_by(agendaposter = True).all()] 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") @app.get("/admin/image_posts")
@ -278,7 +284,9 @@ def image_posts_listing(v):
next_exists = (len(posts) > 25) next_exists = (len(posts) > 25)
posts = get_posts(posts[:25], v=v) 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") @app.get("/admin/reported/posts")
@ -298,7 +306,9 @@ def reported_posts(v):
listing = get_posts(listing, v=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) next_exists=next_exists, listing=listing, page=page, v=v)
@ -320,7 +330,9 @@ def reported_comments(v):
listing = get_comments(listing, v=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, next_exists=next_exists,
listing=listing, listing=listing,
page=page, page=page,
@ -332,7 +344,9 @@ def reported_comments(v):
def admin_home(v): def admin_home(v):
with open('disablesignups', 'r') as f: with open('disablesignups', 'r') as f:
x = f.read() 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") @app.post("/admin/disablesignups")
@admin_level_required(2) @admin_level_required(2)
@ -356,7 +370,9 @@ def badge_grant_get(v):
"no_user": "That user doesn't exist." "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, v=v,
badge_types=BADGES, badge_types=BADGES,
error=errors.get( error=errors.get(
@ -422,7 +438,9 @@ def users_list(v):
next_exists = (len(users) > 25) next_exists = (len(users) > 25)
users = 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, v=v,
users=users, users=users,
next_exists=next_exists, next_exists=next_exists,
@ -434,7 +452,9 @@ def users_list(v):
def alt_votes_get(v): def alt_votes_get(v):
if not request.values.get("u1") or not request.values.get("u2"): 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") u1 = request.values.get("u1")
u2 = request.values.get("u2") u2 = request.values.get("u2")
@ -530,7 +550,9 @@ def alt_votes_get(v):
data['u2_only_comment_downs'] // len( data['u2_only_comment_downs'] // len(
u2_comment_downs) if u2_comment_downs else 0 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, u1=u1,
u2=u2, u2=u2,
v=v, v=v,
@ -575,7 +597,9 @@ def admin_removed(v):
posts = get_posts(ids, v=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, v=v,
listing=posts, listing=posts,
page=page, page=page,
@ -599,7 +623,9 @@ def admin_removed_comments(v):
comments = get_comments(ids, v=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, v=v,
listing=comments, listing=comments,
page=page, page=page,
@ -1106,7 +1132,9 @@ def admin_dump_cache(v):
def admin_banned_domains(v): def admin_banned_domains(v):
banned_domains = g.db.query(BannedDomain).all() 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") @app.post("/admin/banned_domains")
@limiter.limit("1/second") @limiter.limit("1/second")

View File

@ -69,7 +69,9 @@ def shop(v):
val["price"] = int(val["price"]*discount) 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() 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>") @app.post("/buy/<award>")
@ -503,15 +505,21 @@ def award_comment(cid, v):
@app.get("/admin/awards") @app.get("/admin/awards")
@admin_level_required(2) @admin_level_required(2)
def admin_userawards_get(v): 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) if v.admin_level != 3:
return render_template("admin/awards.html", awards=list(AWARDS.values()), v=v) 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") @app.post("/admin/awards")
@limiter.limit("1/second") @limiter.limit("1/second")
@admin_level_required(2) @admin_level_required(2)
@validate_formkey @validate_formkey
def admin_userawards_post(v): def admin_userawards_post(v):
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
try: u = request.values.get("username").strip() try: u = request.values.get("username").strip()
except: abort(404) except: abort(404)
@ -551,5 +559,5 @@ def admin_userawards_post(v):
g.db.commit() g.db.commit()
if v.admin_level != 3: return render_template("admin/awards.html", awards=list(AWARDS3.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("admin/awards.html", awards=list(AWARDS.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() g.db.commit()
if request.headers.get("Authorization"): return c.json 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 ban.reason: reason += f" {ban.reason}"
if request.headers.get("Authorization"): return {'error': f'A blacklisted domain was used.'}, 400 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}", action=f"/edit_comment/{c.id}",
badlinks=[x.domain for x in bans], badlinks=[x.domain for x in bans],
body=body, body=body,

View File

@ -98,7 +98,9 @@ def discord_redirect(v):
requests.delete(url, headers=headers, timeout=5) requests.delete(url, headers=headers, timeout=5)
if g.db.query(User).filter(User.id!=v.id, User.discord_id==x["id"]).first(): 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"] v.discord_id=x["id"]
g.db.add(v) 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]} 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, v=v,
notifications=listing, notifications=listing,
next_exists=next_exists, next_exists=next_exists,
@ -190,7 +192,9 @@ def front_all(v):
g.db.commit() g.db.commit()
if request.headers.get("Authorization"): return {"data": [x.json for x in posts], "next_exists": next_exists} 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) posts = get_posts(ids, v=v)
if request.headers.get("Authorization"): return {"data": [x.json for x in posts], "next_exists": next_exists} 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) @cache.memoize(timeout=86400)
@ -441,4 +447,6 @@ def all_comments(v):
idlist = idlist[:25] idlist = idlist[:25]
if request.headers.get("Authorization"): return {"data": [x.json for x in comments]} 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: if v:
return redirect(redir) 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, failed=False,
redirect=redir) redirect=redir)
@ -89,19 +91,25 @@ def login_post():
if not account: if not account:
time.sleep(random.uniform(0, 2)) 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 request.values.get("password"):
if not account.verifyPass(request.values.get("password")): if not account.verifyPass(request.values.get("password")):
time.sleep(random.uniform(0, 2)) 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: if account.mfa_secret:
now = int(time.time()) now = int(time.time())
hash = generate_hash(f"{account.id}+{now}+2fachallenge") 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, v=account,
time=now, time=now,
hash=hash, hash=hash,
@ -121,7 +129,9 @@ def login_post():
if not account.validate_2fa(request.values.get("2fa_token", "").strip()): if not account.validate_2fa(request.values.get("2fa_token", "").strip()):
hash = generate_hash(f"{account.id}+{time}+2fachallenge") 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, v=account,
time=now, time=now,
hash=hash, hash=hash,
@ -187,7 +197,9 @@ def sign_up_get(v):
ref_user = None ref_user = None
if ref_user and (ref_user.id in session.get("history", [])): 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()) now = int(time.time())
token = token_hex(16) token = token_hex(16)
@ -204,7 +216,9 @@ def sign_up_get(v):
error = request.values.get("error", None) 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, formkey=formkey,
now=now, now=now,
redirect=redir, redirect=redir,
@ -363,7 +377,9 @@ def sign_up_post(v):
@app.get("/forgot") @app.get("/forgot")
def 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) 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.") 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()) now = int(time.time())
if now - timestamp > 600: 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", title="Password reset link expired",
error="That password reset link has 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}") 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, v=user,
token=reset_token, token=reset_token,
time=timestamp, time=timestamp,
@ -454,7 +476,9 @@ def post_reset(v):
now = int(time.time()) now = int(time.time())
if now - timestamp > 600: 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", title="Password reset expired",
error="That password reset form has expired.") error="That password reset form has expired.")
@ -466,7 +490,9 @@ def post_reset(v):
abort(404) abort(404)
if not password == confirm_password: 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, v=user,
token=token, token=token,
time=timestamp, time=timestamp,
@ -477,7 +503,9 @@ def post_reset(v):
g.db.commit() 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!", title="Password reset successful!",
message="Login normally to access your account.") message="Login normally to access your account.")
@ -498,7 +526,9 @@ def request_2fa_disable():
username=request.values.get("username") username=request.values.get("username")
user=get_user(username, graceful=True) user=get_user(username, graceful=True)
if not user or not user.email or not user.mfa_secret: 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", title="Removal request received",
message="If username, password, and email match, we will send you an email.") 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=email.replace('.','').replace('_','')
email=f"{email}@gmail.com" email=f"{email}@gmail.com"
if email != user.email: 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", title="Removal request received",
message="If username, password, and email match, we will send you an email.") message="If username, password, and email match, we will send you an email.")
password =request.values.get("password") password =request.values.get("password")
if not user.verifyPass(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", title="Removal request received",
message="If username, password, and email match, we will send you an email.") message="If username, password, and email match, we will send you an email.")
@ -533,7 +567,9 @@ def request_2fa_disable():
v=user) 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", title="Removal request received",
message="If username, password, and email match, we will send you an email.") 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")) t=int(request.values.get("t"))
if now > t+3600*24: 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", title="Expired Link",
error="That link has expired.") error="That link has expired.")
@ -562,6 +600,8 @@ def reset_2fa():
g.db.commit() 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.", title="Two-factor authentication removed.",
message="Login normally to access your account.") message="Login normally to access your account.")

View File

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

View File

@ -81,7 +81,9 @@ def publish(pid, v):
@auth_required @auth_required
def submit_get(v): 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) v=v)
@app.get("/post/<pid>") @app.get("/post/<pid>")
@ -214,7 +216,9 @@ def post_id(pid, anything=None, v=None):
g.db.add(post) 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.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 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() g.db.commit()
if request.headers.get("Authorization"): return post.json 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 if len(comments) == len(comments2): offset = None
comments = comments2 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>") @app.post("/morecomments/<cid>")
@ -365,7 +371,9 @@ def morecomments(v, cid):
c = g.db.query(Comment).filter_by(id=cid).first() c = g.db.query(Comment).filter_by(id=cid).first()
comments = c.replies 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>") @app.post("/edit_post/<pid>")
@limiter.limit("1/second") @limiter.limit("1/second")
@ -778,7 +786,9 @@ def submit_post(v):
domain_obj = get_domain(domain) domain_obj = get_domain(domain)
if domain_obj: if domain_obj:
if request.headers.get("Authorization"): return {"error":domain_obj.reason}, 400 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: elif "twitter.com" == domain:
try: embed = requests.get("https://publish.twitter.com/oembed", timeout=5, params={"url":url, "omit_script":"t"}).json()["html"] try: embed = requests.get("https://publish.twitter.com/oembed", timeout=5, params={"url":url, "omit_script":"t"}).json()["html"]
except: embed = None 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 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 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 not title:
if request.headers.get("Authorization"): return {"error": "Please enter a better title"}, 400 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: elif len(title) > 500:
@ -893,12 +907,16 @@ def submit_post(v):
if len(str(body)) > 10000: if len(str(body)) > 10000:
if request.headers.get("Authorization"): return {"error":"10000 character limit for text body."}, 400 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 len(url) > 2048:
if request.headers.get("Authorization"): return {"error":"2048 character limit for URLs."}, 400 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): 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)})') 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}" body += f"\n\n{url}"
else: else:
if request.headers.get("Authorization"): return {"error": f"Image/Video files only"}, 400 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))) 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." reason = f"Remove the {ban.domain} link from your post and try again."
if ban.reason: reason += f" {ban.reason}" if ban.reason: reason += f" {ban.reason}"
if request.headers.get("Authorization"): return {"error": reason}, 403 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","")) if not v.club_banned: club = bool(request.values.get("club",""))
else: club = False else: club = False
@ -1012,7 +1034,9 @@ def submit_post(v):
if not file.content_type.startswith(('image/', 'video/')): if not file.content_type.startswith(('image/', 'video/')):
if request.headers.get("Authorization"): return {"error": f"File type not allowed"}, 400 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/'): if file.content_type.startswith('image/'):
name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp' name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp'

View File

@ -161,7 +161,9 @@ def searchposts(v):
domain_obj=None domain_obj=None
if request.headers.get("Authorization"): return {"total":total, "data":[x.json for x in posts]} 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, v=v,
query=query, query=query,
total=total, total=total,
@ -250,7 +252,9 @@ def searchcomments(v):
comments = get_comments(ids, v=v) comments = get_comments(ids, v=v)
if request.headers.get("Authorization"): return {"total":total, "data":[x.json for x in comments]} 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") @app.get("/search/users")
@ -279,4 +283,6 @@ def searchusers(v):
if request.headers.get("Authorization"): return [x.json for x in users] 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 updated = True
v.oldreddit = request.values.get("oldreddit", None) == '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: elif request.values.get("teddit", v.teddit) != v.teddit:
updated = True updated = True
v.teddit = request.values.get("teddit", None) == 'true' v.teddit = request.values.get("teddit", None) == 'true'
@ -122,28 +126,36 @@ def settings_profile_post(v):
v.bio_html = None v.bio_html = None
g.db.add(v) g.db.add(v)
g.db.commit() 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") == "": elif request.values.get("sig") == "":
v.sig = None v.sig = None
v.sig_html = None v.sig_html = None
g.db.add(v) g.db.add(v)
g.db.commit() 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") == "": elif request.values.get("friends") == "":
v.friends = None v.friends = None
v.friends_html = None v.friends_html = None
g.db.add(v) g.db.add(v)
g.db.commit() 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") == "": elif request.values.get("enemies") == "":
v.enemies = None v.enemies = None
v.enemies_html = None v.enemies_html = None
g.db.add(v) g.db.add(v)
g.db.commit() 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"): elif (v.patron or v.id == 1904) and request.values.get("sig"):
sig = request.values.get("sig")[:200] sig = request.values.get("sig")[:200]
@ -165,7 +177,9 @@ def settings_profile_post(v):
return {"error": reason}, 401 return {"error": reason}, 401
if len(sig_html) > 1000: 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, v=v,
error="Your sig is too long") error="Your sig is too long")
@ -173,7 +187,9 @@ def settings_profile_post(v):
v.sig_html=sig_html v.sig_html=sig_html
g.db.add(v) g.db.add(v)
g.db.commit() 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, v=v,
msg="Your sig has been updated.") msg="Your sig has been updated.")
@ -197,7 +213,9 @@ def settings_profile_post(v):
return {"error": reason}, 401 return {"error": reason}, 401
if len(friends_html) > 2000: 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, v=v,
error="Your friends list is too long") error="Your friends list is too long")
@ -216,7 +234,9 @@ def settings_profile_post(v):
v.friends_html=friends_html v.friends_html=friends_html
g.db.add(v) g.db.add(v)
g.db.commit() 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, v=v,
msg="Your friends list has been updated.") msg="Your friends list has been updated.")
@ -238,7 +258,9 @@ def settings_profile_post(v):
return {"error": reason}, 401 return {"error": reason}, 401
if len(enemies_html) > 2000: 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, v=v,
error="Your enemies list is too long") error="Your enemies list is too long")
@ -258,7 +280,9 @@ def settings_profile_post(v):
v.enemies_html=enemies_html v.enemies_html=enemies_html
g.db.add(v) g.db.add(v)
g.db.commit() 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, v=v,
msg="Your enemies list has been updated.") msg="Your enemies list has been updated.")
@ -283,14 +307,18 @@ def settings_profile_post(v):
bio += f"\n\n{url}" bio += f"\n\n{url}"
else: else:
if request.headers.get("Authorization"): return {"error": f"Image/Video files only"}, 400 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 = CustomRenderer().render(mistletoe.Document(bio))
bio_html = sanitize(bio_html) bio_html = sanitize(bio_html)
bans = filter_comment_html(bio_html) bans = filter_comment_html(bio_html)
if len(bio_html) > 10000: 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, v=v,
error="Your bio is too long") error="Your bio is too long")
@ -319,7 +347,9 @@ def settings_profile_post(v):
v.bio_html=bio_html v.bio_html=bio_html
g.db.add(v) g.db.add(v)
g.db.commit() 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, v=v,
msg="Your bio has been updated.") msg="Your bio has been updated.")
@ -409,12 +439,17 @@ def settings_profile_post(v):
def filters(v): def filters(v):
filters=request.values.get("filters")[:1000].strip() 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 v.custom_filter_list=filters
g.db.add(v) g.db.add(v)
g.db.commit() 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") @app.post("/changelogsub")
@auth_required @auth_required
@ -434,9 +469,12 @@ def changelogsub(v):
@auth_required @auth_required
@validate_formkey @validate_formkey
def namecolor(v): def namecolor(v):
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
color = str(request.values.get("color", "")).strip() color = str(request.values.get("color", "")).strip()
if color.startswith('#'): color = color[1:] 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 v.namecolor = color
g.db.add(v) g.db.add(v)
g.db.commit() g.db.commit()
@ -447,9 +485,12 @@ def namecolor(v):
@auth_required @auth_required
@validate_formkey @validate_formkey
def themecolor(v): def themecolor(v):
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
themecolor = str(request.values.get("themecolor", "")).strip() themecolor = str(request.values.get("themecolor", "")).strip()
if themecolor.startswith('#'): themecolor = themecolor[1:] 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 v.themecolor = themecolor
g.db.add(v) g.db.add(v)
g.db.commit() g.db.commit()
@ -520,9 +561,12 @@ def gumroad(v):
@auth_required @auth_required
@validate_formkey @validate_formkey
def titlecolor(v): def titlecolor(v):
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
titlecolor = str(request.values.get("titlecolor", "")).strip() titlecolor = str(request.values.get("titlecolor", "")).strip()
if titlecolor.startswith('#'): titlecolor = titlecolor[1:] 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 v.titlecolor = titlecolor
g.db.add(v) g.db.add(v)
g.db.commit() g.db.commit()
@ -533,9 +577,12 @@ def titlecolor(v):
@auth_required @auth_required
@validate_formkey @validate_formkey
def verifiedcolor(v): def verifiedcolor(v):
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
verifiedcolor = str(request.values.get("verifiedcolor", "")).strip() verifiedcolor = str(request.values.get("verifiedcolor", "")).strip()
if verifiedcolor.startswith('#'): verifiedcolor = verifiedcolor[1:] 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 v.verifiedcolor = verifiedcolor
g.db.add(v) g.db.add(v)
g.db.commit() g.db.commit()
@ -662,7 +709,9 @@ def settings_log_out_others(v):
submitted_password = request.values.get("password", "").strip() submitted_password = request.values.get("password", "").strip()
if not v.verifyPass(submitted_password): 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 v.login_nonce += 1
@ -672,7 +721,9 @@ def settings_log_out_others(v):
g.db.commit() 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") @app.post("/settings/images/profile")
@ -708,7 +759,9 @@ def settings_images_profile(v):
g.db.commit() 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") @app.post("/settings/images/banner")
@ -734,7 +787,9 @@ def settings_images_banner(v):
g.db.add(v) g.db.add(v)
g.db.commit() 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") @app.post("/settings/delete/profile")
@ -748,7 +803,9 @@ def settings_delete_profile(v):
g.db.add(v) g.db.add(v)
g.db.commit() 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.") msg="Profile picture successfully removed.")
@app.post("/settings/delete/banner") @app.post("/settings/delete/banner")
@ -762,20 +819,26 @@ def settings_delete_banner(v):
g.db.add(v) g.db.add(v)
g.db.commit() 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") @app.get("/settings/blocks")
@auth_required @auth_required
def settings_blockedpage(v): 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") @app.get("/settings/css")
@auth_required @auth_required
def settings_css_get(v): 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") @app.post("/settings/css")
@limiter.limit("1/second") @limiter.limit("1/second")
@ -788,14 +851,18 @@ def settings_css(v):
g.db.add(v) g.db.add(v)
g.db.commit() 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") @app.get("/settings/profilecss")
@auth_required @auth_required
def settings_profilecss_get(v): 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." 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") @app.post("/settings/profilecss")
@limiter.limit("1/second") @limiter.limit("1/second")
@ -808,7 +875,9 @@ def settings_profilecss(v):
g.db.add(v) g.db.add(v)
g.db.commit() 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") @app.post("/settings/block")
@limiter.limit("1/second") @limiter.limit("1/second")
@ -876,7 +945,9 @@ def settings_unblock_user(v):
@auth_required @auth_required
def settings_apps(v): 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") @app.post("/settings/remove_discord")
@ -898,7 +969,9 @@ def settings_remove_discord(v):
@auth_required @auth_required
def settings_content_get(v): 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") @app.post("/settings/name_change")
@limiter.limit("1/second") @limiter.limit("1/second")
@ -911,12 +984,16 @@ def settings_name_change(v):
new_name=request.values.get("name").strip() new_name=request.values.get("name").strip()
if new_name==v.username: 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, v=v,
error="You didn't change anything") error="You didn't change anything")
if not re.match(valid_username_regex, new_name): 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, v=v,
error=f"This isn't a valid username.") error=f"This isn't a valid username.")
@ -930,7 +1007,9 @@ def settings_name_change(v):
).first() ).first()
if x and x.id != v.id: 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, v=v,
error=f"Username `{new_name}` is already in use.") error=f"Username `{new_name}` is already in use.")
@ -966,7 +1045,9 @@ def settings_song_change(v):
id = song.split("v=")[1] id = song.split("v=")[1]
elif song.startswith("https://youtu.be/"): elif song.startswith("https://youtu.be/"):
id = song.split("https://youtu.be/")[1] 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]
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() 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'] duration = req['items'][0]['contentDetails']['duration']
if duration == 'P0D': 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: 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: if "M" in duration:
duration = int(duration.split("PT")[1].split("M")[0]) duration = int(duration.split("PT")[1].split("M")[0])
if duration > 10: 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: 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}"]) try: ydl.download([f"https://youtube.com/watch?v={id}"])
except Exception as e: except Exception as e:
print(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, v=v,
error=f"Age-restricted videos aren't allowed.") error=f"Age-restricted videos aren't allowed.")
@ -1030,12 +1119,14 @@ def settings_song_change(v):
@auth_required @auth_required
@validate_formkey @validate_formkey
def settings_title_change(v): def settings_title_change(v):
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
if v.flairchanged: abort(403) if v.flairchanged: abort(403)
new_name=request.values.get("title").strip()[:100].replace("𒐪","") 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 v.customtitleplain = new_name

View File

@ -16,7 +16,9 @@ site_name = environ.get("SITE_NAME").strip()
@auth_desired @auth_desired
def emojis(v): def emojis(v):
emojis = (x.replace('.webp','') for x in os.listdir("files/assets/images/emojis")) 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') @app.get('/rules')
@auth_desired @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") @app.get("/chart")
@ -157,14 +161,18 @@ def cached_chart(days):
def patrons(v): def patrons(v):
users = g.db.query(User).filter(User.patron > 0).order_by(User.patron.desc(), User.id).all() 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("/admins")
@app.get("/badmins") @app.get("/badmins")
@auth_desired @auth_desired
def admins(v): def admins(v):
admins = g.db.query(User).filter(User.admin_level>0).order_by(User.truecoins.desc()).all() 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") @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()] 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>") @app.get("/log/<id>")
@auth_desired @auth_desired
@ -221,7 +231,9 @@ def log_item(id, v):
if v and v.admin_level > 1: types = ACTIONTYPES if v and v.admin_level > 1: types = ACTIONTYPES
else: types = ACTIONTYPES2 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") @app.get("/assets/favicon.ico")
def favicon(): def favicon():
@ -230,7 +242,9 @@ def favicon():
@app.get("/api") @app.get("/api")
@auth_desired @auth_desired
def api(v): 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("/contact")
@app.get("/press") @app.get("/press")
@ -238,7 +252,9 @@ def api(v):
@auth_required @auth_required
def contact(v): 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") @app.post("/contact")
@limiter.limit("1/second") @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", "") 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) send_admin(v.id, message)
g.db.commit() 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') @app.get('/archives')
def archivesindex(): def archivesindex():
@ -318,13 +336,17 @@ def settings(v):
def settings_profile(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) v=v)
@app.get("/badges") @app.get("/badges")
@auth_desired @auth_desired
def badges(v): 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") @app.get("/blocks")
@auth_desired @auth_desired
@ -338,20 +360,26 @@ def blocks(v):
users.append(get_account(x.user_id)) users.append(get_account(x.user_id))
targets.append(get_account(x.target_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") @app.get("/banned")
@auth_desired @auth_desired
def banned(v): def banned(v):
users = [x for x in g.db.query(User).filter(User.is_banned > 0, User.unban_utc == 0).all()] 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") @app.get("/formatting")
@auth_desired @auth_desired
def formatting(v): 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") @app.get("/service-worker.js")
def serviceworker(): def serviceworker():
@ -362,7 +390,9 @@ def serviceworker():
def settings_security(v): 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, v=v,
mfa_secret=pyotp.random_base32() if not v.mfa_secret else None, mfa_secret=pyotp.random_base32() if not v.mfa_secret else None,
error=request.values.get("error") or 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] 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") @app.get("/@<username>/downvoters")
@auth_desired @auth_desired
@ -54,7 +56,9 @@ def downvoters(v, username):
users = sorted(users2, key=lambda x: x[1], reverse=True)[:25] 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") @app.get("/@<username>/upvoting")
@auth_desired @auth_desired
@ -73,7 +77,9 @@ def upvoting(v, username):
users = sorted(users2, key=lambda x: x[1], reverse=True)[:25] 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") @app.get("/@<username>/downvoting")
@auth_desired @auth_desired
@ -92,7 +98,9 @@ def downvoting(v, username):
users = sorted(users2, key=lambda x: x[1], reverse=True)[:25] 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") @app.post("/pay_rent")
@limiter.limit("1/second") @limiter.limit("1/second")
@ -154,7 +162,9 @@ def steal(v):
@auth_desired @auth_desired
def rentoids(v): def rentoids(v):
users = g.db.query(User).filter(User.rent_utc > 0).all() 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") @app.get("/thiefs")
@ -163,7 +173,9 @@ def thiefs(v):
successful = g.db.query(User).filter(User.steal_utc > 0).all() successful = g.db.query(User).filter(User.steal_utc > 0).all()
failed = g.db.query(User).filter(User.fail_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() 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") @app.post("/@<username>/suicide")
@ -275,8 +287,12 @@ def leaderboard(v):
if 'pcmemes.net' == request.host: if 'pcmemes.net' == request.host:
users6 = users.order_by(User.basedcount.desc()).limit(10).all() 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) if v and v.oldsite: template = ''
return render_template("leaderboard.html", v=v, users1=users1, users2=users2, users3=users3, users4=users4, users5=users5, users7=users7, users9=users9) 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") @app.get("/@<username>/css")
@ -437,7 +453,9 @@ def messagereply(v):
g.db.commit() 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>") @app.get("/2faqr/<secret>")
@auth_required @auth_required
@ -496,7 +514,9 @@ def followers(username, v):
# if 'rdrama.net' in request.host and u.id == 147: abort(404) # 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()] 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() 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") @app.get("/@<username>/following")
@auth_required @auth_required
@ -505,14 +525,21 @@ def following(username, v):
# if 'rdrama.net' in request.host and u.id == 147: abort(404) # 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()] 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() 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") @app.get("/views")
@auth_required @auth_required
def visitors(v): 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) 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>") @app.get("/@<username>")
@ -535,7 +562,9 @@ def u_username(username, v=None):
if u.reserved: if u.reserved:
if request.headers.get("Authorization"): return {"error": f"That username is reserved for: {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: if v and u.id != v.id:
view = g.db.query(ViewerRelationship).filter( view = g.db.query(ViewerRelationship).filter(
@ -560,20 +589,28 @@ def u_username(username, v=None):
if v and u.id == LLM_ID: if v and u.id == LLM_ID:
if int(time.time()) - v.rent_utc > 600: if int(time.time()) - v.rent_utc > 600:
if request.headers.get("Authorization"): return {"error": "That userpage is private"} 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: else:
if request.headers.get("Authorization"): return {"error": "That userpage is private"} 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 v and hasattr(u, 'is_blocking') and u.is_blocking:
if request.headers.get("Authorization"): return {"error": f"You are blocking @{u.username}."} 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 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."} 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") sort = request.values.get("sort", "new")
@ -597,7 +634,9 @@ def u_username(username, v=None):
if u.unban_utc: if u.unban_utc:
if request.headers.get("Authorization"): {"data": [x.json for x in listing]} 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, unban=u.unban_string,
u=u, u=u,
v=v, 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]} 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, u=u,
v=v, v=v,
listing=listing, listing=listing,
@ -643,7 +684,9 @@ def u_username_comments(username, v=None):
if u.reserved: if u.reserved:
if request.headers.get("Authorization"): return {"error": f"That username is reserved for: {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, u=u,
v=v) v=v)
@ -652,18 +695,26 @@ def u_username_comments(username, v=None):
if v and u.id == LLM_ID: if v and u.id == LLM_ID:
if int(time.time()) - v.rent_utc > 600: if int(time.time()) - v.rent_utc > 600:
if request.headers.get("Authorization"): return {"error": "That userpage is private"} 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: else:
if request.headers.get("Authorization"): return {"error": "That userpage is private"} 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 v and hasattr(u, 'is_blocking') and u.is_blocking:
if request.headers.get("Authorization"): return {"error": f"You are blocking @{u.username}."} 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 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."} 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")) 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)) is_following = (v and user.has_follower(v))
if request.headers.get("Authorization"): return {"data": [c.json for c in listing]} 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") @app.get("/@<username>/info")
@ -840,7 +893,9 @@ def saved_posts(v, username):
listing = get_posts(ids, v=v) listing = get_posts(ids, v=v)
if request.headers.get("Authorization"): return {"data": [x.json for x in listing]} 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, u=v,
v=v, v=v,
listing=listing, listing=listing,
@ -868,7 +923,9 @@ def saved_comments(v, username):
if request.headers.get("Authorization"): return {"data": [x.json for x in listing]} 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, u=v,
v=v, v=v,
listing=listing, listing=listing,

View File

@ -15,11 +15,13 @@ defaultcolor = environ.get("DEFAULT_COLOR").strip()
@limiter.limit("5/second;60/minute;200/hour") @limiter.limit("5/second;60/minute;200/hour")
@auth_desired @auth_desired
def admin_vote_info_get(v): 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 if v and v.shadowbanned: return render_template('errors/500.html', error=True, v=v), 500
link = request.values.get("link") 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: try:
if "t2_" in link: thing = get_post(int(link.split("t2_")[1]), v=v) 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) 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, v=v,
thing=thing, thing=thing,
ups=ups, ups=ups,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
{% extends "default.html" %} {% extends "CHRISTMAS/default.html" %}
{% block pagetitle %}Edit {{'SITE_NAME' | app_config}} rules{% endblock %} {% 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 %} {% block pagetitle %}Admins{% endblock %}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
{% extends "email/default.html" %} {% extends "CHRISTMAS/email/default.html" %}
{% block title %}Remove Two-Factor Authentication{% endblock %}</h1> {% 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> {% 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> {% 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 title %}Reset Your Password{% endblock %}
{% block preheader %}Reset your {{'SITE_NAME' | app_config}} 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 %} {% block content %}
<pre> <pre>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
{% extends "default.html" %} {% extends "CHRISTMAS/default.html" %}
{% block content %} {% block content %}
<div class="col-span-full my-4"> <div class="col-span-full my-4">
<h5>Users followed by @{{u.username}}</h5> <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 %} {% block pagetitle %}{{'SITE_NAME' | app_config}} Password Reset{% endblock %}

View File

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

View File

@ -62,7 +62,7 @@
Leaderboard Leaderboard
</a> </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' }}"> <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"/> <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 %} {% if v %}
<!-- Profile dropdown --> <!-- Profile dropdown -->
<div class="ml-3 relative hidden sm:block"> <div class="ml-3 relative hidden sm:block">
{% include "/dropdowns/NavbarProfile.html" %} {% include "CHRISTMAS/dropdowns/NavbarProfile.html" %}
</div> </div>
{% if v.admin_level > 1 %} {% if v.admin_level > 1 %}
<!-- Admin link --> <!-- Admin link -->

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
{% extends "authforms.html" %} {% extends "CHRISTMAS/authforms.html" %}
{% block pagetitle %}{{'SITE_NAME' | app_config}} Two-Factor Removal{% endblock %} {% 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 %} {% block title %}
<title>{{title}}</title> <title>{{title}}</title>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
{% extends "default.html" %} {% extends "CHRISTMAS/default.html" %}
{% block content %} {% block content %}
<pre></pre> <pre></pre>
<h5>Rentoids</h5> <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 %} {% block pagetitle %}{{'SITE_NAME' | app_config}} Password Reset{% endblock %}

View File

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

View File

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

View File

@ -1,8 +1,8 @@
{% extends "search.html" %} {% extends "CHRISTMAS/search.html" %}
{% block listing_template %} {% block listing_template %}
<div class="flex flex-wrap -mx-2 overflow-hidden"> <div class="flex flex-wrap -mx-2 overflow-hidden">
{% include "user_listing.html" %} {% include "CHRISTMAS/user_listing.html" %}
</div> </div>
{% endblock %} {% 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 %}> <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="flex h-screen pt-16 bg-gray-500">
<div class="w-full sm:overflow-y-auto"> <div class="w-full sm:overflow-y-auto">
@ -144,12 +144,12 @@
{% endblock %} {% endblock %}
</div> </div>
{% include "/sidebars/SettingsSidebar.html" %} {% include "CHRISTMAS/sidebars/SettingsSidebar.html" %}
</div> </div>
</div> </div>
{% include "footer.html" %} {% include "CHRISTMAS/footer.html" %}
</div> </div>
</div> </div>
@ -177,7 +177,7 @@
{% endif %} {% endif %}
{% if v %} {% if v %}
{% include "/modals/Modal2FA.html" %} {% include "CHRISTMAS/modals/Modal2FA.html" %}
{% endif %} {% endif %}
{% block modals %}{% endblock %} {% 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 %}"> <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 %} {% block subNav %}
@ -150,7 +150,7 @@
</div> </div>
{% block mobilenavbar %} {% block mobilenavbar %}
{% include "mobile_navigation_bar.html" %} {% include "CHRISTMAS/mobile_navigation_bar.html" %}
{% endblock %} {% endblock %}
{% block invitationModal %} {% block invitationModal %}

View File

@ -1,4 +1,4 @@
{% extends "settings.html" %} {% extends "CHRISTMAS/settings.html" %}
{% block title %} {% block title %}
<title>{{'SITE_NAME' | app_config}} - FAQ</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 %} {% 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 %} {% 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 %} {% 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 %} {% block pagetitle %}Profile Settings - {{'SITE_NAME' | app_config}}{% endblock %}
@ -8,6 +8,13 @@
<!-- Avatar section --> <!-- 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="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"> <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> <h2 class="label text-black">Avatar</h2>
<div class="flex flex-col md:flex-row gap-3"> <div class="flex flex-col md:flex-row gap-3">
<!-- Avatar --> <!-- Avatar -->
@ -400,8 +407,8 @@
{% endblock %} {% endblock %}
{% block modals %} {% block modals %}
{% include "emoji_modal.html" %} {% include "CHRISTMAS/emoji_modal.html" %}
{% include "gif_modal.html" %} {% include "CHRISTMAS/gif_modal.html" %}
{% endblock %} {% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "settings.html" %} {% extends "CHRISTMAS/settings.html" %}
{% block pagetitle %}Custom profilecss - {{'SITE_NAME' | app_config}}{% endblock %} {% 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 %} {% block pagetitle %}Security Settings - {{'SITE_NAME' | app_config}}{% endblock %}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
{% if v %} {% if v %}
{% include "award_modal.html" %} {% include "CHRISTMAS/award_modal.html" %}
{% endif %} {% endif %}
{% for p in listing %} {% for p in listing %}
@ -242,7 +242,7 @@
{% endif %} {% endif %}
<div class="relative z-20 hidden md:block pt-3"> <div class="relative z-20 hidden md:block pt-3">
{% include "/submission/SubmissionActions.html" %} {% include "CHRISTMAS/submission/SubmissionActions.html" %}
</div> </div>
</div> </div>
@ -273,10 +273,10 @@
</div> </div>
<div class="relative z-10 md:hidden pt-3"> <div class="relative z-10 md:hidden pt-3">
{% include "/submission/SubmissionActionsMobile.html" %} {% include "CHRISTMAS/submission/SubmissionActionsMobile.html" %}
</div> </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')) %} {% 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"> <div class="md:ml-[4.5rem] mt-4">
@ -371,14 +371,14 @@
{% endfor %} {% endfor %}
{% if v %} {% if v %}
{% include "delete_post_modal.html" %} {% include "CHRISTMAS/delete_post_modal.html" %}
{% include "report_post_modal.html" %} {% include "CHRISTMAS/report_post_modal.html" %}
{% if v.admin_level == 6 %} {% if v.admin_level == 6 %}
{% include "ban_modal.html" %} {% include "CHRISTMAS/ban_modal.html" %}
{% endif %} {% endif %}
{% 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/new_comments_count.js?v=200"></script>
<script defer src="/assets/CHRISTMAS/js/submission_listing.js?v=201"></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> <title>Create a post - {{'SITE_NAME' | app_config}}</title>
{% endblock %} {% endblock %}
{% extends "default.html" %} {% extends "CHRISTMAS/default.html" %}
{% block subHeader %} {% block subHeader %}
<div class="relative max-w-screen-2xl mx-auto px-4 py-4 grid grid-cols-12 rounded-t"> <div class="relative max-w-screen-2xl mx-auto px-4 py-4 grid grid-cols-12 rounded-t">
@ -156,13 +156,13 @@
{% endblock %} {% endblock %}
{% block sidebar %} {% block sidebar %}
{% include '/sidebars/SubmitSidebar.html' %} {% include 'CHRISTMAS//sidebars/SubmitSidebar.html' %}
{% endblock %} {% endblock %}
{% block modals %} {% block modals %}
{% include "emoji_modal.html" %} {% include "CHRISTMAS/emoji_modal.html" %}
{% include "gif_modal.html" %} {% include "CHRISTMAS/gif_modal.html" %}
{% include '/awards/Christmas/Snow.html' %} {% include 'CHRISTMAS//awards/Christmas/Snow.html' %}
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}

View File

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

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