master
Aevann1 2022-01-19 12:07:11 +02:00
parent 91ab1f2da3
commit 81b4d603a5
3 changed files with 29 additions and 27 deletions

View File

@ -2,8 +2,6 @@ from os import environ, listdir
import re
from copy import deepcopy
from json import loads
from files.__main__ import app
from .get import get_post
SITE = environ.get("DOMAIN", '').strip()
SITE_NAME = environ.get("SITE_NAME", '').strip()
@ -795,26 +793,3 @@ NOTIFIED_USERS = {
num_banners = len(listdir('files/assets/images/Drama/banners')) + 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}

View File

@ -0,0 +1,27 @@
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"{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}

View File

@ -1,7 +1,7 @@
import html
from .front import frontlist
from datetime import datetime
from files.helpers.const import *
from files.helpers.jinja2 import full_link
from files.helpers.get import *
from yattag import Doc
from files.helpers.wrappers import *