forked from MarseyWorld/MarseyWorld
Merge pull request #103 from TheCaringCleaner/ban-links
transform post/comment links in ban reasonmaster
commit
f33b3a33b9
|
@ -202,6 +202,12 @@ class User(Base):
|
|||
def age(self):
|
||||
return int(time.time()) - self.created_utc
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def ban_reason_link(self):
|
||||
if self.ban_reason and (self.ban_reason.startswith("/post/") or self.ban_reason.startswith("/comment/")):
|
||||
return self.ban_reason.split(" ", 1)[0]
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def alts_unique(self):
|
||||
|
|
|
@ -122,7 +122,11 @@
|
|||
</div>
|
||||
<div class="ml-3 w-100">
|
||||
{% if u.is_suspended %}
|
||||
<h5 style="color:#ff66ac;">BANNED USER{% if u.ban_reason %}: {{u.ban_reason}}{% endif %}</h5>
|
||||
<h5 style="color:#ff66ac;">BANNED USER{% if u.ban_reason %}:
|
||||
{% if u.ban_reason_link %}<a href="{{ u.ban_reason_link }}"><i class="fas fa-link"></i>{% endif %}
|
||||
{{ u.ban_reason }}
|
||||
{% if u.ban_reason_link %}</a>{% endif %}
|
||||
{% endif %}</h5>
|
||||
{% if u.unban_utc %}<h5 style="color:#ff66ac;">{{u.unban_string}}</h5>{% endif %}
|
||||
{% endif %}
|
||||
<div class="d-flex align-items-center mt-1 mb-2">
|
||||
|
|
Loading…
Reference in New Issue