From 6f6d65b66341e33428f6e857c6efd778900c564e Mon Sep 17 00:00:00 2001 From: Julien Constant Date: Tue, 14 Mar 2023 11:54:30 +0100 Subject: [PATCH] Fix notification (details in description) - Fix the dot being displayed when the user has 0 notifications. - Added a message when there is no unread notification to be displayed. --- core/static/core/navbar.scss | 5 +++++ core/templates/core/base.jinja | 40 +++++++++++++++++++-------------- locale/fr/LC_MESSAGES/django.po | 4 ++++ 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/core/static/core/navbar.scss b/core/static/core/navbar.scss index 6bf6521b..d3c1d4a4 100644 --- a/core/static/core/navbar.scss +++ b/core/static/core/navbar.scss @@ -304,6 +304,11 @@ font-size: .8em; } } + + &.empty-notification { + text-align: center; + font-style: italic; + } } } diff --git a/core/templates/core/base.jinja b/core/templates/core/base.jinja index 1d03f01f..3e31d280 100644 --- a/core/templates/core/base.jinja +++ b/core/templates/core/base.jinja @@ -96,6 +96,7 @@
+ {% if user.notifications.filter(viewed=False).count() > 0 %} {% if user.notifications.filter(viewed=False).count() < 100 %} {{ user.notifications.filter(viewed=False).count() }} @@ -103,26 +104,31 @@   {% endif %} + {% endif %}