remotes/1693045480750635534/spooky-22
Aevann1 2021-12-21 01:50:02 +02:00
parent 3490ad533f
commit de21363ca6
2 changed files with 6 additions and 2 deletions

View File

@ -377,6 +377,10 @@ class User(Base):
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()
@property
@lazy
def not_post_notifications_count(self):
return self.notifications_count - self.post_notifications_count
@property
@lazy

View File

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