notifications 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -9
- data/app/assets/stylesheets/notifications.scss +49 -0
- data/config/locales/notifications.zh-CN.yml +4 -0
- data/lib/generators/notifications/controllers_generator.rb +1 -1
- data/lib/generators/notifications/views_generator.rb +3 -3
- data/lib/notifications/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 360b52b19fc6b46692cfbeea0bd424b9223ee49c
|
4
|
+
data.tar.gz: 134df5d86d843cab2ace62ae0d444112ba9d6015
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1ccdd276d0dc2c5110feabd589b046e4edd65e15a4c289f331db65a15a2f0bd2fd7338bd5aa8e3717dceb2d8d1b49bf9888f105de7791a8a46278c19cf9cb40
|
7
|
+
data.tar.gz: 3f26d6cafec750b63e40cf299c49e9ee72d4f7c7ab706af2268beff2d640d7a7f88c900a5ab990ceffa803f9b970fa344cefeeec44e268acf61441553008a478
|
data/README.md
CHANGED
@@ -95,17 +95,10 @@ You app must be have:
|
|
95
95
|
|
96
96
|
We suggest use [second_level_cached](https://github.com/hooopo/second_level_cache) for solve N+1 performance issue.
|
97
97
|
|
98
|
-
### Mark notifications as read
|
99
|
-
|
100
|
-
You can set multiple Notification as read by:
|
101
|
-
|
102
|
-
```ruby
|
103
|
-
notification_ids = [1, 2 ...]
|
104
|
-
Notification.read!(current_user.id, notification_ids)
|
105
|
-
```
|
106
|
-
|
107
98
|
## Contributing
|
99
|
+
|
108
100
|
Contribution directions go here.
|
109
101
|
|
110
102
|
## License
|
103
|
+
|
111
104
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
@@ -0,0 +1,49 @@
|
|
1
|
+
.notifications {
|
2
|
+
padding: 10px;
|
3
|
+
margin: 20px;
|
4
|
+
border: 1px solid #eee;
|
5
|
+
border-radius: 3px;
|
6
|
+
|
7
|
+
.heading {
|
8
|
+
border-bottom: 1px solid #eee;
|
9
|
+
padding: 5px;
|
10
|
+
margin-bottom: 10px;
|
11
|
+
}
|
12
|
+
|
13
|
+
.notification {
|
14
|
+
margin-bottom: 10px;
|
15
|
+
padding: 10px;
|
16
|
+
border-bottom: 1px solid #eee;
|
17
|
+
color: #999;
|
18
|
+
|
19
|
+
a { color: #555; }
|
20
|
+
|
21
|
+
&.unread {
|
22
|
+
color: #444;
|
23
|
+
|
24
|
+
.media-heading {
|
25
|
+
font-weight: bold;
|
26
|
+
font-size: 14px;
|
27
|
+
}
|
28
|
+
|
29
|
+
a { color: #222; text-decoration: underline; }
|
30
|
+
}
|
31
|
+
|
32
|
+
|
33
|
+
.media-content {
|
34
|
+
p:last-chind {
|
35
|
+
margin-bottom: 0;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
.user-avatar {
|
40
|
+
img { width: 24px; height: 24px; border-radius: 120px; }
|
41
|
+
}
|
42
|
+
|
43
|
+
.media-right {
|
44
|
+
min-width: 100px;
|
45
|
+
color: #AAA;
|
46
|
+
font-size: 13px;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
@@ -7,7 +7,7 @@ module Notifications
|
|
7
7
|
desc "Used to copy Notifications's controllers to your application's controllers."
|
8
8
|
|
9
9
|
def copy_controllers
|
10
|
-
%w(
|
10
|
+
%w(notifications).each do |fname|
|
11
11
|
path = "#{Rails.root}/app/controllers/notifications/#{fname}_controller.rb"
|
12
12
|
if File.exists?(path)
|
13
13
|
puts "Skipping notifications/#{fname}_controller.rb creation, as file already exists!"
|
@@ -3,12 +3,12 @@ require 'rails/generators'
|
|
3
3
|
module Notifications
|
4
4
|
module Generators
|
5
5
|
class ViewsGenerator < Rails::Generators::Base #:nodoc:
|
6
|
-
source_root File.expand_path("../../../../
|
6
|
+
source_root File.expand_path("../../../../", __FILE__)
|
7
7
|
desc "Used to copy Notifications's views to your application's views."
|
8
8
|
|
9
9
|
def copy_views
|
10
|
-
directory '
|
11
|
-
|
10
|
+
directory 'app/views/notifications', "app/views/notifications"
|
11
|
+
template 'app/assets/stylesheets/notifications.scss', 'app/assets/stylesheets/notifications.scss'
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notifications
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -40,6 +40,7 @@ files:
|
|
40
40
|
- MIT-LICENSE
|
41
41
|
- README.md
|
42
42
|
- Rakefile
|
43
|
+
- app/assets/stylesheets/notifications.scss
|
43
44
|
- app/controllers/notifications/application_controller.rb
|
44
45
|
- app/controllers/notifications/notifications_controller.rb
|
45
46
|
- app/models/notification.rb
|
@@ -47,6 +48,7 @@ files:
|
|
47
48
|
- app/views/notifications/notifications/index.html.erb
|
48
49
|
- config/initializers/notifications.rb
|
49
50
|
- config/locales/notifications.en.yml
|
51
|
+
- config/locales/notifications.zh-CN.yml
|
50
52
|
- config/routes.rb
|
51
53
|
- db/migrate/20160328045436_create_notifications.rb
|
52
54
|
- lib/generators/notifications/controllers_generator.rb
|