Show More
@@ -30,6 +30,8 b' from pylons import request' | |||||
30 | from pylons import tmpl_context as c, url |
|
30 | from pylons import tmpl_context as c, url | |
31 | from pylons.controllers.util import redirect |
|
31 | from pylons.controllers.util import redirect | |
32 |
|
32 | |||
|
33 | from webhelpers.paginate import Page | |||
|
34 | ||||
33 | from rhodecode.lib.base import BaseController, render |
|
35 | from rhodecode.lib.base import BaseController, render | |
34 | from rhodecode.model.db import Notification |
|
36 | from rhodecode.model.db import Notification | |
35 |
|
37 | |||
@@ -58,8 +60,9 b' class NotificationsController(BaseContro' | |||||
58 | """GET /_admin/notifications: All items in the collection""" |
|
60 | """GET /_admin/notifications: All items in the collection""" | |
59 | # url('notifications') |
|
61 | # url('notifications') | |
60 | c.user = self.rhodecode_user |
|
62 | c.user = self.rhodecode_user | |
61 | c.notifications = NotificationModel()\ |
|
63 | notif = NotificationModel().get_for_user(self.rhodecode_user.user_id) | |
62 | .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 | return render('admin/notifications/notifications.html') |
|
66 | return render('admin/notifications/notifications.html') | |
64 |
|
67 | |||
65 | def mark_all_read(self): |
|
68 | def mark_all_read(self): | |
@@ -69,7 +72,8 b' class NotificationsController(BaseContro' | |||||
69 | nm.mark_all_read_for_user(self.rhodecode_user.user_id) |
|
72 | nm.mark_all_read_for_user(self.rhodecode_user.user_id) | |
70 | Session.commit() |
|
73 | Session.commit() | |
71 | c.user = self.rhodecode_user |
|
74 | c.user = self.rhodecode_user | |
72 |
|
|
75 | notif = nm.get_for_user(self.rhodecode_user.user_id) | |
|
76 | c.notifications = Page(notif, page=1, items_per_page=10) | |||
73 | return render('admin/notifications/notifications_data.html') |
|
77 | return render('admin/notifications/notifications_data.html') | |
74 |
|
78 | |||
75 | def create(self): |
|
79 | def create(self): |
@@ -4103,6 +4103,13 b' form.comment-inline-form {' | |||||
4103 | .inline-comments-button .add-comment{ |
|
4103 | .inline-comments-button .add-comment{ | |
4104 | margin:2px 0px 8px 5px !important |
|
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 | .notifications{ |
|
4113 | .notifications{ | |
4107 | border-radius: 4px 4px 4px 4px; |
|
4114 | border-radius: 4px 4px 4px 4px; | |
4108 | -webkit-border-radius: 4px; |
|
4115 | -webkit-border-radius: 4px; | |
@@ -4136,16 +4143,24 b' form.comment-inline-form {' | |||||
4136 | float: left |
|
4143 | float: left | |
4137 | } |
|
4144 | } | |
4138 | .notification-list .container.unread{ |
|
4145 | .notification-list .container.unread{ | |
4139 |
|
4146 | background: none repeat scroll 0 0 rgba(255, 255, 180, 0.6); | ||
4140 | } |
|
4147 | } | |
4141 | .notification-header .gravatar{ |
|
4148 | .notification-header .gravatar{ | |
4142 |
|
4149 | background: none repeat scroll 0 0 transparent; | ||
|
4150 | padding: 0px 0px 0px 8px; | |||
4143 | } |
|
4151 | } | |
4144 | .notification-header .desc.unread{ |
|
4152 | .notification-header .desc.unread{ | |
4145 | font-weight: bold; |
|
4153 | font-weight: bold; | |
4146 | font-size: 17px; |
|
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 | .notification-header .delete-notifications{ |
|
4164 | .notification-header .delete-notifications{ | |
4150 | float: right; |
|
4165 | float: right; | |
4151 | padding-top: 8px; |
|
4166 | padding-top: 8px; | |
@@ -4157,6 +4172,11 b' form.comment-inline-form {' | |||||
4157 | padding:5px 0px 5px 38px; |
|
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 | PERMS |
|
4181 | PERMS | |
4162 | *****/ |
|
4182 | *****/ |
@@ -25,7 +25,7 b'' | |||||
25 | ##</ul> |
|
25 | ##</ul> | |
26 | </div> |
|
26 | </div> | |
27 | %if c.notifications: |
|
27 | %if c.notifications: | |
28 |
<div style="padding:1 |
|
28 | <div style="padding:14px 18px;text-align: right;float:right"> | |
29 | <span id='mark_all_read' class="ui-btn">${_('Mark all read')}</span> |
|
29 | <span id='mark_all_read' class="ui-btn">${_('Mark all read')}</span> | |
30 | </div> |
|
30 | </div> | |
31 | %endif |
|
31 | %endif | |
@@ -39,15 +39,18 b" YUE.on(YUQ('.delete-notification'),'clic" | |||||
39 | var notification_id = e.currentTarget.id; |
|
39 | var notification_id = e.currentTarget.id; | |
40 | deleteNotification(url_del,notification_id) |
|
40 | deleteNotification(url_del,notification_id) | |
41 | }) |
|
41 | }) | |
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 |
|
|
45 | var notification_counter = YUD.get('notification_counter'); | |
46 | YUE.on(YUQ('.delete-notification'),'click',function(e){ |
|
46 | if(notification_counter){ | |
47 |
|
|
47 | notification_counter.innerHTML=0; | |
48 | deleteNotification(url_del,notification_id) |
|
48 | } | |
49 | }) |
|
49 | YUE.on(YUQ('.delete-notification'),'click',function(e){ | |
50 | }); |
|
50 | var notification_id = e.currentTarget.id; | |
51 | }) |
|
51 | deleteNotification(url_del,notification_id) | |
|
52 | }) | |||
|
53 | }); | |||
|
54 | }) | |||
52 | </script> |
|
55 | </script> | |
53 | </%def> |
|
56 | </%def> |
@@ -3,26 +3,37 b'' | |||||
3 | <% |
|
3 | <% | |
4 | unread = lambda n:{False:'unread'}.get(n) |
|
4 | unread = lambda n:{False:'unread'}.get(n) | |
5 | %> |
|
5 | %> | |
6 | <div class="table"> |
|
6 | <div class="notification-paginator"> | |
7 |
<div class=" |
|
7 | <div class="pagination-wh pagination-left"> | |
8 | %for notification in c.notifications: |
|
8 | ${c.notifications.pager('$link_previous ~2~ $link_next')} | |
9 | <div id="notification_${notification.notification.notification_id}" class="container ${unread(notification.read)}"> |
|
|||
10 | <div class="notification-header"> |
|
|||
11 | <div class="gravatar"> |
|
|||
12 | <img alt="gravatar" src="${h.gravatar_url(h.email(notification.notification.created_by_user.email),24)}"/> |
|
|||
13 | </div> |
|
|||
14 | <div class="desc ${unread(notification.read)}"> |
|
|||
15 | <a href="${url('notification', notification_id=notification.notification.notification_id)}">${notification.notification.description}</a> |
|
|||
16 | </div> |
|
|||
17 | <div class="delete-notifications"> |
|
|||
18 | <span id="${notification.notification.notification_id}" class="delete-notification delete_icon action"></span> |
|
|||
19 | </div> |
|
|||
20 | </div> |
|
|||
21 | <div class="notification-subject">${h.literal(notification.notification.subject)}</div> |
|
|||
22 | </div> |
|
|||
23 | %endfor |
|
|||
24 | </div> |
|
9 | </div> | |
25 | </div> |
|
10 | </div> | |
|
11 | ||||
|
12 | <div class="notification-list notification-table"> | |||
|
13 | %for notification in c.notifications: | |||
|
14 | <div id="notification_${notification.notification.notification_id}" class="container ${unread(notification.read)}"> | |||
|
15 | <div class="notification-header"> | |||
|
16 | <div class="gravatar"> | |||
|
17 | <img alt="gravatar" src="${h.gravatar_url(h.email(notification.notification.created_by_user.email),24)}"/> | |||
|
18 | </div> | |||
|
19 | <div class="desc ${unread(notification.read)}"> | |||
|
20 | <a href="${url('notification', notification_id=notification.notification.notification_id)}">${notification.notification.description}</a> | |||
|
21 | </div> | |||
|
22 | <div class="delete-notifications"> | |||
|
23 | <span id="${notification.notification.notification_id}" class="delete-notification delete_icon action"></span> | |||
|
24 | </div> | |||
|
25 | </div> | |||
|
26 | <div class="notification-subject">${h.literal(notification.notification.subject)}</div> | |||
|
27 | </div> | |||
|
28 | %endfor | |||
|
29 | </div> | |||
|
30 | ||||
|
31 | <div class="notification-paginator"> | |||
|
32 | <div class="pagination-wh pagination-left"> | |||
|
33 | ${c.notifications.pager('$link_previous ~2~ $link_next')} | |||
|
34 | </div> | |||
|
35 | </div> | |||
|
36 | ||||
26 | %else: |
|
37 | %else: | |
27 | <div class="table">${_('No notifications here yet')}</div> |
|
38 | <div class="table">${_('No notifications here yet')}</div> | |
28 | %endif |
|
39 | %endif |
@@ -39,7 +39,7 b'' | |||||
39 | <span id="${c.notification.notification_id}" class="delete-notification delete_icon action"></span> |
|
39 | <span id="${c.notification.notification_id}" class="delete-notification delete_icon action"></span> | |
40 | </div> |
|
40 | </div> | |
41 | </div> |
|
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 | </div> |
|
43 | </div> | |
44 | </div> |
|
44 | </div> | |
45 | </div> |
|
45 | </div> |
General Comments 0
You need to be logged in to leave comments.
Login now