forked from rDrama/rDrama
do this https://rdrama.net/post/18459/marseycapywalking-megathread-for-bugs-and-suggestions/4541135#context
parent
7f6a45a5b6
commit
6a19105bdc
|
@ -359,9 +359,6 @@ class Comment(Base):
|
|||
body = body.replace(f'"{url}"', f'"{url_noquery}?{urlencode(p, True)}"')
|
||||
body = body.replace(f'>{url}<', f'>{url_noquery}?{urlencode(p, True)}<')
|
||||
|
||||
if not self.ghost and self.author.show_sig(v):
|
||||
body += f'<section id="signature-{self.author.id}" class="user-signature"><hr>{self.author.sig_html}</section>'
|
||||
|
||||
return body
|
||||
|
||||
@lazy
|
||||
|
|
|
@ -296,7 +296,7 @@ class Post(Base):
|
|||
return False
|
||||
|
||||
@lazy
|
||||
def realbody(self, v, listing=False):
|
||||
def realbody(self, v):
|
||||
if self.deleted_utc != 0 and not (v and (v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or v.id == self.author.id)): return "[Deleted by user]"
|
||||
if self.is_banned and not (v and v.admin_level >= PERMS['POST_COMMENT_MODERATION']) and not (v and v.id == self.author.id): return ""
|
||||
|
||||
|
@ -309,9 +309,6 @@ class Post(Base):
|
|||
|
||||
body = normalize_urls_runtime(body, v)
|
||||
|
||||
if not listing and not self.ghost and self.author.show_sig(v):
|
||||
body += f'<section id="signature-{self.author.id}" class="user-signature"><hr>{self.author.sig_html}</section>'
|
||||
|
||||
return body
|
||||
|
||||
@lazy
|
||||
|
|
|
@ -1177,19 +1177,6 @@ class User(Base):
|
|||
def winnings(self):
|
||||
return g.db.query(func.sum(CasinoGame.winnings)).filter(CasinoGame.user_id == self.id).one()[0] or 0
|
||||
|
||||
@lazy
|
||||
def show_sig(self, v):
|
||||
if not self.sig_html:
|
||||
return False
|
||||
|
||||
if not self.patron:
|
||||
return False
|
||||
|
||||
if v and (v.sigs_disabled or v.poor):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def user_name(self):
|
||||
|
@ -1311,6 +1298,17 @@ class User(Base):
|
|||
x = sorted(self.badges, key=badge_ordering_func)
|
||||
return x
|
||||
|
||||
@lazy
|
||||
def rendered_sig(self, v):
|
||||
if not self.sig_html or not self.patron:
|
||||
return ''
|
||||
|
||||
if v and (v.sigs_disabled or v.poor):
|
||||
return ''
|
||||
|
||||
return f'<section id="signature-{self.id}" class="user-signature"><hr>{self.sig_html}</section>'
|
||||
|
||||
|
||||
badge_ordering_tuple = (
|
||||
22, 23, 24, 25, 26, 27, 28, #paypig
|
||||
257, 258, 259, 260, 261, #lifetime donation
|
||||
|
|
|
@ -249,6 +249,11 @@
|
|||
<div id="comment-text-{{c.id}}" class="comment-text mb-0 {% if c.chudded %}text-uppercase chud-img chud-{{c.id_last_num}}{% endif %} {% if c.author.rainbow %}rainbow-text{% endif %} {%if c.author.queen%}queen{%endif%} {%if c.author.sharpen%}sharpen chud-img sharpen-{{c.id_last_num}}{%endif%}">
|
||||
{{realbody | safe}}
|
||||
</div>
|
||||
|
||||
{% if not c.ghost %}
|
||||
{{c.author.rendered_sig(v) | safe}}
|
||||
{% endif %}
|
||||
|
||||
{% if c.parent_post or c.wall_user_id %}
|
||||
|
||||
{% if v and v.id==c.author_id %}
|
||||
|
|
|
@ -147,6 +147,9 @@
|
|||
<div class="text-removed mb-0">removed by @{{p.ban_reason}} (Admin)</div>
|
||||
{% endif %}
|
||||
|
||||
{% if not p.ghost %}
|
||||
{{p.author.rendered_sig(v) | safe}}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
<div class="post-actions d-mob-none">
|
||||
<div class="d-flex" style="flex-basis:146px"></div>
|
||||
<ul class="list-inline text-right d-flex">
|
||||
{% if p.realbody(v, listing=True) %}
|
||||
{% if p.realbody(v) %}
|
||||
<button type="button" class="list-inline-item ml-2" data-nonce="{{g.nonce}}" data-onclick="expandText('{{p.id}}')"><i class="fas fa-expand-alt mx-0 text-expand-icon-{{p.fullname}}"></i></button>
|
||||
{% endif %}
|
||||
<a class="list-inline-item" {% if v and v.newtab %}data-target="t" target="_blank"{% endif %} href="{{p.permalink}}">
|
||||
|
@ -134,7 +134,7 @@
|
|||
|
||||
</li>
|
||||
|
||||
{% if p.realbody(v, listing=True) %}
|
||||
{% if p.realbody(v) %}
|
||||
<button type="button" class="list-inline-item ml-2" data-nonce="{{g.nonce}}" data-onclick="expandText('{{p.id}}')"><i class="fas fa-expand-alt mx-0 text-expand-icon-{{p.fullname}}"></i></button>
|
||||
{% endif %}
|
||||
|
||||
|
@ -207,9 +207,9 @@
|
|||
|
||||
|
||||
{% if not v_forbid_deleted %}
|
||||
{% if p.realbody(v, listing=True) %}
|
||||
{% if p.realbody(v) %}
|
||||
<div class="d-none card rounded border {% if p.chudded %}text-uppercase chud-img chud-{{p.id_last_num}}{% endif %} {% if p.author.rainbow %}rainbow-text{% endif %} {%if p.author.queen%}queen{%endif%} {%if p.author.sharpen%}sharpen{%endif%} post-preview" id="post-text-{{p.id}}">
|
||||
{{p.realbody(v, listing=True) | safe}}
|
||||
{{p.realbody(v) | safe}}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
|
Loading…
Reference in New Issue