frontend_notifier 0.1.0 → 0.1.1
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.
- data/README.markdown +5 -2
- data/VERSION +1 -1
- data/app/views/shared/_frontend_notifier.html.haml +1 -1
- data/frontend_notifier.gemspec +64 -0
- metadata +12 -11
data/README.markdown
CHANGED
@@ -8,15 +8,18 @@ Shows cute notifications in frontend. No need to manually create your own html/c
|
|
8
8
|
INSTALLATION
|
9
9
|
------------
|
10
10
|
|
11
|
+
**Requirements**: Rails 3.1.0, jQuery
|
12
|
+
|
11
13
|
1. `gem install frontend_notifier`
|
12
14
|
2. put the following in your .scss file: `@import "frontend_notifier";`
|
13
15
|
3. put the following in your .js or .coffee file: `#= require lib/_frontend_notifier`
|
16
|
+
4. put the following in layout: `= render :partial => "shared/frontend_notifier"`
|
14
17
|
|
15
18
|
USAGE
|
16
19
|
-----
|
17
20
|
|
18
21
|
**Regular reuqests**
|
19
|
-
FrontendNotifier will pick up any flash with the names `:error`, `:alert`, `:success` or `:notice`. You can customize this by creating your own `views/shared/frontend_notifier` template.
|
22
|
+
FrontendNotifier will pick up any flash with the names `:error`, `:alert`, `:warning`, `:success` or `:notice`. You can customize this by creating your own `views/shared/frontend_notifier` template.
|
20
23
|
|
21
24
|
**Ajax requests**
|
22
25
|
Sometimes you may need to display the notification after an ajax request. For that, you may want to use `#notify_frontend` method now available in your controller and pass it either a model with (or without) errors:
|
@@ -50,6 +53,6 @@ There's also a handy #join_model_errors method added to the ApplicationControlle
|
|
50
53
|
|
51
54
|
flash[:error] = join_model_errors(@user, include_field_names: true) # :include_field_names is true by default
|
52
55
|
|
53
|
-
|
56
|
+
CUSTOMIZE
|
54
57
|
-----
|
55
58
|
For now, the gem lacks generators, so if you want to customize scss styles or haml templates, just copy .scss/.haml files from their gem dirs into your app dirs and change them.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
@@ -9,7 +9,7 @@
|
|
9
9
|
= image_tag "frontend_notifier_close_notification_ico.png", :id => "close_notification_ico"
|
10
10
|
|
11
11
|
#frontend_notification_content
|
12
|
-
- if error = flash[:error] || flash[:alert]
|
12
|
+
- if error = flash[:error] || flash[:alert] || flash[:warning]
|
13
13
|
%span.error= error
|
14
14
|
- elsif success = flash[:success] || flash[:notice]
|
15
15
|
%span.success= success
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "frontend_notifier"
|
8
|
+
s.version = "0.1.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Roman Snitko"]
|
12
|
+
s.date = "2012-01-03"
|
13
|
+
s.description = "Shows cute notifications in frontend. No need to manually create your own html/css/js to show Rails's flash[:notice] or other flashes. This handles it nicely + you can customize it."
|
14
|
+
s.email = "subscribe@snitko.ru"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.markdown"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
"Gemfile",
|
22
|
+
"LICENSE.txt",
|
23
|
+
"README.markdown",
|
24
|
+
"Rakefile",
|
25
|
+
"Screenshot.png",
|
26
|
+
"VERSION",
|
27
|
+
"app/assets/images/frontend_notifier_close_notification_ico.png",
|
28
|
+
"app/assets/javascripts/lib/_frontend_notifier.js.coffee",
|
29
|
+
"app/assets/stylesheets/_frontend_notifier.css.scss",
|
30
|
+
"app/config/locales/en.yml",
|
31
|
+
"app/views/shared/_frontend_notifier.html.haml",
|
32
|
+
"frontend_notifier.gemspec",
|
33
|
+
"lib/frontend_notifier.rb",
|
34
|
+
"lib/frontend_notifier/application_controller.rb",
|
35
|
+
"lib/frontend_notifier/frontend_notifier_engine.rb"
|
36
|
+
]
|
37
|
+
s.homepage = "http://github.com/snitko/frontend_notifier"
|
38
|
+
s.licenses = ["MIT"]
|
39
|
+
s.require_paths = ["lib"]
|
40
|
+
s.rubygems_version = "1.8.10"
|
41
|
+
s.summary = "Rails extension, shows cute notifications in frontend."
|
42
|
+
|
43
|
+
if s.respond_to? :specification_version then
|
44
|
+
s.specification_version = 3
|
45
|
+
|
46
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
47
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
48
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
49
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
50
|
+
s.add_development_dependency(%q<rails>, [">= 3.1.0"])
|
51
|
+
else
|
52
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
53
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
54
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
55
|
+
s.add_dependency(%q<rails>, [">= 3.1.0"])
|
56
|
+
end
|
57
|
+
else
|
58
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
59
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
60
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
61
|
+
s.add_dependency(%q<rails>, [">= 3.1.0"])
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frontend_notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
|
-
requirement: &
|
16
|
+
requirement: &18706140 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.0.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *18706140
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: jeweler
|
27
|
-
requirement: &
|
27
|
+
requirement: &18704380 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.6.4
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *18704380
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rcov
|
38
|
-
requirement: &
|
38
|
+
requirement: &18734640 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *18734640
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rails
|
49
|
-
requirement: &
|
49
|
+
requirement: &18731040 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: 3.1.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *18731040
|
58
58
|
description: Shows cute notifications in frontend. No need to manually create your
|
59
59
|
own html/css/js to show Rails's flash[:notice] or other flashes. This handles it
|
60
60
|
nicely + you can customize it.
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- app/assets/stylesheets/_frontend_notifier.css.scss
|
78
78
|
- app/config/locales/en.yml
|
79
79
|
- app/views/shared/_frontend_notifier.html.haml
|
80
|
+
- frontend_notifier.gemspec
|
80
81
|
- lib/frontend_notifier.rb
|
81
82
|
- lib/frontend_notifier/application_controller.rb
|
82
83
|
- lib/frontend_notifier/frontend_notifier_engine.rb
|
@@ -95,7 +96,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
95
96
|
version: '0'
|
96
97
|
segments:
|
97
98
|
- 0
|
98
|
-
hash: -
|
99
|
+
hash: -1638385409759177112
|
99
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
101
|
none: false
|
101
102
|
requirements:
|