Changeset - 523b1011a625
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 14 years ago 2011-12-29 05:59:07
marcin@python-works.com
- fixed issue with mark all read button for notifications and listeners on delete buttons
- hide mark all read if notification inbox is empty
2 files changed with 13 insertions and 5 deletions:
0 comments (0 inline, 0 general)
rhodecode/templates/admin/notifications/notifications.html
Show inline comments
 
@@ -21,25 +21,33 @@
 
        <ul class="links">
 
            <li>
 
              <span style="text-transform: uppercase;"><a href="#">${_('Compose message')}</a></span>
 
            </li>          
 
        </ul>            
 
    </div>
 
    %if c.notifications:
 
      <div style="padding:10px 15px;text-align: right">
 
      <span id='mark_all_read' class="ui-btn">${_('Mark all read')}</span>
 
  </div>
 
      </div>
 
    %endif
 
  <div id='notification_data'>
 
    <%include file='notifications_data.html'/>
 
  </div>
 
</div>
 
<script type="text/javascript">
 
var url = "${url('notification', notification_id='__NOTIFICATION_ID__')}";
 
var url_del = "${url('notification', notification_id='__NOTIFICATION_ID__')}";
 
YUE.on(YUQ('.delete-notification'),'click',function(e){
 
 var notification_id = e.currentTarget.id;
 
 deleteNotification(url,notification_id)
 
 deleteNotification(url_del,notification_id)
 
})
 
 YUE.on('mark_all_read','click',function(e){
 
	    var url = "${h.url('notifications_mark_all_read')}";
 
	    ypjax(url,'notification_data',function(){YUD.get('notification_counter').innerHTML=0});
 
	    ypjax(url,'notification_data',function(){
 
	    	YUD.get('notification_counter').innerHTML=0;
 
	    	YUE.on(YUQ('.delete-notification'),'click',function(e){
 
	    		 var notification_id = e.currentTarget.id;
 
	    		 deleteNotification(url_del,notification_id)
 
	    	})	    	
 
	    });
 
 })
 
</script>
 
</%def>  
rhodecode/templates/admin/notifications/notifications_data.html
Show inline comments
 

	
 
% if c.notifications:
 
%if c.notifications:
 
<%
 
unread = lambda n:{False:'unread'}.get(n)
 
%>
 
<div class="table">
 
  <div class="notification-list">
 
  %for notification in c.notifications:
0 comments (0 inline, 0 general)