fdfd
This commit is contained in:
parent
76dd80e2e1
commit
1d68543551
4 changed files with 43 additions and 37 deletions
|
@ -37,6 +37,7 @@ services:
|
|||
- READ_ONLY=0
|
||||
- BOT_DISABLE=0
|
||||
- COINS_NAME=Dramacoins
|
||||
- DEFAULT_TIME_FILTER=day
|
||||
- DEFAULT_THEME=dark
|
||||
- DEFAULT_COLOR=ff66ac #YOU HAVE TO PICK ONE OF THOSE COLORS OR SHIT WILL BREAK: ff66ac, 805ad5, 62ca56, 38a169, 80ffff, 2a96f3, eb4963, ff0000, f39731, 30409f, 3e98a7, e4432d, 7b9ae4, ec72de, 7f8fa6, f8db58
|
||||
- SLOGAN=Dude bussy lmao
|
||||
|
|
|
@ -19,6 +19,8 @@ from files.helpers.security import *
|
|||
site = environ.get("DOMAIN").strip()
|
||||
defaulttheme = environ.get("DEFAULT_THEME", "light").strip()
|
||||
defaultcolor = environ.get("DEFAULT_COLOR", "fff").strip()
|
||||
defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "day").strip()
|
||||
|
||||
class User(Base, Stndrd, Age_times):
|
||||
__tablename__ = "users"
|
||||
id = Column(Integer, primary_key=True)
|
||||
|
@ -86,7 +88,7 @@ class User(Base, Stndrd, Age_times):
|
|||
stored_subscriber_count = Column(Integer, default=0)
|
||||
defaultsortingcomments = Column(String, default="top")
|
||||
defaultsorting = Column(String, default="hot")
|
||||
defaulttime = Column(String, default="day")
|
||||
defaulttime = Column(String, default=defaulttimefilter)
|
||||
|
||||
is_nofollow = Column(Boolean, default=False)
|
||||
custom_filter_list = Column(String(1000))
|
||||
|
|
|
@ -4,6 +4,8 @@ from files.helpers.get import *
|
|||
from files.__main__ import app, cache
|
||||
from files.classes.submission import Submission
|
||||
|
||||
defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "day").strip()
|
||||
|
||||
@app.get("/post/")
|
||||
def slash_post():
|
||||
return redirect("/")
|
||||
|
@ -207,7 +209,7 @@ def front_all(v):
|
|||
defaulttime = v.defaulttime
|
||||
else:
|
||||
defaultsorting = "hot"
|
||||
defaulttime = "day"
|
||||
defaulttime = defaulttimefilter
|
||||
|
||||
sort=request.args.get("sort", defaultsorting)
|
||||
t=request.args.get('t', defaulttime)
|
||||
|
@ -409,7 +411,7 @@ def all_comments(v):
|
|||
page = int(request.args.get("page", 1))
|
||||
|
||||
sort=request.args.get("sort", "new")
|
||||
t=request.args.get("t", "day")
|
||||
t=request.args.get("t", defaulttimefilter)
|
||||
|
||||
idlist = comment_idlist(v=v,
|
||||
page=page,
|
||||
|
|
|
@ -871,6 +871,7 @@ def submit_post(v):
|
|||
n = Notification(comment_id=c_jannied.id, user_id=v.id)
|
||||
g.db.add(n)
|
||||
|
||||
if "rdrama" in request.host or new_post.url:
|
||||
c = Comment(author_id=261,
|
||||
distinguish_level=6,
|
||||
parent_submission=new_post.id,
|
||||
|
@ -883,7 +884,7 @@ def submit_post(v):
|
|||
g.db.add(c)
|
||||
g.db.flush()
|
||||
|
||||
new_post.comment_count = g.db.query(Comment).filter_by(parent_submission=new_post.id).count()
|
||||
new_post.comment_count = 1
|
||||
g.db.add(new_post)
|
||||
|
||||
if "rdrama" in request.host:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue