same as last comit

pull/150/head
Aevann 2023-05-16 03:07:35 +03:00
parent 4c14e10cf4
commit 814bf0a5f3
5 changed files with 17 additions and 5 deletions

View File

@ -29,6 +29,12 @@ class Flag(Base):
def realreason(self, v):
return censor_slurs(self.reason, v)
#lazy hack to avoid having to rename the comment_id column and causing potential new bugs
@property
@lazy
def parent_id(self):
return self.post_id
class CommentFlag(Base):
__tablename__ = "commentflags"
@ -50,3 +56,9 @@ class CommentFlag(Base):
@lazy
def realreason(self, v):
return censor_slurs(self.reason, v)
#lazy hack to avoid having to rename the comment_id column and causing potential new bugs
@property
@lazy
def parent_id(self):
return self.comment_id

View File

@ -235,7 +235,7 @@
{% endif %}
</div>
{{macros.flags(c)}}
{{macros.flags(c, 'comment')}}
{% if c.is_banned and c.ban_reason %}
<div id="comment-banned-warning" class="comment-text text-removed mb-0">removed by @{{c.ban_reason}} (Admin)</div>

View File

@ -77,7 +77,7 @@
{{macros.post_meta(p)}}
</div>
{{macros.flags(p)}}
{{macros.flags(p, 'post')}}
{% if p.realurl(v) and not v_forbid_deleted %}
<h1 id="post-title" class="card-title post-title text-left mb-md-3 {% if p.author.agendaposter and p.sub != 'chudrama' %}text-uppercase{% endif %}">

View File

@ -26,7 +26,7 @@
{% set v_forbid_deleted = (p.deleted_utc != 0 or p.is_banned) and not (v and v.admin_level >= PERMS['POST_COMMENT_MODERATION']) and not (v and v.id == p.author_id) %}
{{macros.flags(p)}}
{{macros.flags(p, 'post')}}
<div id="post-{{p.id}}" class="actual-post {% if p.ghost %}ghost-post{% endif %} {% if p.unread %}unread{% else %}card{% endif %} {% if p.is_banned %} banned{% endif %}{% if p.deleted_utc %} deleted{% endif %}{% if p.stickied %} stickied{% endif %}{% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}{% if p.over_18 %} nsfw{% endif %}">

View File

@ -197,7 +197,7 @@
{% endif %}
{% endmacro %}
{% macro flags(i) %}
{% macro flags(i, kind) %}
{% if i.active_flags(v) %}
<div id="flaggers-{{i.id}}" class="flaggers d-none">
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
@ -210,7 +210,7 @@
<a style="font-weight:bold" href="{{f.user.url}}">{{f.user.username}}</a>
{% if f.reason %}: {{f.realreason(v) | safe}}{% endif %}
{% if v and v.admin_level >= PERMS['FLAGS_REMOVE'] %}
<button type="button" data-nonce="{{g.nonce}}" data-onclick="delReport(this,'/del_report/comment/{{f.comment_id}}/{{f.user_id}}')">[remove]</button>
<button type="button" data-nonce="{{g.nonce}}" data-onclick="delReport(this,'/del_report/{{kind}}/{{f.parent_id}}/{{f.user_id}}')">[remove]</button>
{% endif %}
</li>
{% endfor %}