forked from rDrama/rDrama
refactor sigs
parent
bb28d2d2a3
commit
f7727f1029
|
@ -383,7 +383,7 @@ class Comment(Base):
|
||||||
body += f'''><label class="custom-control-label" for="comment-{o.id}">{o.body_html} -
|
body += f'''><label class="custom-control-label" for="comment-{o.id}">{o.body_html} -
|
||||||
<a href="/votes/comment/option/{o.id}"><span id="score-comment-{o.id}">{o.upvotes}</span> votes</a></label></div>'''
|
<a href="/votes/comment/option/{o.id}"><span id="score-comment-{o.id}">{o.upvotes}</span> votes</a></label></div>'''
|
||||||
|
|
||||||
if self.author.sig_html and (self.author_id == MOOSE_ID or (not self.ghost and not (v and (v.sigs_disabled or v.poor)))):
|
if not self.ghost and self.author.show_sig(v):
|
||||||
body += f"<hr>{self.author.sig_html}"
|
body += f"<hr>{self.author.sig_html}"
|
||||||
|
|
||||||
return body
|
return body
|
||||||
|
|
|
@ -396,8 +396,7 @@ class Submission(Base):
|
||||||
<a href="/votes/post/option/{o.id}"><span id="score-post-{o.id}">{o.upvotes}</span> votes</a></label></div>'''
|
<a href="/votes/post/option/{o.id}"><span id="score-post-{o.id}">{o.upvotes}</span> votes</a></label></div>'''
|
||||||
|
|
||||||
|
|
||||||
|
if not listing and not self.ghost and self.author.show_sig(v):
|
||||||
if not listing and self.author.sig_html and (self.author_id == MOOSE_ID or (not self.ghost and not (v and (v.sigs_disabled or v.poor)))):
|
|
||||||
body += f"<hr>{self.author.sig_html}"
|
body += f"<hr>{self.author.sig_html}"
|
||||||
|
|
||||||
return body
|
return body
|
||||||
|
|
|
@ -935,3 +935,16 @@ class User(Base):
|
||||||
from_casino_value = from_casino or 0
|
from_casino_value = from_casino or 0
|
||||||
|
|
||||||
return from_casino_value + self.total_lottery_winnings
|
return from_casino_value + self.total_lottery_winnings
|
||||||
|
|
||||||
|
@lazy
|
||||||
|
def show_sig(self, v):
|
||||||
|
if not self.author.sig_html:
|
||||||
|
return False
|
||||||
|
|
||||||
|
if not self.author.patron and SITE_NAME != 'WPD':
|
||||||
|
return False
|
||||||
|
|
||||||
|
if v and (v.sigs_disabled or v.poor):
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
|
@ -188,7 +188,6 @@ PIZZA_VOTERS = ()
|
||||||
IDIO_ID = 0
|
IDIO_ID = 0
|
||||||
CARP_ID = 0
|
CARP_ID = 0
|
||||||
JOAN_ID = 0
|
JOAN_ID = 0
|
||||||
MOOSE_ID = 0
|
|
||||||
AEVANN_ID = 0
|
AEVANN_ID = 0
|
||||||
SNAKES_ID = 0
|
SNAKES_ID = 0
|
||||||
HOMO_ID = 0
|
HOMO_ID = 0
|
||||||
|
@ -242,7 +241,6 @@ if SITE == 'rdrama.net':
|
||||||
IDIO_ID = 30
|
IDIO_ID = 30
|
||||||
CARP_ID = 995
|
CARP_ID = 995
|
||||||
JOAN_ID = 28
|
JOAN_ID = 28
|
||||||
MOOSE_ID = 1904
|
|
||||||
AEVANN_ID = 1
|
AEVANN_ID = 1
|
||||||
SNAKES_ID = 10288
|
SNAKES_ID = 10288
|
||||||
HOMO_ID = 147
|
HOMO_ID = 147
|
||||||
|
|
|
@ -51,7 +51,7 @@ def timestamp(timestamp):
|
||||||
def inject_constants():
|
def inject_constants():
|
||||||
return {"environ":environ, "SITE":SITE, "SITE_NAME":SITE_NAME, "SITE_FULL":SITE_FULL,
|
return {"environ":environ, "SITE":SITE, "SITE_NAME":SITE_NAME, "SITE_FULL":SITE_FULL,
|
||||||
"AUTOJANNY_ID":AUTOJANNY_ID, "PUSHER_ID":PUSHER_ID,
|
"AUTOJANNY_ID":AUTOJANNY_ID, "PUSHER_ID":PUSHER_ID,
|
||||||
"CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID,
|
"CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "AEVANN_ID":AEVANN_ID,
|
||||||
"PIZZASHILL_ID":PIZZASHILL_ID, "DEFAULT_COLOR":DEFAULT_COLOR,
|
"PIZZASHILL_ID":PIZZASHILL_ID, "DEFAULT_COLOR":DEFAULT_COLOR,
|
||||||
"COLORS":COLORS, "time":time, "PERMS":PERMS, "FEATURES":FEATURES,
|
"COLORS":COLORS, "time":time, "PERMS":PERMS, "FEATURES":FEATURES,
|
||||||
"HOLE_NAME":HOLE_NAME, "HOLE_STYLE_FLAIR":HOLE_STYLE_FLAIR, "HOLE_REQUIRED":HOLE_REQUIRED,
|
"HOLE_NAME":HOLE_NAME, "HOLE_STYLE_FLAIR":HOLE_STYLE_FLAIR, "HOLE_REQUIRED":HOLE_REQUIRED,
|
||||||
|
|
|
@ -129,7 +129,7 @@ def settings_profile_post(v):
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
return render_template("settings_profile.html", v=v, msg="Your enemies list has been updated.")
|
return render_template("settings_profile.html", v=v, msg="Your enemies list has been updated.")
|
||||||
|
|
||||||
elif (v.patron or v.id == MOOSE_ID) and request.values.get("sig"):
|
elif v.patron and request.values.get("sig"):
|
||||||
sig = request.values.get("sig")[:200].replace('\n','').replace('\r','')
|
sig = request.values.get("sig")[:200].replace('\n','').replace('\r','')
|
||||||
|
|
||||||
sig_html = sanitize(sig)
|
sig_html = sanitize(sig)
|
||||||
|
|
Loading…
Reference in New Issue