master
CaringCleaner 2021-11-24 15:33:41 +00:00
parent e1c89e694e
commit 7fdf0ad348
2 changed files with 14 additions and 1 deletions

View File

@ -199,6 +199,15 @@ class User(Base):
def age(self): def age(self):
return int(time.time()) - self.created_utc return int(time.time()) - self.created_utc
@property
@lazy
def ban_reason_link(self):
if not self.ban_reason:
return self.ban_reason
if self.ban_reason.startswith("/post/") or self.ban_reason.startswith("/comment/"):
return self.ban_reason.split(" ", 1)[0]
@property @property
@lazy @lazy
def alts_unique(self): def alts_unique(self):

View File

@ -122,7 +122,11 @@
</div> </div>
<div class="ml-3 w-100"> <div class="ml-3 w-100">
{% if u.is_suspended %} {% 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 %} {% if u.unban_utc %}<h5 style="color:#ff66ac;">{{u.unban_string}}</h5>{% endif %}
{% endif %} {% endif %}
<div class="d-flex align-items-center mt-1 mb-2"> <div class="d-flex align-items-center mt-1 mb-2">