From 1efc3aec6313e0353937b67d6fbc25f854eb52aa Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 11 Dec 2021 01:29:35 +0200 Subject: [PATCH] dsfsfd --- files/classes/user.py | 17 ++++++++++++++++- files/templates/award_modal.html | 1 - files/templates/comments.html | 4 ++-- files/templates/submission.html | 2 +- files/templates/submission_listing.html | 4 ++-- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index 2b8f53e30..c8c6b26e1 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -423,6 +423,21 @@ class User(Base): if "rama" in site: return f"https://{site}/assets/images/defaultpictures/{random.randint(1, 150)}.webp?v=1" return f"https://{site}/assets/images/default-profile-pic.webp" + @property + @lazy + def json_popover(self): + data = {'username': self.username, + 'url': self.url, + 'profile_url': self.profile_url, + 'bannerurl': self.banner_url, + 'bio_html': self.bio_html_eager, + 'coins': self.coins, + 'post_count': self.post_count, + 'comment_count': self.comment_count, + } + + return data + @property @lazy def json_raw(self): @@ -462,7 +477,7 @@ class User(Base): data = self.json_core data["badges"] = [x.json_core for x in self.badges] - data['coins'] = int(self.coins) + data['coins'] = self.coins data['post_count'] = self.post_count data['comment_count'] = self.comment_count diff --git a/files/templates/award_modal.html b/files/templates/award_modal.html index 0530af742..141b9848c 100644 --- a/files/templates/award_modal.html +++ b/files/templates/award_modal.html @@ -1,5 +1,4 @@ -