remotes/1693045480750635534/spooky-22
Aevann1 2022-04-06 23:53:14 +02:00
parent 430e1dab71
commit 3af80e37e9
2 changed files with 6 additions and 1 deletions

View File

@ -435,6 +435,11 @@ class User(Base):
def reddit_notifications_count(self):
return g.db.query(Notification.user_id).join(Comment).filter(Notification.user_id == self.id, Notification.read == False, Comment.is_banned == False, Comment.deleted_utc == 0, Comment.body_html.like('<html><body><p>New rdrama mention: <a href="https://old.reddit.com/r/%')).count()
@property
@lazy
def normal_count(self):
return notifications_count - post_notifications_count - reddit_notifications_count
@property
@lazy
def do_posts(self):

View File

@ -17,7 +17,7 @@
<ul class="nav settings-nav" style="padding:0 0 0 20px">
<li class="nav-item">
<a class="nav-link py-3{% if not '=true' in request.full_path %} active{% endif %}" href="/notifications">
All {% if v.not_post_notifications_count %} <span class="font-weight-bold" style="color:red">({{v.not_post_notifications_count}})</span>{% endif %}
All {% if v.normal_count %} <span class="font-weight-bold" style="color:red">({{v.normal_count}})</span>{% endif %}
</a>
</li>
<li class="nav-item">