forked from rDrama/rDrama
fdMerge branch 'frost' of https://github.com/Aevann1/Drama into frost
commit
aca4bc269c
|
@ -3,11 +3,7 @@ from sqlalchemy.orm import relationship
|
|||
from files.__main__ import Base
|
||||
from os import environ
|
||||
from files.helpers.lazy import lazy
|
||||
from files.helpers.const import AWARDS
|
||||
|
||||
site_name = environ.get("SITE_NAME").strip()
|
||||
|
||||
|
||||
from files.helpers.const import *
|
||||
|
||||
class AwardRelationship(Base):
|
||||
|
||||
|
|
|
@ -3,11 +3,9 @@ from sqlalchemy.orm import relationship
|
|||
from files.__main__ import Base, app
|
||||
from os import environ
|
||||
from files.helpers.lazy import lazy
|
||||
from files.helpers.const import BADGES
|
||||
from files.helpers.const import *
|
||||
from datetime import datetime
|
||||
|
||||
site_name = environ.get("SITE_NAME").strip()
|
||||
|
||||
class Badge(Base):
|
||||
|
||||
__tablename__ = "badges"
|
||||
|
@ -63,5 +61,5 @@ class Badge(Base):
|
|||
return {'text': self.text,
|
||||
'name': self.name,
|
||||
'url': self.url,
|
||||
'icon_url':f"https://{app.config['SERVER_NAME']}{self.path}"
|
||||
'icon_url':f"{SITE_FULL}{self.path}"
|
||||
}
|
|
@ -7,15 +7,11 @@ from sqlalchemy import *
|
|||
from sqlalchemy.orm import relationship
|
||||
from files.__main__ import Base
|
||||
from files.classes.votes import CommentVote
|
||||
from files.helpers.const import AUTOPOLLER_ID, AUTOBETTER_ID, censor_slurs
|
||||
from files.helpers.const import *
|
||||
from files.helpers.lazy import lazy
|
||||
from .flags import CommentFlag
|
||||
from random import randint
|
||||
|
||||
site = environ.get("DOMAIN").strip()
|
||||
if site == 'pcmemes.net': cc = "SPLASH MOUNTAIN"
|
||||
else: cc = "COUNTRY CLUB"
|
||||
|
||||
class Comment(Base):
|
||||
|
||||
__tablename__ = "comments"
|
||||
|
@ -324,7 +320,7 @@ class Comment(Base):
|
|||
return data
|
||||
|
||||
def realbody(self, v):
|
||||
if self.post and self.post.club and not (v and (v.paid_dues or v.id in [self.author_id, self.post.author_id])): return f"<p>{cc} ONLY</p>"
|
||||
if self.post and self.post.club and not (v and (v.paid_dues or v.id in [self.author_id, self.post.author_id])): return f"<p>{CC} ONLY</p>"
|
||||
|
||||
body = self.body_html
|
||||
|
||||
|
@ -364,7 +360,7 @@ class Comment(Base):
|
|||
return body
|
||||
|
||||
def plainbody(self, v):
|
||||
if self.post and self.post.club and not (v and (v.paid_dues or v.id in [self.author_id, self.post.author_id])): return f"<p>{cc} ONLY</p>"
|
||||
if self.post and self.post.club and not (v and (v.paid_dues or v.id in [self.author_id, self.post.author_id])): return f"<p>{CC} ONLY</p>"
|
||||
|
||||
body = self.body
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ from sqlalchemy import *
|
|||
from sqlalchemy.orm import relationship
|
||||
from files.__main__ import Base
|
||||
from files.helpers.lazy import lazy
|
||||
from files.helpers.const import censor_slurs
|
||||
from files.helpers.const import *
|
||||
import time
|
||||
|
||||
class Flag(Base):
|
||||
|
|
|
@ -5,10 +5,7 @@ import time
|
|||
from files.helpers.lazy import lazy
|
||||
from os import environ
|
||||
from copy import deepcopy
|
||||
|
||||
site = environ.get("DOMAIN").strip()
|
||||
if site == 'pcmemes.net': cc = "SPLASH MOUNTAIN"
|
||||
else: cc = "COUNTRY CLUB"
|
||||
from files.helpers.const import *
|
||||
|
||||
class ModAction(Base):
|
||||
__tablename__ = "modactions"
|
||||
|
@ -94,7 +91,7 @@ class ModAction(Base):
|
|||
def target_link(self):
|
||||
if self.target_user: return f'<a href="{self.target_user.url}">{self.target_user.username}</a>'
|
||||
elif self.target_post:
|
||||
if self.target_post.club: return f'<a href="{self.target_post.permalink}">{cc} ONLY</a>'
|
||||
if self.target_post.club: return f'<a href="{self.target_post.permalink}">{CC} ONLY</a>'
|
||||
return f'<a href="{self.target_post.permalink}">{self.target_post.title.replace("<","").replace(">","")}</a>'
|
||||
elif self.target_comment_id: return f'<a href="/comment/{self.target_comment_id}?context=9#context">comment</a>'
|
||||
|
||||
|
|
|
@ -7,17 +7,12 @@ from flask import render_template
|
|||
from sqlalchemy import *
|
||||
from sqlalchemy.orm import relationship
|
||||
from files.__main__ import Base
|
||||
from files.helpers.const import AUTOPOLLER_ID, AUTOBETTER_ID, censor_slurs, TROLLTITLES
|
||||
from files.helpers.const import *
|
||||
from files.helpers.lazy import lazy
|
||||
from .flags import Flag
|
||||
from .comment import Comment
|
||||
from flask import g
|
||||
|
||||
site = environ.get("DOMAIN").strip()
|
||||
site_name = environ.get("SITE_NAME").strip()
|
||||
if site == 'pcmemes.net': cc = "SPLASH MOUNTAIN"
|
||||
else: cc = "COUNTRY CLUB"
|
||||
|
||||
class Submission(Base):
|
||||
__tablename__ = "submissions"
|
||||
|
||||
|
@ -232,22 +227,22 @@ class Submission(Base):
|
|||
@property
|
||||
@lazy
|
||||
def thumb_url(self):
|
||||
if self.over_18: return f"https://{site}/static/assets/images/nsfw.webp"
|
||||
elif not self.url: return f"https://{site}/static/assets/images/{site_name}/default_text.webp"
|
||||
if self.over_18: return f"{SITE_FULL}/static/assets/images/nsfw.webp"
|
||||
elif not self.url: return f"{SITE_FULL}/static/assets/images/{SITE_NAME}/default_text.webp"
|
||||
elif self.thumburl: return self.thumburl
|
||||
elif self.is_youtube or self.is_video: return f"https://{site}/static/assets/images/default_thumb_yt.webp"
|
||||
else: return f"https://{site}/static/assets/images/default_thumb_link.webp"
|
||||
elif self.is_youtube or self.is_video: return f"{SITE_FULL}/static/assets/images/default_thumb_yt.webp"
|
||||
else: return f"{SITE_FULL}/static/assets/images/default_thumb_link.webp"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def full_thumb(self):
|
||||
if self.thumb_url.startswith('/'): return f'https://{site}' + self.thumb_url
|
||||
if self.thumb_url.startswith('/'): return SITE_FULL + self.thumb_url
|
||||
return self.thumb_url
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def full_url(self):
|
||||
if self.url and self.url.startswith('/'): return f'https://{site}' + self.url
|
||||
if self.url and self.url.startswith('/'): return SITE_FULL + self.url
|
||||
return self.url
|
||||
|
||||
@property
|
||||
|
@ -352,7 +347,7 @@ class Submission(Base):
|
|||
else: return ""
|
||||
|
||||
def realbody(self, v):
|
||||
if self.club and not (v and (v.paid_dues or v.id == self.author_id)): return f"<p>{cc} ONLY</p>"
|
||||
if self.club and not (v and (v.paid_dues or v.id == self.author_id)): return f"<p>{CC} ONLY</p>"
|
||||
|
||||
body = self.body_html
|
||||
|
||||
|
@ -382,7 +377,7 @@ class Submission(Base):
|
|||
return body
|
||||
|
||||
def plainbody(self, v):
|
||||
if self.club and not (v and (v.paid_dues or v.id == self.author_id)): return f"<p>{cc} ONLY</p>"
|
||||
if self.club and not (v and (v.paid_dues or v.id == self.author_id)): return f"<p>{CC} ONLY</p>"
|
||||
|
||||
body = self.body
|
||||
|
||||
|
@ -402,7 +397,7 @@ class Submission(Base):
|
|||
def realtitle(self, v):
|
||||
if self.club and not (v and (v.paid_dues or v.id == self.author_id)):
|
||||
if v: return random.choice(TROLLTITLES).format(username=v.username)
|
||||
else: return f'{cc} MEMBERS ONLY'
|
||||
else: return f'{CC} MEMBERS ONLY'
|
||||
elif self.title_html: title = self.title_html
|
||||
else: title = self.title
|
||||
|
||||
|
@ -414,7 +409,7 @@ class Submission(Base):
|
|||
def plaintitle(self, v):
|
||||
if self.club and not (v and (v.paid_dues or v.id == self.author_id)):
|
||||
if v: return random.choice(TROLLTITLES).format(username=v.username)
|
||||
else: return f'{cc} MEMBERS ONLY'
|
||||
else: return f'{CC} MEMBERS ONLY'
|
||||
else: title = self.title
|
||||
|
||||
title = censor_slurs(title, v)
|
||||
|
|
|
@ -18,8 +18,6 @@ from files.helpers.security import *
|
|||
import random
|
||||
from os import environ, remove, path
|
||||
|
||||
site = environ.get("DOMAIN").strip()
|
||||
site_name = environ.get("SITE_NAME").strip()
|
||||
defaulttheme = environ.get("DEFAULT_THEME", "midnight").strip()
|
||||
defaultcolor = environ.get("DEFAULT_COLOR", "fff").strip()
|
||||
defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "all").strip()
|
||||
|
@ -28,7 +26,7 @@ cardview = bool(int(environ.get("CARD_VIEW", 1)))
|
|||
class User(Base):
|
||||
__tablename__ = "users"
|
||||
|
||||
if site == "pcmemes.net":
|
||||
if SITE == "pcmemes.net":
|
||||
quadrant = Column(String)
|
||||
basedcount = Column(Integer, default=0)
|
||||
pills = deferred(Column(String, default=""))
|
||||
|
@ -428,15 +426,15 @@ class User(Base):
|
|||
@lazy
|
||||
def banner_url(self):
|
||||
if self.bannerurl: return self.bannerurl
|
||||
else: return f"https://{site}/static/assets/images/{site_name}/site_preview.webp?a=1"
|
||||
else: return f"{SITE_FULL}/static/assets/images/{SITE_NAME}/site_preview.webp?a=1"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def profile_url(self):
|
||||
if self.agendaposter: return f"https://{site}/static/assets/images/defaultpictures/agendaposter/{random.randint(1, 50)}.webp?a=204"
|
||||
if self.agendaposter: return f"{SITE_FULL}/static/assets/images/defaultpictures/agendaposter/{random.randint(1, 50)}.webp?a=204"
|
||||
if self.profileurl: return self.profileurl
|
||||
if "rama" in site: return f"https://{site}/static/assets/images/defaultpictures/{random.randint(1, 150)}.webp?a=202"
|
||||
return f"https://{site}/static/assets/images/default-profile-pic.webp?a=204"
|
||||
if SITE_NAME == 'Drama': return f"{SITE_FULL}/static/assets/images/defaultpictures/{random.randint(1, 150)}.webp?a=202"
|
||||
return f"{SITE_FULL}/static/assets/images/default-profile-pic.webp?a=204"
|
||||
|
||||
@lazy
|
||||
def json_popover(self, v):
|
||||
|
@ -457,7 +455,7 @@ class User(Base):
|
|||
@property
|
||||
@lazy
|
||||
def full_profileurl(self):
|
||||
if self.profile_url.startswith('/'): return f'https://{site}' + self.profile_url
|
||||
if self.profile_url.startswith('/'): return SITE_FULL + self.profile_url
|
||||
return self.profile_url
|
||||
|
||||
@property
|
||||
|
|
|
@ -2,9 +2,15 @@ from os import environ, listdir
|
|||
import re
|
||||
from copy import deepcopy
|
||||
from json import loads
|
||||
from files.__main__ import app
|
||||
|
||||
SITE = environ.get("DOMAIN", '').strip()
|
||||
SITE_NAME = environ.get("SITE_NAME", '').strip()
|
||||
if SITE == "localhost": SITE_FULL = 'http://' + SITE
|
||||
else: SITE_FULL = 'https://' + SITE
|
||||
if SITE == 'pcmemes.net': CC = "SPLASH MOUNTAIN"
|
||||
else: CC = "COUNTRY CLUB"
|
||||
CC_TITLE = CC.title()
|
||||
|
||||
with open("files/assets/js/emoji_modal.js", 'r') as file:
|
||||
marseytext = file.read().split('emojis: ')[1].split('cops police"},')[0] + '"}}'
|
||||
|
@ -787,4 +793,27 @@ NOTIFIED_USERS = {
|
|||
}
|
||||
|
||||
num_banners = len(listdir('files/assets/images/Drama/banners')) + 1
|
||||
num_sidebar = len(listdir('files/assets/images/Drama/sidebar')) + 1
|
||||
num_sidebar = len(listdir('files/assets/images/Drama/sidebar')) + 1
|
||||
|
||||
@app.template_filter("full_link")
|
||||
def full_link(url):
|
||||
|
||||
return f"{SITE_FULL}{url}"
|
||||
|
||||
@app.template_filter("app_config")
|
||||
def app_config(x):
|
||||
return app.config.get(x)
|
||||
|
||||
@app.template_filter("post_embed")
|
||||
def post_embed(id, v):
|
||||
|
||||
try: id = int(id)
|
||||
except: return None
|
||||
|
||||
p = get_post(id, v, graceful=True)
|
||||
|
||||
return render_template("submission_listing.html", listing=[p], v=v)
|
||||
|
||||
@app.context_processor
|
||||
def inject_constants():
|
||||
return {"num_banners":num_banners, "num_sidebar":num_sidebar, "environ":environ, "SITE_NAME":SITE_NAME, "AUTOJANNY_ID":AUTOJANNY_ID, "NOTIFICATIONS_ID":NOTIFICATIONS_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE}
|
|
@ -1,27 +0,0 @@
|
|||
from files.__main__ import app
|
||||
from .get import *
|
||||
from os import listdir, environ
|
||||
from .const import *
|
||||
|
||||
@app.template_filter("full_link")
|
||||
def full_link(url):
|
||||
|
||||
return f"https://{app.config['SERVER_NAME']}{url}"
|
||||
|
||||
@app.template_filter("app_config")
|
||||
def app_config(x):
|
||||
return app.config.get(x)
|
||||
|
||||
@app.template_filter("post_embed")
|
||||
def post_embed(id, v):
|
||||
|
||||
try: id = int(id)
|
||||
except: return None
|
||||
|
||||
p = get_post(id, v, graceful=True)
|
||||
|
||||
return render_template("submission_listing.html", listing=[p], v=v)
|
||||
|
||||
@app.context_processor
|
||||
def inject_constants():
|
||||
return {"num_banners":num_banners, "num_sidebar":num_sidebar, "environ":environ, "SITE_NAME":SITE_NAME, "AUTOJANNY_ID": AUTOJANNY_ID, "NOTIFICATIONS_ID": NOTIFICATIONS_ID, "PUSHER_ID": PUSHER_ID}
|
|
@ -9,8 +9,6 @@ from mistletoe import markdown
|
|||
from json import loads, dump
|
||||
from random import random
|
||||
|
||||
site = environ.get("DOMAIN").strip()
|
||||
|
||||
allowed_tags = tags = ['b',
|
||||
'blockquote',
|
||||
'br',
|
||||
|
@ -166,7 +164,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
|
|||
|
||||
for tag in soup.find_all("a"):
|
||||
if tag.get("href"):
|
||||
if site not in tag["href"] and not tag["href"].startswith('/'):
|
||||
if not tag["href"].startswith(SITE_FULL) and not tag["href"].startswith('/'):
|
||||
tag["target"] = "_blank"
|
||||
tag["rel"] = "nofollow noopener noreferrer"
|
||||
|
||||
|
|
|
@ -5,17 +5,16 @@ from urllib.parse import quote
|
|||
|
||||
from files.helpers.security import *
|
||||
from files.helpers.wrappers import *
|
||||
from files.helpers.const import *
|
||||
from files.classes import *
|
||||
from files.__main__ import app, mail, limiter
|
||||
from flask_mail import Message
|
||||
|
||||
site = environ.get("DOMAIN").strip()
|
||||
name = environ.get("SITE_NAME").strip()
|
||||
|
||||
|
||||
def send_mail(to_address, subject, html):
|
||||
|
||||
msg = Message(html=html, subject=subject, sender=f"{name}@{site}", recipients=[to_address])
|
||||
msg = Message(html=html, subject=subject, sender=f"{name}@{SITE}", recipients=[to_address])
|
||||
mail.send(msg)
|
||||
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ from files.helpers.discord import add_role
|
|||
from datetime import datetime
|
||||
import requests
|
||||
|
||||
SITE_NAME = environ.get("SITE_NAME", "").strip()
|
||||
GUMROAD_ID = environ.get("GUMROAD_ID", "tfcvri").strip()
|
||||
GUMROAD_TOKEN = environ.get("GUMROAD_TOKEN", "").strip()
|
||||
|
||||
|
@ -25,11 +24,8 @@ CF_KEY = environ.get("CF_KEY", "").strip()
|
|||
CF_ZONE = environ.get("CF_ZONE", "").strip()
|
||||
CF_HEADERS = {"Authorization": f"Bearer {CF_KEY}", "Content-Type": "application/json"}
|
||||
|
||||
if SITE_NAME == 'PCM': cc = "splash mountain"
|
||||
else: cc = "country club"
|
||||
month = datetime.now().strftime('%B')
|
||||
|
||||
|
||||
@app.get("/refund")
|
||||
@admin_level_required(3)
|
||||
def refund(v):
|
||||
|
@ -166,7 +162,7 @@ def club_allow(v, username):
|
|||
g.db.add(x)
|
||||
|
||||
g.db.commit()
|
||||
return {"message": f"@{username} has been allowed into the {cc}!"}
|
||||
return {"message": f"@{username} has been allowed into the {CC_TITLE}!"}
|
||||
|
||||
@app.post("/@<username>/club_ban")
|
||||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
|
@ -186,7 +182,7 @@ def club_ban(v, username):
|
|||
g.db.add(x)
|
||||
|
||||
g.db.commit()
|
||||
return {"message": f"@{username} has been kicked from the {cc}. Deserved."}
|
||||
return {"message": f"@{username} has been kicked from the {CC_TITLE}. Deserved."}
|
||||
|
||||
|
||||
@app.post("/@<username>/make_meme_admin")
|
||||
|
|
|
@ -11,9 +11,6 @@ from files.__main__ import app, limiter
|
|||
from files.helpers.sanitize import filter_emojis_only
|
||||
import requests
|
||||
|
||||
site = environ.get("DOMAIN").strip()
|
||||
if site == 'pcmemes.net': cc = "SPLASH MOUNTAIN"
|
||||
else: cc = "COUNTRY CLUB"
|
||||
IMGUR_KEY = environ.get("IMGUR_KEY").strip()
|
||||
|
||||
if PUSHER_ID: beams_client = PushNotifications(instance_id=PUSHER_ID, secret_key=PUSHER_KEY)
|
||||
|
@ -474,7 +471,7 @@ def api_comment(v):
|
|||
'notification': {
|
||||
'title': f'New reply by @{c.author_name}',
|
||||
'body': notifbody,
|
||||
'deep_link': f'https://{site}/comment/{c.id}?context=9&read=true#context',
|
||||
'deep_link': f'{request.host_url}comment/{c.id}?context=9&read=true#context',
|
||||
'icon': f'{request.host_url}assets/images/{SITE_NAME}/icon.webp',
|
||||
}
|
||||
},
|
||||
|
|
|
@ -11,7 +11,6 @@ BOT_TOKEN = environ.get("DISCORD_BOT_TOKEN").strip()
|
|||
COINS_NAME = environ.get("COINS_NAME").strip()
|
||||
DISCORD_ENDPOINT = "https://discordapp.com/api/v6"
|
||||
WELCOME_CHANNEL="846509313941700618"
|
||||
SITE_NAME = environ.get("SITE_NAME", "").strip()
|
||||
|
||||
@app.get("/discord")
|
||||
@is_not_permabanned
|
||||
|
@ -58,7 +57,7 @@ def discord_redirect(v):
|
|||
'client_secret': CLIENT_SECRET,
|
||||
'grant_type': 'authorization_code',
|
||||
'code': code,
|
||||
'redirect_uri': f"https://{app.config['SERVER_NAME']}/discord_redirect",
|
||||
'redirect_uri': f"{request.host_url}discord_redirect",
|
||||
'scope': 'identify guilds.join'
|
||||
}
|
||||
headers={
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import html
|
||||
from .front import frontlist
|
||||
from datetime import datetime
|
||||
from files.helpers.jinja2 import full_link
|
||||
from files.helpers.const import *
|
||||
from files.helpers.get import *
|
||||
from yattag import Doc
|
||||
from files.helpers.wrappers import *
|
||||
|
@ -53,7 +53,7 @@ def feeds_user(v=None, sort='hot', t='all'):
|
|||
with tag("name"):
|
||||
text(post.author.username)
|
||||
with tag("uri"):
|
||||
text(f'https://{site}/@{post.author.username}')
|
||||
text(f'{request.host_url}@{post.author.username}')
|
||||
|
||||
doc.stag("link", href=full_link(post.permalink))
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ from files.__main__ import app, cache, limiter
|
|||
from files.classes.submission import Submission
|
||||
|
||||
defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "all").strip()
|
||||
SITE_NAME = environ.get("SITE_NAME", "").strip()
|
||||
|
||||
@app.post("/clear")
|
||||
@auth_required
|
||||
|
|
|
@ -366,7 +366,7 @@ def post_forgot():
|
|||
if user:
|
||||
now = int(time.time())
|
||||
token = generate_hash(f"{user.id}+{now}+forgot+{user.login_nonce}")
|
||||
url = f"https://{app.config['SERVER_NAME']}/reset?id={user.id}&time={now}&token={token}"
|
||||
url = f"{request.host_url}reset?id={user.id}&time={now}&token={token}"
|
||||
|
||||
send_mail(to_address=user.email,
|
||||
subject="Password Reset Request",
|
||||
|
@ -487,7 +487,7 @@ def request_2fa_disable():
|
|||
valid=int(time.time())
|
||||
token=generate_hash(f"{user.id}+{user.username}+disable2fa+{valid}+{user.mfa_secret}+{user.login_nonce}")
|
||||
|
||||
action_url=f"https://{app.config['SERVER_NAME']}/reset_2fa?id={user.id}&t={valid}&token={token}"
|
||||
action_url=f"{request.host_url}reset_2fa?id={user.id}&t={valid}&token={token}"
|
||||
|
||||
send_mail(to_address=user.email,
|
||||
subject="2FA Removal Request",
|
||||
|
|
|
@ -19,17 +19,15 @@ import requests
|
|||
from shutil import copyfile
|
||||
from psutil import cpu_percent
|
||||
|
||||
site = environ.get("DOMAIN").strip()
|
||||
site_name = environ.get("SITE_NAME").strip()
|
||||
IMGUR_KEY = environ.get("IMGUR_KEY").strip()
|
||||
|
||||
CF_KEY = environ.get("CF_KEY", "").strip()
|
||||
CF_ZONE = environ.get("CF_ZONE", "").strip()
|
||||
CF_HEADERS = {"Authorization": f"Bearer {CF_KEY}", "Content-Type": "application/json"}
|
||||
|
||||
if path.exists(f'snappy_{site_name}.txt'):
|
||||
with open(f'snappy_{site_name}.txt', "r") as f:
|
||||
if site == 'pcmemes.net': snappyquotes = f.read().split("{[para]}")
|
||||
if path.exists(f'snappy_{SITE_NAME}.txt'):
|
||||
with open(f'snappy_{SITE_NAME}.txt', "r") as f:
|
||||
if SITE == 'pcmemes.net': snappyquotes = f.read().split("{[para]}")
|
||||
else: snappyquotes = f.read().split("{[para]}") + [f':#{x}:' for x in marseys]
|
||||
|
||||
@app.post("/toggle_club/<pid>")
|
||||
|
@ -77,7 +75,7 @@ def publish(pid, v):
|
|||
cache.delete_memoized(User.userpagelisting)
|
||||
|
||||
if v.admin_level > 1 and ("[changelog]" in post.title or "(changelog)" in post.title):
|
||||
send_discord_message(f"https://{site}{post.permalink}")
|
||||
send_discord_message(f"{request.host_url}{post.permalink[1:]}")
|
||||
cache.delete_memoized(changeloglist)
|
||||
|
||||
g.db.commit()
|
||||
|
@ -400,7 +398,7 @@ def edit_post(pid, v):
|
|||
|
||||
body = request.values.get("body", "").strip().replace('','')
|
||||
|
||||
if len(body) > 10000: return {"error":"Character limit is 10000!"}, 403
|
||||
if len(body) > 20000: return {"error":"Character limit is 20000!"}, 403
|
||||
|
||||
if v.marseyawarded:
|
||||
marregex = list(re.finditer("^(:[!#]{0,2}m\w+:\s*)+$", title))
|
||||
|
@ -472,7 +470,7 @@ def edit_post(pid, v):
|
|||
elif v.bird:
|
||||
if len(body) > 140 : return {"error":"You have to type less than 140 characters!"}, 403
|
||||
|
||||
if len(body_html) > 20000: return {"error":"Submission body too long!"}, 400
|
||||
if len(body_html) > 40000: return {"error":"Submission body too long!"}, 400
|
||||
|
||||
p.body_html = body_html
|
||||
|
||||
|
@ -579,7 +577,7 @@ def thumbnail_thread(pid):
|
|||
|
||||
fetch_url = post.url
|
||||
|
||||
if fetch_url.startswith('/'): fetch_url = f"https://{site}{fetch_url}"
|
||||
if fetch_url.startswith('/'): fetch_url = f"{request.host_url}{fetch_url[1:]}"
|
||||
|
||||
headers={"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36"}
|
||||
|
||||
|
@ -852,10 +850,10 @@ def submit_post(v):
|
|||
g.db.add(ma)
|
||||
return redirect("/notifications")
|
||||
|
||||
if len(str(body)) > 10000:
|
||||
if len(str(body)) > 20000:
|
||||
|
||||
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error":"10000 character limit for text body."}, 400
|
||||
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 request.headers.get("Authorization") or request.headers.get("xhr"): return {"error":"There's a 20000 character limit for text body."}, 400
|
||||
return render_template("submit.html", v=v, error="There's a 20000 character limit for text body.", title=title, url=url, body=request.values.get("body", "")), 400
|
||||
|
||||
if len(url) > 2048:
|
||||
|
||||
|
@ -904,7 +902,7 @@ def submit_post(v):
|
|||
elif v.bird:
|
||||
if len(body) > 140 : return {"error":"You have to type less than 140 characters!"}, 403
|
||||
|
||||
if len(body_html) > 20000: return {"error":"Submission body too long!"}, 400
|
||||
if len(body_html) > 40000: return {"error":"Submission body too long!"}, 400
|
||||
|
||||
bans = filter_comment_html(body_html)
|
||||
if bans:
|
||||
|
@ -927,7 +925,7 @@ def submit_post(v):
|
|||
app_id=v.client.application.id if v.client else None,
|
||||
is_bot = request.headers.get("Authorization"),
|
||||
url=url,
|
||||
body=body[:10000],
|
||||
body=body[:20000],
|
||||
body_html=body_html,
|
||||
embed_url=embed,
|
||||
title=title[:500],
|
||||
|
@ -991,7 +989,7 @@ def submit_post(v):
|
|||
|
||||
if not new_post.thumburl and new_post.url:
|
||||
if request.host in new_post.url or new_post.url.startswith('/') or request.host == 'rdrama.net' and 'rdrama' in new_post.domain:
|
||||
new_post.thumburl = f'/static/assets/images/{site_name}/site_preview.webp'
|
||||
new_post.thumburl = f'/static/assets/images/{SITE_NAME}/site_preview.webp'
|
||||
elif request.headers.get('cf-ipcountry')!="T1":
|
||||
gevent.spawn( thumbnail_thread, new_post.id)
|
||||
|
||||
|
@ -1053,7 +1051,7 @@ def submit_post(v):
|
|||
rev = f"* [unddit.com](https://unddit.com/{rev})\n"
|
||||
else: rev = ''
|
||||
newposturl = new_post.url
|
||||
if newposturl.startswith('/'): newposturl = f"https://{site}{newposturl}"
|
||||
if newposturl.startswith('/'): newposturl = f"{request.host_url}{newposturl[1:]}"
|
||||
body += f"Snapshots:\n\n{rev}* [archive.org](https://web.archive.org/{newposturl})\n* [archive.ph](https://archive.ph/?url={quote(newposturl)}&run=1) (click to archive)\n\n"
|
||||
gevent.spawn(archiveorg, newposturl)
|
||||
|
||||
|
@ -1075,7 +1073,7 @@ def submit_post(v):
|
|||
|
||||
body_html = sanitize(body)
|
||||
|
||||
if len(body_html) < 20000:
|
||||
if len(body_html) < 40000:
|
||||
c = Comment(author_id=SNAPPY_ID,
|
||||
distinguish_level=6,
|
||||
parent_submission=new_post.id,
|
||||
|
@ -1105,7 +1103,7 @@ def submit_post(v):
|
|||
cache.delete_memoized(frontlist)
|
||||
cache.delete_memoized(User.userpagelisting)
|
||||
if v.admin_level > 1 and ("[changelog]" in new_post.title or "(changelog)" in new_post.title) and not new_post.private:
|
||||
send_discord_message(f"https://{site}{new_post.permalink}")
|
||||
send_discord_message(f"{request.host_url}{new_post.permalink[1:]}")
|
||||
cache.delete_memoized(changeloglist)
|
||||
|
||||
if v.id in (PIZZASHILL_ID, HIL_ID):
|
||||
|
|
|
@ -20,7 +20,6 @@ valid_password_regex = re.compile("^.{8,100}$")
|
|||
YOUTUBE_KEY = environ.get("YOUTUBE_KEY", "").strip()
|
||||
COINS_NAME = environ.get("COINS_NAME").strip()
|
||||
GUMROAD_TOKEN = environ.get("GUMROAD_TOKEN", "").strip()
|
||||
SITE_NAME = environ.get("SITE_NAME", "").strip()
|
||||
IMGUR_KEY = environ.get("IMGUR_KEY").strip()
|
||||
GUMROAD_ID = environ.get("GUMROAD_ID", "tfcvri").strip()
|
||||
|
||||
|
@ -543,7 +542,7 @@ def settings_security_post(v):
|
|||
if new_email == v.email:
|
||||
return render_template("settings_security.html", v=v, error="That email is already yours!")
|
||||
|
||||
url = f"https://{app.config['SERVER_NAME']}/activate"
|
||||
url = f"{request.host_url}activate"
|
||||
|
||||
now = int(time.time())
|
||||
|
||||
|
|
|
@ -9,9 +9,6 @@ import calendar
|
|||
import matplotlib.pyplot as plt
|
||||
from files.classes.mod_logs import ACTIONTYPES, ACTIONTYPES2
|
||||
|
||||
site = environ.get("DOMAIN").strip()
|
||||
site_name = environ.get("SITE_NAME").strip()
|
||||
|
||||
@app.get("/privacy")
|
||||
@auth_required
|
||||
def privacy(v):
|
||||
|
@ -246,7 +243,7 @@ def log_item(id, v):
|
|||
|
||||
@app.get("/static/assets/favicon.ico")
|
||||
def favicon():
|
||||
return send_file(f"./assets/images/{site_name}/icon.webp")
|
||||
return send_file(f"./assets/images/{SITE_NAME}/icon.webp")
|
||||
|
||||
@app.get("/api")
|
||||
@auth_required
|
||||
|
|
|
@ -16,7 +16,7 @@ import gevent
|
|||
if PUSHER_ID: beams_client = PushNotifications(instance_id=PUSHER_ID, secret_key=PUSHER_KEY)
|
||||
|
||||
def leaderboard_thread():
|
||||
global users9, userss9, users12, userss12, users13, userss13, users15, userss15
|
||||
global users9, userss9, users11, users13, userss13, users15, userss15
|
||||
|
||||
db = db_session()
|
||||
|
||||
|
@ -29,30 +29,6 @@ def leaderboard_thread():
|
|||
users9 = sorted(users9, key=lambda x: x[1], reverse=True)
|
||||
userss9 = users9[:25]
|
||||
|
||||
|
||||
badges = db.query(Badge.user_id, func.count(Badge.user_id)).group_by(Badge.user_id).order_by(func.count(Badge.user_id).desc()).all()
|
||||
badges = dict(badges)
|
||||
users11 = db.query(User).filter(User.id.in_(badges.keys())).all()
|
||||
users12 = []
|
||||
for user in users11: users12.append((user, badges[user.id]))
|
||||
users12 = sorted(users12, key=lambda x: x[1], reverse=True)
|
||||
userss12 = users12[:25]
|
||||
|
||||
if SITE_NAME == 'Drama':
|
||||
users13 = {}
|
||||
for k, val in marseys.items():
|
||||
if val in users13: users13[val] += 1
|
||||
else: users13[val] = 1
|
||||
|
||||
users13.pop('unknown','anton-d')
|
||||
users132 = db.query(User).filter(func.lower(User.username).in_(users13.keys())).all()
|
||||
users133 = []
|
||||
for user in users132:
|
||||
users133.append((user, users13[user.username.lower()]))
|
||||
users13 = sorted(users133, key=lambda x: x[1], reverse=True)
|
||||
userss13 = users13[:25]
|
||||
else: userss13 = None
|
||||
|
||||
votes1 = db.query(Vote.user_id, func.count(Vote.user_id)).filter(Vote.vote_type==1).group_by(Vote.user_id).order_by(func.count(Vote.user_id).desc()).all()
|
||||
votes2 = db.query(CommentVote.user_id, func.count(CommentVote.user_id)).filter(CommentVote.vote_type==1).group_by(CommentVote.user_id).order_by(func.count(CommentVote.user_id).desc()).all()
|
||||
votes3 = Counter(dict(votes1)) + Counter(dict(votes2))
|
||||
|
@ -328,50 +304,49 @@ def leaderboard(v):
|
|||
users = g.db.query(User)
|
||||
|
||||
users1 = users.order_by(User.coins.desc()).limit(25).all()
|
||||
users2 = users.order_by(User.stored_subscriber_count.desc()).limit(25).all()
|
||||
users3 = users.order_by(User.post_count.desc()).limit(25).all()
|
||||
users4 = users.order_by(User.comment_count.desc()).limit(25).all()
|
||||
users5 = users.order_by(User.received_award_count.desc()).limit(25).all()
|
||||
if SITE == 'pcmemes.net': users6 = users.order_by(User.basedcount.desc()).limit(25).all()
|
||||
else: users6 = None
|
||||
users7 = users.order_by(User.coins_spent.desc()).limit(25).all()
|
||||
users10 = users.order_by(User.truecoins.desc()).limit(25).all()
|
||||
|
||||
sq = g.db.query(User.id, func.rank().over(order_by=User.coins.desc()).label("rank")).subquery()
|
||||
pos1 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||
|
||||
users2 = users.order_by(User.stored_subscriber_count.desc()).limit(25).all()
|
||||
sq = g.db.query(User.id, func.rank().over(order_by=User.stored_subscriber_count.desc()).label("rank")).subquery()
|
||||
pos2 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||
|
||||
users3 = users.order_by(User.post_count.desc()).limit(25).all()
|
||||
sq = g.db.query(User.id, func.rank().over(order_by=User.post_count.desc()).label("rank")).subquery()
|
||||
pos3 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||
|
||||
users4 = users.order_by(User.comment_count.desc()).limit(25).all()
|
||||
sq = g.db.query(User.id, func.rank().over(order_by=User.comment_count.desc()).label("rank")).subquery()
|
||||
pos4 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||
|
||||
users5 = users.order_by(User.received_award_count.desc()).limit(25).all()
|
||||
sq = g.db.query(User.id, func.rank().over(order_by=User.received_award_count.desc()).label("rank")).subquery()
|
||||
pos5 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||
|
||||
if request.host == 'pcmemes.net':
|
||||
users6 = users.order_by(User.basedcount.desc()).limit(25).all()
|
||||
sq = g.db.query(User.id, func.rank().over(order_by=User.basedcount.desc()).label("rank")).subquery()
|
||||
pos6 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||
else: pos6 = None
|
||||
|
||||
else:
|
||||
users6 = None
|
||||
pos6 = None
|
||||
|
||||
users7 = users.order_by(User.coins_spent.desc()).limit(25).all()
|
||||
sq = g.db.query(User.id, func.rank().over(order_by=User.coins_spent.desc()).label("rank")).subquery()
|
||||
pos7 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||
|
||||
sq = g.db.query(User.id, func.rank().over(order_by=User.truecoins.desc()).label("rank")).subquery()
|
||||
pos10 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||
|
||||
try:
|
||||
pos9 = [x[0].id for x in users9].index(v.id)
|
||||
pos9 = (pos9+1, users9[pos9][1])
|
||||
except: pos9 = (len(users9)+1, 0)
|
||||
|
||||
try:
|
||||
pos12 = [x[0].id for x in users12].index(v.id)
|
||||
pos12 = (pos12+1, users12[pos12][1])
|
||||
except: pos12 = (len(users12)+1, 0)
|
||||
users10 = users.order_by(User.truecoins.desc()).limit(25).all()
|
||||
sq = g.db.query(User.id, func.rank().over(order_by=User.truecoins.desc()).label("rank")).subquery()
|
||||
pos10 = g.db.query(sq.c.id, sq.c.rank).filter(sq.c.id == v.id).limit(1).one()[1]
|
||||
|
||||
sq = g.db.query(Badge.user_id, func.count(Badge.user_id).label("count"), func.rank().over(order_by=func.count(Badge.user_id).desc()).label("rank")).order_by(func.count(Badge.user_id).desc()).group_by(Badge.user_id).subquery()
|
||||
users11 = g.db.query(User, sq.c.count).join(sq, User.id==sq.c.user_id).limit(25).all()
|
||||
pos11 = g.db.query(sq.c.rank, sq.c.count).filter(User.id == v.id).limit(1).one()
|
||||
|
||||
try:
|
||||
pos13 = [x[0].id for x in users13].index(v.id)
|
||||
|
@ -383,7 +358,7 @@ def leaderboard(v):
|
|||
pos15 = (pos15+1, users15[pos15][1])
|
||||
except: pos15 = (len(users15)+1, 0)
|
||||
|
||||
return render_template("leaderboard.html", v=v, users1=users1, pos1=pos1, users2=users2, pos2=pos2, users3=users3, pos3=pos3, users4=users4, pos4=pos4, users5=users5, pos5=pos5, users6=users6, pos6=pos6, users7=users7, pos7=pos7, users9=userss9, pos9=pos9, users10=users10, pos10=pos10, users12=userss12, pos12=pos12, users13=userss13, pos13=pos13, users15=userss15, pos15=pos15)
|
||||
return render_template("leaderboard.html", v=v, users1=users1, pos1=pos1, users2=users2, pos2=pos2, users3=users3, pos3=pos3, users4=users4, pos4=pos4, users5=users5, pos5=pos5, users6=users6, pos6=pos6, users7=users7, pos7=pos7, users9=userss9, pos9=pos9, users10=users10, pos10=pos10, users11=users11, pos11=pos11, users13=userss13, pos13=pos13, users15=userss15, pos15=pos15)
|
||||
|
||||
@app.get("/@<username>/css")
|
||||
@auth_required
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from files.helpers.wrappers import *
|
||||
from files.helpers.get import *
|
||||
from files.helpers.const import AUTOBETTER_ID
|
||||
from files.helpers.const import *
|
||||
from files.classes import *
|
||||
from flask import *
|
||||
from files.__main__ import app, limiter, cache
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=86"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=12">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=87"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=12">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -39,7 +39,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=86"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=12">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=87"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=12">
|
||||
{% endif %}
|
||||
|
||||
</head>
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
<p>Please remove the following link(s) from your comment, and then you will be able to post it:</p>
|
||||
|
||||
<ul>
|
||||
{% for site in badlinks %}
|
||||
<li>{{site}}</li>
|
||||
{% for s in badlinks %}
|
||||
<li>{{s}}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<script src="/static/assets/js/bootstrap.js?a=202"></script>
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=86">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=87">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=12">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
|
@ -32,7 +32,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=86"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=12">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=87"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=12">
|
||||
{% endif %}
|
||||
|
||||
<meta charset="utf-8">
|
||||
|
@ -210,7 +210,7 @@
|
|||
|
||||
</head>
|
||||
|
||||
<body id="{% if request.path != '/comments' %}{% block pagetype %}frontpage{% endblock %}{% endif %}" style="{% if path != '/formatting' %}overflow-x: hidden; {% endif %}{% if v and v.background %} background:url(/static/assets/images/backgrounds/{{v.background}}) no-repeat center center fixed !important; background-size: cover!important; background-color: #000!important;{% endif %} {% if request.host == 'rdrama.net' %}margin-top: 29px!important;{% endif %}">
|
||||
<body id="{% if request.path != '/comments' %}{% block pagetype %}frontpage{% endblock %}{% endif %}" style="{% if path != '/formatting' %}overflow-x: hidden; {% endif %}{% if v and v.background %} background:url(/static/assets/images/backgrounds/{{v.background}}) no-repeat center center fixed !important; background-size: cover!important; background-color: #000!important;{% endif %}">
|
||||
|
||||
{% block Banner %}
|
||||
{% if '@' not in request.path %}
|
||||
|
|
|
@ -289,18 +289,18 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody id="followers-table">
|
||||
{% for user in users12 %}
|
||||
{% for user in users11 %}
|
||||
<tr>
|
||||
<td style="font-weight: bold">{{loop.index}}</td>
|
||||
<td><a style="color:#{{user[0].namecolor}};font-weight:bold" href="/@{{user[0].username}}"><img alt="@{{user[0].username}}'s profile picture" loading="lazy" src="{{user[0].profile_url}}" class="pp20"><span {% if user[0].patron %}class="patron" style="background-color:#{{user[0].namecolor}}"{% endif %}>{{user[0].username}}</span></a></td>
|
||||
<td style="font-weight: bold">{{user[1]}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% if pos12 and pos12[0] > 25 %}
|
||||
{% if pos11 and pos11[0] > 25 %}
|
||||
<tr style="border-top:2px solid var(--primary)">
|
||||
<td style="font-weight:bold">{{pos12[0]}}</td>
|
||||
<td style="font-weight:bold">{{pos11[0]}}</td>
|
||||
<td><a style="color:#{{v.namecolor}};font-weight:bold" href="/@{{v.username}}"><img alt="@{{v.username}}'s profile picture" loading="lazy" src="{{v.profile_url}}" class="pp20"><span {% if v.patron %}class="patron" style="background-color:#{{v.namecolor}}"{% endif %}>{{v.username}}</span></a></td>
|
||||
<td style="font-weight:bold">{{pos12[1]}}</td>
|
||||
<td style="font-weight:bold">{{pos11[1]}}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
{% block content %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=86"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=12">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=87"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=12">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -30,7 +30,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=86"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=12">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=87"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=12">
|
||||
{% endif %}
|
||||
|
||||
<div class="row justify-content-around">
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
{% endblock %}
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=86">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=87">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=12">
|
||||
|
||||
</head>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<title>2-Step Login - {{SITE_NAME}}</title>
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=86"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=12">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=87"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=12">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=86"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=12">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=87"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=12">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
|
|
@ -39,10 +39,10 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=86"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=12">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=87"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=12">
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=86"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=12">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=87"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=12">
|
||||
{% endif %}
|
||||
</head>
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %}</title>
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=86"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=12">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=87"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=12">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %}</title>
|
||||
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=86"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=12">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=87"><link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=12">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -23,6 +23,13 @@
|
|||
|
||||
{% if p.award_count("wholesome") %}
|
||||
<style>
|
||||
.seal {
|
||||
position:fixed;
|
||||
z-index:9999;
|
||||
pointer-events: none;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
.sealimg {
|
||||
width: 100px;
|
||||
height: 89.5px;
|
||||
|
@ -33,87 +40,38 @@
|
|||
height: 27px;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes wholesome1 {
|
||||
0% {top:0%; left: 50%;}
|
||||
25% {top:50%; left:98%;}
|
||||
50% {top:98%; left: 50%}
|
||||
75% {top:50%; left:0%;}
|
||||
100% {top:0%; left: 50%;}
|
||||
}
|
||||
|
||||
.seal {
|
||||
position:fixed;
|
||||
z-index:9999;
|
||||
pointer-events: none;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
animation-duration: 10s !important;
|
||||
animation-iteration-count: infinite !important;
|
||||
animation-fill-mode: forwards !important;
|
||||
animation-timing-function: linear !important;
|
||||
}
|
||||
.seal1 {
|
||||
animation-name: wholesome1 !important;
|
||||
}
|
||||
</style>
|
||||
<div class="seal seal1" height="100%" width="100%">
|
||||
<img alt=":#marseywholesome:" class="sealimg" src="/static/assets/images/emojis/marseywholesome.webp?a=3">
|
||||
<div class="seal" height="100%" width="100%">
|
||||
<marquee class="seal" scrollamount=10 behavior="alternate" direction="up" height="100%" width="100%">
|
||||
<marquee direction="right" scrollamount=10 behavior="alternate" height="100%" width="100%">
|
||||
<img alt=":#marseywholesome:" class="sealimg" src="/static/assets/images/emojis/marseywholesome.webp?a=3">
|
||||
</marquee>
|
||||
</marquee>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if p.award_count("wholesome") > 1 %}
|
||||
<style>
|
||||
@keyframes wholesome2 {
|
||||
0% {top:50%; left:98%;}
|
||||
25% {top:98%; left: 50%}
|
||||
50% {top:50%; left:0%;}
|
||||
75% {top:0%; left: 50%;}
|
||||
100% {top:50%; left:98%;}
|
||||
}
|
||||
.seal2 {
|
||||
animation-name: wholesome2 !important;
|
||||
}
|
||||
</style>
|
||||
<div class="seal seal2" height="100%" width="100%">
|
||||
<img alt=":#marseywholesome:" class="sealimg" src="/static/assets/images/emojis/marseywholesome.webp?a=3">
|
||||
</div>
|
||||
<marquee class="seal" scrollamount=10 behavior="alternate" direction="down" height="100%">
|
||||
<marquee direction="right" scrollamount=10 behavior="alternate" width="100%">
|
||||
<img alt=":#marseywholesome:" class="sealimg" src="/static/assets/images/emojis/marseywholesome.webp?a=3">
|
||||
</marquee>
|
||||
</marquee>
|
||||
{% endif %}
|
||||
|
||||
{% if p.award_count("wholesome") > 2 %}
|
||||
<style>
|
||||
@keyframes wholesome3 {
|
||||
0% {top:50%; left:0%;}
|
||||
25% {top:0%; left: 50%;}
|
||||
50% {top:50%; left:98%;}
|
||||
75% {top:98%; left: 50%}
|
||||
100% {top:50%; left:0%;}
|
||||
}
|
||||
.seal3 {
|
||||
animation-name: wholesome3 !important;
|
||||
}
|
||||
</style>
|
||||
<div class="seal seal3" height="100%" width="100%">
|
||||
<img alt=":#marseywholesome:" class="sealimg" src="/static/assets/images/emojis/marseywholesome.webp?a=3">
|
||||
</div>
|
||||
<marquee class="seal" scrollamount=10 behavior="alternate" direction="up" height="100%">
|
||||
<marquee direction="left" scrollamount=10 behavior="alternate" width="100%">
|
||||
<img alt=":#marseywholesome:" class="sealimg" src="/static/assets/images/emojis/marseywholesome.webp?a=3">
|
||||
</marquee>
|
||||
</marquee>
|
||||
{% endif %}
|
||||
|
||||
{% if p.award_count("wholesome") > 3 %}
|
||||
<style>
|
||||
@keyframes wholesome4 {
|
||||
0% {top:98%; left: 50%}
|
||||
25% {top:50%; left:0%;}
|
||||
50% {top:0%; left: 50%;}
|
||||
75% {top:50%; left:98%;}
|
||||
100% {top:98%; left: 50%}
|
||||
}
|
||||
.seal4 {
|
||||
animation-name: wholesome4 !important;
|
||||
}
|
||||
</style>
|
||||
<div class="seal seal4" height="100%" width="100%">
|
||||
<img alt=":#marseywholesome:" class="sealimg" src="/static/assets/images/emojis/marseywholesome.webp?a=3">
|
||||
</div>
|
||||
<marquee class="seal" scrollamount=10 behavior="alternate" direction="down" height="100%">
|
||||
<marquee direction="left" scrollamount=10 behavior="alternate" width="100%">
|
||||
<img alt=":#marseywholesome:" class="sealimg" src="/static/assets/images/emojis/marseywholesome.webp?a=3">
|
||||
</marquee>
|
||||
</marquee>
|
||||
{% endif %}
|
||||
|
||||
{% if p.award_count("train") %}
|
||||
|
@ -422,13 +380,13 @@
|
|||
{% endif %}
|
||||
{% if p.realurl(v) %}
|
||||
<h1 id="post-title" class="card-title post-title text-left mb-md-3 {% if p.author.agendaposter %}agendaposter{% endif %}"><a {% if not v or v.newtabexternal %}target="_blank"{% endif %} rel="nofollow noopener noreferrer" href="{{p.realurl(v)}}">
|
||||
{% if p.club %}<span class="patron font-weight-bolder mr-1" style="background-color:red; font-size:12px; line-height:2;">{{cc}}</span>{% endif %}
|
||||
{% if p.club %}<span class="patron font-weight-bolder mr-1" style="background-color:red; font-size:12px; line-height:2;">{{CC}}</span>{% endif %}
|
||||
{% if p.flair %}<span class="patron font-weight-bolder mr-1" style="background-color:var(--primary); font-size:12px; line-height:2;">{{p.flair | safe}}</span>{% endif %}
|
||||
{{p.realtitle(v) | safe}}
|
||||
</a></h1>
|
||||
{% else %}
|
||||
<h1 id="post-title" class="card-title post-title text-left mb-md-3 {% if p.author.agendaposter %}agendaposter{% endif %}">
|
||||
{% if p.club %}<span class="patron font-weight-bolder mr-1" style="background-color:red; font-size:12px; line-height:2;">{{cc}}</span>{% endif %}
|
||||
{% if p.club %}<span class="patron font-weight-bolder mr-1" style="background-color:red; font-size:12px; line-height:2;">{{CC}}</span>{% endif %}
|
||||
{% if p.flair %}<span class="patron font-weight-bolder mr-1" style="background-color:var(--primary); font-size:12px; line-height:2;">{{p.flair | safe}}</span>{% endif %}
|
||||
{{p.realtitle(v) | safe}}
|
||||
</h1>
|
||||
|
@ -521,7 +479,7 @@
|
|||
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
|
||||
<input autocomplete="off" type="hidden" name="current_page" value="{{request.path}}">
|
||||
<textarea autocomplete="off" max-length="500" name="title" class="comment-box form-control rounded" required placeholder="title">{{p.title}}</textarea>
|
||||
<textarea autocomplete="off" name="body" {% if v.longpost %}minlength="280"{% endif %} maxlength="{% if v.bird %}140{% else %}10000{% endif %}" oninput="markdown('post-edit-box-{{p.id}}', 'post-edit-{{p.id}}');charLimit('post-edit-box-{{p.id}}','charcount-post-edit')" id="post-edit-box-{{p.id}}" form="post-edit-form-{{p.id}}" class="comment-box form-control rounded" aria-label="With textarea" placeholder="Add text to your post..." rows="10" data-id="{{p.id}}">{{p.body}}</textarea>
|
||||
<textarea autocomplete="off" name="body" {% if v.longpost %}minlength="280"{% endif %} maxlength="{% if v.bird %}140{% else %}20000{% endif %}" oninput="markdown('post-edit-box-{{p.id}}', 'post-edit-{{p.id}}');charLimit('post-edit-box-{{p.id}}','charcount-post-edit')" id="post-edit-box-{{p.id}}" form="post-edit-form-{{p.id}}" class="comment-box form-control rounded" aria-label="With textarea" placeholder="Add text to your post..." rows="10" data-id="{{p.id}}">{{p.body}}</textarea>
|
||||
|
||||
<div class="text-small font-weight-bold mt-1" id="charcount-post-edit" style="right: 1rem; bottom: 0.5rem; z-index: 3;"></div>
|
||||
|
||||
|
|
|
@ -200,7 +200,7 @@
|
|||
</div>
|
||||
|
||||
<h5 class="card-title post-title text-left w-lg-95 mb-0 pb-0 pb-md-1"><a {% if v and v.newtab and not g.webview %}target="_blank"{% endif %} href="{{p.permalink}}" class="stretched-link {% if p.author.agendaposter %}agendaposter{% endif %}">
|
||||
{% if p.club %}<span class="patron font-weight-bolder mr-1" style="background-color:red; font-size:12px; line-height:2;">{{cc}}</span>{% endif %}
|
||||
{% if p.club %}<span class="patron font-weight-bolder mr-1" style="background-color:red; font-size:12px; line-height:2;">{{CC}}</span>{% endif %}
|
||||
{% if p.flair %}<span class="patron font-weight-bolder mr-1" style="background-color:var(--primary); font-size:12px; line-height:2;">{{p.flair | safe}}</span>{% endif %}
|
||||
{{p.realtitle(v) | safe}}
|
||||
</a></h5>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
{% block stylesheets %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=86"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=12">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=87"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=12">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -50,7 +50,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{'DEFAULT_COLOR' | app_config}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=86">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=87">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{'DEFAULT_THEME' | app_config}}.css?a=12">
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
@ -106,10 +106,10 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<label for="body" class="mt-3">Text<i class="fas fa-info-circle text-gray-400 ml-1" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="Uses markdown. Limited to 10000 characters."></i></label>
|
||||
<label for="body" class="mt-3">Text<i class="fas fa-info-circle text-gray-400 ml-1" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="Uses markdown. Limited to 20000 characters."></i></label>
|
||||
|
||||
<div>
|
||||
<textarea form="submitform" id="post-text" class="form-control rounded" aria-label="With textarea" placeholder="Optional if you have a link or an image." rows="7" name="body" oninput="markdown('post-text','preview');charLimit('post-text','character-count-submit-text-form');checkForRequired();savetext()" {% if v.longpost %}minlength="280"{% endif %} maxlength="{% if v.bird %}140{% else %}10000{% endif %}" required></textarea>
|
||||
<textarea form="submitform" id="post-text" class="form-control rounded" aria-label="With textarea" placeholder="Optional if you have a link or an image." rows="7" name="body" oninput="markdown('post-text','preview');charLimit('post-text','character-count-submit-text-form');checkForRequired();savetext()" {% if v.longpost %}minlength="280"{% endif %} maxlength="{% if v.bird %}140{% else %}20000{% endif %}" required></textarea>
|
||||
|
||||
<div class="btn btn-secondary fl-r mt-3" onclick="document.getElementById('preview').classList.toggle('d-none');">
|
||||
Toggle preview
|
||||
|
@ -160,7 +160,7 @@
|
|||
{% if v.club_allowed != False %}
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="clubCheck" name="club">
|
||||
<label class="custom-control-label" for="clubCheck">{{cc}} thread</label>
|
||||
<label class="custom-control-label" for="clubCheck">{{CC_TITLE}} thread</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
<pre>
|
||||
|
|
Loading…
Reference in New Issue