eventifier 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41a67bb13760a2f1a78c49d6d9d636f2b096c23f
|
4
|
+
data.tar.gz: 2144b9aa120796684514725552d0b45d2dcd3205
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 187b9888e74d11719d69ee8fc92aa493e14faef16fa91d90620037a59d6475c8b3c925ba9632d2b21bd621d39153740447b24bf01c43d7a6418201590b3a1590
|
7
|
+
data.tar.gz: 64418fd35804cc999a9bb79663ba40c831cbe04337bae498b55cb6906a5575f6a149de007829bdd62f7b53b9abeb8d871655cf44daea0a706fe9f0e6163f8f05
|
@@ -58,17 +58,25 @@ class window.NotificationDropdown
|
|
58
58
|
$.each @notifications, (index, notification)=>
|
59
59
|
unless $.inArray(notification.id, @renderedNotifications) >= 0
|
60
60
|
if new Date(notification.created_at) > @lastReadAt
|
61
|
-
@
|
62
|
-
|
63
|
-
.
|
64
|
-
|
65
|
-
|
61
|
+
console.log @lastInserted
|
62
|
+
if @lastInserted?
|
63
|
+
@lastInserted.after @lastInserted = $("<li />")
|
64
|
+
.addClass('unread')
|
65
|
+
.html(notification.html)
|
66
|
+
else
|
67
|
+
@el
|
68
|
+
.find('ol')
|
69
|
+
.prepend @lastInserted = $("<li />")
|
70
|
+
.addClass('unread')
|
71
|
+
.html(notification.html)
|
66
72
|
else
|
67
73
|
@el
|
68
74
|
.find('ol')
|
69
75
|
.append($("<li />").html(notification.html))
|
70
76
|
@renderedNotifications.push notification.id
|
71
77
|
|
78
|
+
@lastInserted = null
|
79
|
+
|
72
80
|
isActive: =>
|
73
81
|
@el.hasClass('notifications_active')
|
74
82
|
|
@@ -12,19 +12,13 @@ class Eventifier::NotificationsController < Eventifier::ApplicationController
|
|
12
12
|
private
|
13
13
|
|
14
14
|
def notifications
|
15
|
-
scope = current_user.notifications.limit(per_page)
|
15
|
+
scope = current_user.notifications.order("notifications.created_at DESC").limit(per_page)
|
16
16
|
scope = scope.where("notifications.created_at < ?", after) if params[:after]
|
17
17
|
scope = scope.where("notifications.created_at > ?", since) if params[:since]
|
18
18
|
scope = scope.where(
|
19
19
|
"notifications.created_at > ?", current_user.notifications_last_read_at
|
20
20
|
) if params[:recent]
|
21
21
|
|
22
|
-
if params[:since]
|
23
|
-
scope = scope.order("notifications.created_at ASC")
|
24
|
-
else
|
25
|
-
scope = scope.order("notifications.created_at DESC")
|
26
|
-
end
|
27
|
-
|
28
22
|
scope
|
29
23
|
end
|
30
24
|
|
data/eventifier.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = "eventifier"
|
4
|
-
s.version = '0.0.
|
4
|
+
s.version = '0.0.12'
|
5
5
|
s.authors = ["Nathan Sampimon", "Peter Murray", "Pat Allan"]
|
6
6
|
s.email = ["nathan@inspire9.com"]
|
7
7
|
s.homepage = "http://github.com/inspire9/eventifier"
|