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
 
@@ -64,12 +64,20 @@ class NotificationsController(BaseContro
 
                                            filter_=request.GET.getall('type'))
 
        p = int(request.params.get('page', 1))
 
        c.notifications = Page(notif, page=p, items_per_page=10)
 
        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):
 
        if request.environ.get('HTTP_X_PARTIAL_XHR'):
 
            nm = NotificationModel()
 
            # mark all read
rhodecode/public/css/style.css
Show inline comments
 
@@ -3345,12 +3345,16 @@ div.gravatar img {
 
  background-image: linear-gradient(top, #62c462, #57a957);
 
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0);
 
  border-color: #57a957 #57a957 #3d773d;
 
  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;
 
}
 
 
img,
 
#header #header-inner #quick li a:hover span.normal,
rhodecode/templates/admin/notifications/notifications.html
Show inline comments
 
@@ -24,13 +24,13 @@
 
        ##    </li>
 
        ##</ul>
 
    </div>
 
    
 
      <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:
 
      <div style="padding:14px 18px;text-align: right;float:right">
 
      <span id='mark_all_read' class="ui-btn">${_('Mark all read')}</span>
 
      </div>
 
@@ -51,8 +51,14 @@ YUE.on('mark_all_read','click',function(
 
    	YUE.on(YUQ('.delete-notification'),'click',function(e){
 
    		 var notification_id = e.currentTarget.id;
 
    		 deleteNotification(url_del,notification_id)
 
    	})
 
    });
 
})
 

	
 
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)