notification-renderer 1.0.0.beta10 → 1.0.0.beta11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c811be378ae541e5905b91880085b0ac1117d5706d9771c8520ef42deb17a79
|
4
|
+
data.tar.gz: 2e806bed04c6e3650a4e4d617e543e70cfab50904fba85c3d416052ea33dc875
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 609d6e962ac8c19a911e403c8483ac6d57dc84b421f4d50b719ac4eea2d7f6b71f5fd361ac4f9a0f077ac5f7cb4fc5f145109cda57f8f4a27a82c083b01544dd
|
7
|
+
data.tar.gz: b828711515fa684348a8954fc26f779ec0b380faa59996cf28f37d13a33262acba52d631a899bbba201353fc899b2e3110c3d236135ff9dd66a374093fb317b0
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module NotificationRendererHelper
|
2
|
+
|
3
|
+
def render_notification notification, renderer = NotificationRenderer.configuration.default_renderer, attribute, notifications_count
|
4
|
+
notification.update_attributes read: true if NotificationRenderer.configuration.auto_read
|
5
|
+
render "notifications/#{notification.type}/#{renderer}", notification: notification, attribute: attribute, notifications_count: notifications_count
|
6
|
+
end
|
7
|
+
|
8
|
+
def render_notifications notifications, renderer = NotificationRenderer.configuration.default_renderer
|
9
|
+
content_tag :div, class: 'notification-renderer notifications' do
|
10
|
+
notifications.each do |notification|
|
11
|
+
render_notification notification, renderer
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def render_notifications_grouped notifications, group_by, renderer = NotificationRenderer.configuration.default_renderer
|
17
|
+
content_tag :div, class: 'notification-renderer notifications' do
|
18
|
+
notifications.grouping(group_by)&.each do |attribute, notifications|
|
19
|
+
render_notification notifications.last, renderer, attribute, notifications.count
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def notification_grouped?
|
25
|
+
local_assigns[:attribute]
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notification-renderer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.beta11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Hübotter
|
@@ -38,20 +38,34 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '5.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: activesupport
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: notification-handler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - '='
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.0.0.
|
61
|
+
version: 1.0.0.beta11
|
48
62
|
type: :runtime
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - '='
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.0.0.
|
68
|
+
version: 1.0.0.beta11
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rspec
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,6 +104,7 @@ files:
|
|
90
104
|
- CHANGELOG.md
|
91
105
|
- LICENSE
|
92
106
|
- README.md
|
107
|
+
- app/helpers/notification_renderer_helper.rb
|
93
108
|
- lib/generators/notification_renderer/install_generator.rb
|
94
109
|
- lib/generators/notification_renderer/type_generator.rb
|
95
110
|
- lib/generators/templates/install/README.md
|