alert_message 1.0.6.1 → 1.0.7

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
  SHA1:
3
- metadata.gz: 3af5a06a6922ef7f0f3d77d6769ad3193a80a742
4
- data.tar.gz: 50b41a5f539680e31821186805e98c3bf2968425
3
+ metadata.gz: e030f5d3131e594e4b5b9d79494cfad75ace1db0
4
+ data.tar.gz: f885f231adb8757d336f0113a6063de19ca8aaf0
5
5
  SHA512:
6
- metadata.gz: f935d79b052c0e6c61ce91417bdf7567be47b13211ba39ab895f5153b275708cfb50e3627a27e794adbfd1dec3d5736912f80295a661d2a5f32e6d8d3578dd82
7
- data.tar.gz: b614991e1fd96902b962234277a0ff8280c559a8316bda602b2d8a30247b77029fc036dd3058c4bd29e963eeed00ca6bd994d19ac6d25196a5242b033e28d064
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">&times;</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
@@ -4,7 +4,7 @@
4
4
  key = 'danger'
5
5
  end
6
6
  %>
7
- <div class="alert alert-<%= key %>">
7
+ <div class="alert-message alert-message-<%= key %>">
8
8
  <button type="button" class="close">&times;</button>
9
9
  <%= value.html_safe %>
10
10
  </div>
@@ -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
  }
@@ -1,7 +1,7 @@
1
1
  // alerts
2
2
 
3
3
  $(document).ready(function(){
4
- var alerts = $('.alert');
4
+ var alerts = $('.alert-message');
5
5
 
6
6
  setTimeout(function(){
7
7
  alerts.fadeOut(400);
@@ -1,5 +1,5 @@
1
1
  module AlertMessage
2
2
  module Version
3
- VERSION = '1.0.6.1'
3
+ VERSION = '1.0.7'
4
4
  end
5
5
  end
@@ -1,7 +1,7 @@
1
1
  // alerts
2
2
 
3
3
  $(document).ready(function(){
4
- var alerts = $('.alert');
4
+ var alerts = $('.alert-message');
5
5
 
6
6
  setTimeout(function(){
7
7
  alerts.fadeOut(400);
@@ -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.6.1
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: 2014-11-26 00:00:00.000000000 Z
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.2.2
85
+ rubygems_version: 2.4.6
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: Alert Message