diff --git a/tildes/scss/modules/_site-header.scss b/tildes/scss/modules/_site-header.scss index d095a6d..77baeae 100644 --- a/tildes/scss/modules/_site-header.scss +++ b/tildes/scss/modules/_site-header.scss @@ -41,4 +41,15 @@ } margin-left: auto; + + &.badge { + margin-right: 0.6rem; + + &[data-badge]::after { + background-color: $orange; + font-size: 0.5rem; + height: 0.7rem; + transform: translate(50%, -40%); + } + } } diff --git a/tildes/tildes/models/user/user.py b/tildes/tildes/models/user/user.py index dd9dddc..a27d0dd 100644 --- a/tildes/tildes/models/user/user.py +++ b/tildes/tildes/models/user/user.py @@ -179,3 +179,8 @@ class User(DatabaseModel): # convert the address to lowercase to avoid potential casing issues value = value.lower() self.email_address_hash = hash_string(value) + + @property + def num_unread_total(self) -> int: + """Return total number of unread items (notifications + messages).""" + return self.num_unread_messages + self.num_unread_notifications diff --git a/tildes/tildes/templates/base.jinja2 b/tildes/tildes/templates/base.jinja2 index 799a54b..e299d41 100644 --- a/tildes/tildes/templates/base.jinja2 +++ b/tildes/tildes/templates/base.jinja2 @@ -49,7 +49,18 @@ {{ logged_in_user_info() }} - + +