##// END OF EJS Templates
notification inbox improvements...
marcink -
r2190:64f7cf8f beta
parent child Browse files
Show More
@@ -30,6 +30,8 b' from pylons import request'
30 30 from pylons import tmpl_context as c, url
31 31 from pylons.controllers.util import redirect
32 32
33 from webhelpers.paginate import Page
34
33 35 from rhodecode.lib.base import BaseController, render
34 36 from rhodecode.model.db import Notification
35 37
@@ -58,8 +60,9 b' class NotificationsController(BaseContro'
58 60 """GET /_admin/notifications: All items in the collection"""
59 61 # url('notifications')
60 62 c.user = self.rhodecode_user
61 c.notifications = NotificationModel()\
62 .get_for_user(self.rhodecode_user.user_id)
63 notif = NotificationModel().get_for_user(self.rhodecode_user.user_id)
64 p = int(request.params.get('page', 1))
65 c.notifications = Page(notif, page=p, items_per_page=10)
63 66 return render('admin/notifications/notifications.html')
64 67
65 68 def mark_all_read(self):
@@ -69,7 +72,8 b' class NotificationsController(BaseContro'
69 72 nm.mark_all_read_for_user(self.rhodecode_user.user_id)
70 73 Session.commit()
71 74 c.user = self.rhodecode_user
72 c.notifications = nm.get_for_user(self.rhodecode_user.user_id)
75 notif = nm.get_for_user(self.rhodecode_user.user_id)
76 c.notifications = Page(notif, page=1, items_per_page=10)
73 77 return render('admin/notifications/notifications_data.html')
74 78
75 79 def create(self):
@@ -4103,6 +4103,13 b' form.comment-inline-form {'
4103 4103 .inline-comments-button .add-comment{
4104 4104 margin:2px 0px 8px 5px !important
4105 4105 }
4106
4107
4108 .notification-paginator{
4109 padding: 0px 0px 4px 16px;
4110 float: left;
4111 }
4112
4106 4113 .notifications{
4107 4114 border-radius: 4px 4px 4px 4px;
4108 4115 -webkit-border-radius: 4px;
@@ -4136,16 +4143,24 b' form.comment-inline-form {'
4136 4143 float: left
4137 4144 }
4138 4145 .notification-list .container.unread{
4139
4146 background: none repeat scroll 0 0 rgba(255, 255, 180, 0.6);
4140 4147 }
4141 4148 .notification-header .gravatar{
4142
4149 background: none repeat scroll 0 0 transparent;
4150 padding: 0px 0px 0px 8px;
4143 4151 }
4144 4152 .notification-header .desc.unread{
4145 4153 font-weight: bold;
4146 4154 font-size: 17px;
4147 4155 }
4148
4156 .notification-table{
4157 border: 1px solid #ccc;
4158 -webkit-border-radius: 6px 6px 6px 6px;
4159 -moz-border-radius: 6px 6px 6px 6px;
4160 border-radius: 6px 6px 6px 6px;
4161 clear: both;
4162 margin: 0px 20px 0px 20px;
4163 }
4149 4164 .notification-header .delete-notifications{
4150 4165 float: right;
4151 4166 padding-top: 8px;
@@ -4157,6 +4172,11 b' form.comment-inline-form {'
4157 4172 padding:5px 0px 5px 38px;
4158 4173 }
4159 4174
4175 .notification-body{
4176 clear:both;
4177 margin: 34px 2px 2px 8px
4178 }
4179
4160 4180 /****
4161 4181 PERMS
4162 4182 *****/
@@ -25,7 +25,7 b''
25 25 ##</ul>
26 26 </div>
27 27 %if c.notifications:
28 <div style="padding:10px 15px;text-align: right">
28 <div style="padding:14px 18px;text-align: right;float:right">
29 29 <span id='mark_all_read' class="ui-btn">${_('Mark all read')}</span>
30 30 </div>
31 31 %endif
@@ -42,7 +42,10 b" YUE.on(YUQ('.delete-notification'),'clic"
42 42 YUE.on('mark_all_read','click',function(e){
43 43 var url = "${h.url('notifications_mark_all_read')}";
44 44 ypjax(url,'notification_data',function(){
45 YUD.get('notification_counter').innerHTML=0;
45 var notification_counter = YUD.get('notification_counter');
46 if(notification_counter){
47 notification_counter.innerHTML=0;
48 }
46 49 YUE.on(YUQ('.delete-notification'),'click',function(e){
47 50 var notification_id = e.currentTarget.id;
48 51 deleteNotification(url_del,notification_id)
@@ -3,8 +3,13 b''
3 3 <%
4 4 unread = lambda n:{False:'unread'}.get(n)
5 5 %>
6 <div class="table">
7 <div class="notification-list">
6 <div class="notification-paginator">
7 <div class="pagination-wh pagination-left">
8 ${c.notifications.pager('$link_previous ~2~ $link_next')}
9 </div>
10 </div>
11
12 <div class="notification-list notification-table">
8 13 %for notification in c.notifications:
9 14 <div id="notification_${notification.notification.notification_id}" class="container ${unread(notification.read)}">
10 15 <div class="notification-header">
@@ -22,7 +27,13 b" unread = lambda n:{False:'unread'}.get(n"
22 27 </div>
23 28 %endfor
24 29 </div>
30
31 <div class="notification-paginator">
32 <div class="pagination-wh pagination-left">
33 ${c.notifications.pager('$link_previous ~2~ $link_next')}
25 34 </div>
35 </div>
36
26 37 %else:
27 38 <div class="table">${_('No notifications here yet')}</div>
28 39 %endif
@@ -39,7 +39,7 b''
39 39 <span id="${c.notification.notification_id}" class="delete-notification delete_icon action"></span>
40 40 </div>
41 41 </div>
42 <div>${h.rst_w_mentions(c.notification.body)}</div>
42 <div class="notification-body">${h.rst_w_mentions(c.notification.body)}</div>
43 43 </div>
44 44 </div>
45 45 </div>
General Comments 0
You need to be logged in to leave comments. Login now