# HG changeset patch # User Marcin Kuzminski # Date 2012-06-30 21:32:52 # Node ID f8742e1acf088ed677af6040b24412bf9e95e4c4 # Parent 83aff72a1da78cc3a998a933c9c49e519499abdc add highlight of current filter in notifications diff --git a/rhodecode/controllers/admin/notifications.py b/rhodecode/controllers/admin/notifications.py --- a/rhodecode/controllers/admin/notifications.py +++ b/rhodecode/controllers/admin/notifications.py @@ -67,6 +67,14 @@ class NotificationsController(BaseContro c.pull_request_type = Notification.TYPE_PULL_REQUEST c.comment_type = [Notification.TYPE_CHANGESET_COMMENT, Notification.TYPE_PULL_REQUEST_COMMENT] + + _current_filter = request.GET.getall('type') + c.current_filter = 'all' + if _current_filter == [c.pull_request_type]: + c.current_filter = 'pull_request' + elif _current_filter == c.comment_type: + c.current_filter = 'comment' + return render('admin/notifications/notifications.html') def mark_all_read(self): diff --git a/rhodecode/public/css/style.css b/rhodecode/public/css/style.css --- a/rhodecode/public/css/style.css +++ b/rhodecode/public/css/style.css @@ -3348,6 +3348,10 @@ div.gravatar img { border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); } +.ui-btn.active{ + font-weight: bold; +} + ins,div.options a:hover { text-decoration: none; } diff --git a/rhodecode/templates/admin/notifications/notifications.html b/rhodecode/templates/admin/notifications/notifications.html --- a/rhodecode/templates/admin/notifications/notifications.html +++ b/rhodecode/templates/admin/notifications/notifications.html @@ -27,7 +27,7 @@
${_('All')} - ${_('Comments')} + ${_('Comments')} ${_('Pull requests')}
%if c.notifications: @@ -54,5 +54,11 @@ YUE.on('mark_all_read','click',function( }) }); }) + +var current_filter = "${c.current_filter}"; +if (YUD.get(current_filter)){ + YUD.addClass(current_filter, 'active'); +} +console.log(current_filter);