Mercurial > kallithea
changeset 1817:523b1011a625 beta
- fixed issue with mark all read button for notifications and listeners on delete buttons
- hide mark all read if notification inbox is empty
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 29 Dec 2011 06:59:07 +0200 |
parents | ee2817f2cb3d |
children | cf51bbfb120e |
files | rhodecode/templates/admin/notifications/notifications.html rhodecode/templates/admin/notifications/notifications_data.html |
diffstat | 2 files changed, 13 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/templates/admin/notifications/notifications.html Thu Dec 29 01:24:21 2011 +0200 +++ b/rhodecode/templates/admin/notifications/notifications.html Thu Dec 29 06:59:07 2011 +0200 @@ -24,22 +24,30 @@ </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>
--- a/rhodecode/templates/admin/notifications/notifications_data.html Thu Dec 29 01:24:21 2011 +0200 +++ b/rhodecode/templates/admin/notifications/notifications_data.html Thu Dec 29 06:59:07 2011 +0200 @@ -1,5 +1,5 @@ -% if c.notifications: +%if c.notifications: <% unread = lambda n:{False:'unread'}.get(n) %>