fds
This commit is contained in:
parent
cd758ef2c7
commit
694dfca0a4
23 changed files with 101 additions and 159 deletions
|
@ -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}
|
Loading…
Add table
Add a link
Reference in a new issue