changeset 7444:3e6f0b5815d8

templates: remove notification count from user profile button This commit is part of the removal of the UI notification feature from Kallithea, which is not deemed useful in its current form. Only email notifications are preserved. This commit removes the notification count 'badge' next to the username top-right, and the count in the expanded field when clicking that username.
author Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
date Tue, 04 Dec 2018 21:32:57 +0100
parents 5d7c1f73a5b8
children a33d1337db05
files kallithea/lib/base.py kallithea/templates/base/base.html
diffstat 2 files changed, 1 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/base.py	Tue Dec 04 21:27:35 2018 +0100
+++ b/kallithea/lib/base.py	Tue Dec 04 21:32:57 2018 +0100
@@ -59,7 +59,6 @@
 from kallithea.model import meta
 
 from kallithea.model.db import PullRequest, Repository, Ui, User, Setting
-from kallithea.model.notification import NotificationModel
 from kallithea.model.scm import ScmModel
 
 log = logging.getLogger(__name__)
@@ -418,8 +417,6 @@
 
         c.repo_name = get_repo_slug(request)  # can be empty
         c.backends = BACKENDS.keys()
-        c.unread_notifications = NotificationModel() \
-                        .get_unread_cnt_for_user(request.authuser.user_id)
 
         self.cut_off_limit = safe_int(config.get('cut_off_limit'))
 
--- a/kallithea/templates/base/base.html	Tue Dec 04 21:27:35 2018 +0100
+++ b/kallithea/templates/base/base.html	Tue Dec 04 21:32:57 2018 +0100
@@ -354,19 +354,10 @@
     ## USER MENU
     <li class="dropdown">
       <a class="menu_link dropdown-toggle" data-toggle="dropdown" role="button" id="quick_login_link"
-        aria-expanded="false" aria-controls="quick_login"
-        %if request.authuser.username != 'default':
-          href="${h.url('notifications')}"
-        %else:
-          href="#"
-        %endif
-      >
+        aria-expanded="false" aria-controls="quick_login" href="#">
           ${h.gravatar_div(request.authuser.email, size=20, div_class="icon")}
           %if request.authuser.username != 'default':
             <span class="menu_link_user">${request.authuser.username}</span>
-            %if c.unread_notifications != 0:
-              <span class="badge">${c.unread_notifications}</span>
-            %endif
           %else:
               <span>${_('Not Logged In')}</span>
           %endif
@@ -405,7 +396,6 @@
                 <div class="email">${request.authuser.email}</div>
             </div>
             <div id="quick_login_h" class="pull-right list-group text-right">
-              <a class="list-group-item" href="${h.url('notifications')}">${_('Notifications')}: ${c.unread_notifications}</a>
               ${h.link_to(_('My Account'),h.url('my_account'),class_='list-group-item')}
               %if not request.authuser.is_external_auth:
                 ## Cannot log out if using external (container) authentication.