This commit is contained in:
Aevann1 2021-12-21 01:50:02 +02:00
parent 68e40e3b73
commit 88d574e166
2 changed files with 6 additions and 2 deletions

View file

@ -377,6 +377,10 @@ class User(Base):
def post_notifications_count(self): def post_notifications_count(self):
return g.db.query(Notification.id).join(Comment).filter(Notification.user_id == self.id, Notification.read == False, Comment.author_id == AUTOJANNY_ID).count() return g.db.query(Notification.id).join(Comment).filter(Notification.user_id == self.id, Notification.read == False, Comment.author_id == AUTOJANNY_ID).count()
@property
@lazy
def not_post_notifications_count(self):
return self.notifications_count - self.post_notifications_count
@property @property
@lazy @lazy

View file

@ -16,8 +16,8 @@
<div class="col p-0 w-100"> <div class="col p-0 w-100">
<ul class="nav settings-nav" style="padding:0 30px;"> <ul class="nav settings-nav" style="padding:0 30px;">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link py-3{% if not '=true' in request.full_path %} active{% endif %}" href="/notifications"> <a class="nav-link py-3{% if not '=true' in request.full_path %} active{% endif %}" href="/notifications?posts=true">
All All{% if v.not_post_notifications_count %} <span class="text-primary font-weight-bold">({{v.not_post_notifications_count}})</span>{% endif %}
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">