alert_message 1.0.6.1 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -0
- data/lib/generators/alert_message/install_generator.rb +0 -2
- data/lib/generators/alert_message/templates/_alerts.html.erb +1 -1
- data/lib/generators/alert_message/templates/alerts.css.scss +4 -4
- data/lib/generators/alert_message/templates/alerts.js +1 -1
- data/lib/version/version.rb +1 -1
- data/vendor/assets/javascripts/alert_message.js +1 -1
- data/vendor/assets/stylesheets/alert_message.css.scss +5 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e030f5d3131e594e4b5b9d79494cfad75ace1db0
|
4
|
+
data.tar.gz: f885f231adb8757d336f0113a6063de19ca8aaf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7799a233f7004d5fbd7b08100226b8576b4a8755de9c5e82daf7fdec122a2625ebd7daf29b35ac948d3a0977f2a7f17a7f138d858213d8b7c68e33db965608d8
|
7
|
+
data.tar.gz: 731eb30080150517619e0c5c17a23a85ac1965fb26b7290f1c94e6604c920e91cc2b40f063b33ee4b5b0d799354a086c63852b47a7978ac2af13f2bb78380537
|
data/README.md
CHANGED
@@ -46,6 +46,30 @@ To show your alerts, use:
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
+
## Custom message to Devise
|
50
|
+
|
51
|
+
Some devise screens do not accept Flash Messages. For this we will use a custom helper.
|
52
|
+
|
53
|
+
Add in your app/views/layouts/_alerts.html.erb
|
54
|
+
|
55
|
+
<%= show_messages %>
|
56
|
+
|
57
|
+
Create helper alert_message_helper.rb
|
58
|
+
|
59
|
+
module AlertMessageHelper
|
60
|
+
def show_messages
|
61
|
+
return "" if resource.errors.empty?
|
62
|
+
messages = resource.errors.full_messages
|
63
|
+
html = <<-HTML
|
64
|
+
<div class="alert alert-danger">
|
65
|
+
<button type="button" class="close">×</button>
|
66
|
+
#{messages.first}
|
67
|
+
</div>
|
68
|
+
HTML
|
69
|
+
html.html_safe
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
49
73
|
## Demo
|
50
74
|
|
51
75
|
[https://alert-message.herokuapp.com/](https://alert-message.herokuapp.com/)
|
@@ -3,8 +3,6 @@ module AlertMessage
|
|
3
3
|
source_root File.expand_path('../templates', __FILE__)
|
4
4
|
|
5
5
|
def copy_gfiles_alert
|
6
|
-
# copy_file "alerts.js", "app/assets/javascripts/alerts.js"
|
7
|
-
# copy_file "alerts.css.scss", "app/assets/stylesheets/alerts.css.scss"
|
8
6
|
copy_file "_alerts.html.erb", "app/views/layouts/_alerts.html.erb"
|
9
7
|
end
|
10
8
|
end
|
@@ -11,7 +11,7 @@ $alert-notice: #2980b9; // azul
|
|
11
11
|
box-sizing: $boxmodel;
|
12
12
|
}
|
13
13
|
|
14
|
-
.alert {
|
14
|
+
.alert-message {
|
15
15
|
cursor: pointer;
|
16
16
|
@include box-sizing(border-box);
|
17
17
|
|
@@ -47,14 +47,14 @@ $alert-notice: #2980b9; // azul
|
|
47
47
|
}
|
48
48
|
}
|
49
49
|
|
50
|
-
.alert-success {
|
50
|
+
.alert-message-success {
|
51
51
|
background: $alert-success;
|
52
52
|
}
|
53
53
|
|
54
|
-
.alert-danger {
|
54
|
+
.alert-message-danger {
|
55
55
|
background: $alert-danger;
|
56
56
|
}
|
57
57
|
|
58
|
-
.alert-notice {
|
58
|
+
.alert-message-notice {
|
59
59
|
background: $alert-success;
|
60
60
|
}
|
data/lib/version/version.rb
CHANGED
@@ -11,7 +11,7 @@ $alert-notice: #2980b9; // azul
|
|
11
11
|
box-sizing: $boxmodel;
|
12
12
|
}
|
13
13
|
|
14
|
-
.alert {
|
14
|
+
.alert-message {
|
15
15
|
cursor: pointer;
|
16
16
|
@include box-sizing(border-box);
|
17
17
|
|
@@ -23,7 +23,7 @@ $alert-notice: #2980b9; // azul
|
|
23
23
|
width: 100%;
|
24
24
|
|
25
25
|
color: $text-1;
|
26
|
-
font-size: 1.4em;
|
26
|
+
font-size: 1.4em !important;
|
27
27
|
text-align: center;
|
28
28
|
|
29
29
|
padding: 10px;
|
@@ -47,14 +47,14 @@ $alert-notice: #2980b9; // azul
|
|
47
47
|
}
|
48
48
|
}
|
49
49
|
|
50
|
-
.alert-success {
|
50
|
+
.alert-message-success {
|
51
51
|
background: $alert-success;
|
52
52
|
}
|
53
53
|
|
54
|
-
.alert-danger {
|
54
|
+
.alert-message-danger {
|
55
55
|
background: $alert-danger;
|
56
56
|
}
|
57
57
|
|
58
|
-
.alert-notice {
|
58
|
+
.alert-message-notice {
|
59
59
|
background: $alert-success;
|
60
60
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alert_message
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luiz Picolo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
84
|
rubyforge_project:
|
85
|
-
rubygems_version: 2.
|
85
|
+
rubygems_version: 2.4.6
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Alert Message
|