Changeset - f8742e1acf08
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 13 years ago 2012-06-30 23:32:52
marcin@python-works.com
add highlight of current filter in notifications
3 files changed with 19 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/admin/notifications.py
Show inline comments
 
@@ -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):
rhodecode/public/css/style.css
Show inline comments
 
@@ -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;
 
}
rhodecode/templates/admin/notifications/notifications.html
Show inline comments
 
@@ -27,7 +27,7 @@
 
    
 
      <div style="padding:14px 18px;text-align: right;float:left">
 
      <span id='all' class="ui-btn"><a href="${h.url.current()}">${_('All')}</a></span>
 
      <span id='pull_request' class="ui-btn"><a href="${h.url.current(type=c.comment_type)}">${_('Comments')}</a></span>
 
      <span id='comment' class="ui-btn"><a href="${h.url.current(type=c.comment_type)}">${_('Comments')}</a></span>
 
      <span id='pull_request' class="ui-btn"><a href="${h.url.current(type=c.pull_request_type)}">${_('Pull requests')}</a></span>
 
      </div>
 
      %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);
 
</script>
 
</%def>
0 comments (0 inline, 0 general)