##// END OF EJS Templates
add highlight of current filter in notifications
marcink -
r2519:f8742e1a beta
parent child Browse files
Show More
@@ -67,6 +67,14 b' class NotificationsController(BaseContro'
67 67 c.pull_request_type = Notification.TYPE_PULL_REQUEST
68 68 c.comment_type = [Notification.TYPE_CHANGESET_COMMENT,
69 69 Notification.TYPE_PULL_REQUEST_COMMENT]
70
71 _current_filter = request.GET.getall('type')
72 c.current_filter = 'all'
73 if _current_filter == [c.pull_request_type]:
74 c.current_filter = 'pull_request'
75 elif _current_filter == c.comment_type:
76 c.current_filter = 'comment'
77
70 78 return render('admin/notifications/notifications.html')
71 79
72 80 def mark_all_read(self):
@@ -3348,6 +3348,10 b' div.gravatar img {'
3348 3348 border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
3349 3349 }
3350 3350
3351 .ui-btn.active{
3352 font-weight: bold;
3353 }
3354
3351 3355 ins,div.options a:hover {
3352 3356 text-decoration: none;
3353 3357 }
@@ -27,7 +27,7 b''
27 27
28 28 <div style="padding:14px 18px;text-align: right;float:left">
29 29 <span id='all' class="ui-btn"><a href="${h.url.current()}">${_('All')}</a></span>
30 <span id='pull_request' class="ui-btn"><a href="${h.url.current(type=c.comment_type)}">${_('Comments')}</a></span>
30 <span id='comment' class="ui-btn"><a href="${h.url.current(type=c.comment_type)}">${_('Comments')}</a></span>
31 31 <span id='pull_request' class="ui-btn"><a href="${h.url.current(type=c.pull_request_type)}">${_('Pull requests')}</a></span>
32 32 </div>
33 33 %if c.notifications:
@@ -54,5 +54,11 b" YUE.on('mark_all_read','click',function("
54 54 })
55 55 });
56 56 })
57
58 var current_filter = "${c.current_filter}";
59 if (YUD.get(current_filter)){
60 YUD.addClass(current_filter, 'active');
61 }
62 console.log(current_filter);
57 63 </script>
58 64 </%def>
General Comments 0
You need to be logged in to leave comments. Login now