# HG changeset patch # User Marcin Kuzminski # Date 1341091972 -7200 # Node ID f8742e1acf088ed677af6040b24412bf9e95e4c4 # Parent 83aff72a1da78cc3a998a933c9c49e519499abdc add highlight of current filter in notifications diff -r 83aff72a1da7 -r f8742e1acf08 rhodecode/controllers/admin/notifications.py --- a/rhodecode/controllers/admin/notifications.py Sat Jun 30 23:12:34 2012 +0200 +++ b/rhodecode/controllers/admin/notifications.py Sat Jun 30 23:32:52 2012 +0200 @@ -67,6 +67,14 @@ 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 -r 83aff72a1da7 -r f8742e1acf08 rhodecode/public/css/style.css --- a/rhodecode/public/css/style.css Sat Jun 30 23:12:34 2012 +0200 +++ b/rhodecode/public/css/style.css Sat Jun 30 23:32:52 2012 +0200 @@ -3348,6 +3348,10 @@ 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 -r 83aff72a1da7 -r f8742e1acf08 rhodecode/templates/admin/notifications/notifications.html --- a/rhodecode/templates/admin/notifications/notifications.html Sat Jun 30 23:12:34 2012 +0200 +++ b/rhodecode/templates/admin/notifications/notifications.html Sat Jun 30 23:32:52 2012 +0200 @@ -27,7 +27,7 @@
${_('All')} - ${_('Comments')} + ${_('Comments')} ${_('Pull requests')}
%if c.notifications: @@ -54,5 +54,11 @@ }) }); }) + +var current_filter = "${c.current_filter}"; +if (YUD.get(current_filter)){ + YUD.addClass(current_filter, 'active'); +} +console.log(current_filter);