remotes/1693045480750635534/spooky-22
Aevann1 2022-05-08 07:14:24 +02:00
parent 13bbc0cd19
commit 666870e0a3
4 changed files with 9 additions and 6 deletions

View File

@ -3,6 +3,7 @@ from .get import *
from os import listdir, environ
from .const import *
import time
from datetime import datetime
@app.template_filter("post_embed")
def post_embed(id, v):
@ -49,4 +50,4 @@ def timestamp(timestamp):
@app.context_processor
def inject_constants():
return {"environ":environ, "SITE":SITE, "SITE_NAME":SITE_NAME, "SITE_FULL":SITE_FULL, "AUTOJANNY_ID":AUTOJANNY_ID, "NOTIFICATIONS_ID":NOTIFICATIONS_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID, "PIZZASHILL_ID":PIZZASHILL_ID, "config":app.config.get, "DEFAULT_COLOR":DEFAULT_COLOR, "COLORS":COLORS, "ADMIGGERS":ADMIGGERS}
return {"environ":environ, "SITE":SITE, "SITE_NAME":SITE_NAME, "SITE_FULL":SITE_FULL, "AUTOJANNY_ID":AUTOJANNY_ID, "NOTIFICATIONS_ID":NOTIFICATIONS_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID, "PIZZASHILL_ID":PIZZASHILL_ID, "config":app.config.get, "DEFAULT_COLOR":DEFAULT_COLOR, "COLORS":COLORS, "ADMIGGERS":ADMIGGERS, "datetime":datetime}

View File

@ -496,7 +496,7 @@ def api_comment(v):
g.db.add(n)
if SITE_NAME == 'rDrama' and len(c.body) >= 1000 and "<" not in body and "</blockquote>" not in body_html:
if SITE_NAME == 'rDrama' and len(c.body.split()) >= 200 and "<" not in body and "</blockquote>" not in body_html:
body = random.choice(LONGPOST_REPLIES)

View File

@ -901,6 +901,4 @@ def settings(v):
@app.get("/settings/profile")
@auth_required
def settings_profile(v):
if v.flairchanged: ti = datetime.utcfromtimestamp(v.flairchanged).strftime('%Y-%m-%d %H:%M:%S')
else: ti = ''
return render_template("settings_profile.html", v=v, ti=ti)
return render_template("settings_profile.html", v=v)

View File

@ -448,7 +448,11 @@
<label class="text-black w-lg-25">Flair</label>
<div class="w-lg-100">
{% if v.flairchanged %}
{% set ti = datetime.utcfromtimestamp(v.flairchanged).strftime('%Y-%m-%d %H:%M:%S') %}
{% endif %}
<form id="profile-settings" action="/settings/title_change" method="post">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<input maxlength=100 {% if v.flairchanged %}disabled{% endif %} autocomplete="off" id="customtitlebody" type="text" name="title" class="form-control" placeholder='Enter a flair here' value="{% if v.flairchanged %}Your flair has been locked until {{ti}}{% elif v.customtitleplain %}{{v.customtitleplain}}{% endif %}">