[PATCH 4 of 9] templates: remove notification count from user profile button

Thomas De Schampheleire patrickdepinguin at gmail.com
Thu Dec 6 08:14:24 UTC 2018


# HG changeset patch
# User Thomas De Schampheleire <thomas.de_schampheleire at nokia.com>
# Date 1543955577 -3600
#      Tue Dec 04 21:32:57 2018 +0100
# Node ID 4473f2fb4f7e34ee0d842d163b4412ba6a04e7cb
# Parent  7e7de9b59fb7af2f1926e628c88a50a0498d9dba
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.

diff --git a/kallithea/lib/base.py b/kallithea/lib/base.py
--- a/kallithea/lib/base.py
+++ b/kallithea/lib/base.py
@@ -59,7 +59,6 @@ from kallithea.lib.vcs.exceptions import
 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 @@ class BaseController(TGController):
 
         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'))
 
diff --git a/kallithea/templates/base/base.html b/kallithea/templates/base/base.html
--- a/kallithea/templates/base/base.html
+++ b/kallithea/templates/base/base.html
@@ -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.


More information about the kallithea-general mailing list