diff --git a/files/classes/user.py b/files/classes/user.py index ac1e6e882..0f46e4078 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -688,6 +688,11 @@ class User(Base): def muting_count(self): return g.db.query(UserMute).filter_by(target_id=self.id).count() + @property + @lazy + def chat_count(self): + return g.db.query(ChatMembership).filter_by(user_id=self.id).count() + @property @lazy def bio_html_eager(self): diff --git a/files/templates/userpage/banner.html b/files/templates/userpage/banner.html index 713019af0..3f6c4f44a 100644 --- a/files/templates/userpage/banner.html +++ b/files/templates/userpage/banner.html @@ -90,9 +90,6 @@ Hates | Voted | Bank Statement - {% if v.admin_level >= PERMS['VIEW_CHATS'] %} - | Chats - {% endif %}
@@ -107,6 +104,10 @@ {{u.muting_count|commas}} muter{{'s' if u.muting_count != 1 else ''}} | mutes {{u.mute_count|commas}} user{{'s' if u.mute_count != 1 else ''}} + + {% if v.admin_level >= PERMS['VIEW_CHATS'] %} + | member of {{u.chat_count|commas}} chat{{'s' if u.chat_count != 1 else ''}} + {% endif %}
{{u.coins|commas}} @@ -399,9 +400,6 @@ Hates | Voted | Bank Statement - {% if v.admin_level >= PERMS['VIEW_CHATS'] %} - | Chats - {% endif %}
@@ -417,21 +415,29 @@ blocks {{u.block_count|commas}} user{{'s' if u.block_count != 1 else ''}}
-
+
{{u.muting_count|commas}} muter{{'s' if u.muting_count != 1 else ''}} mutes {{u.mute_count|commas}} user{{'s' if u.mute_count != 1 else ''}}
- {{u.coins|commas}} - coins - - {% if FEATURES['MARSEYBUX'] %} - {{u.marseybux|commas}} - marseybux + {% if v.admin_level >= PERMS['VIEW_CHATS'] %} +
+ member of {{u.chat_count|commas}} chat{{'s' if u.chat_count != 1 else ''}} +
{% endif %} -
Joined +
+ {{u.coins|commas}} + coins + + {% if FEATURES['MARSEYBUX'] %} + {{u.marseybux|commas}} + marseybux + {% endif %} +
+ + Joined {% if v and v.admin_level >= PERMS['VIEW_LAST_ACTIVE'] -%}
last active