bootstrap_flash_messages 1.0.2 → 1.1.0
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
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 4009a08cad9e7ed52609e3f7002b19af69a829fff258374fcea188ec18daba45
|
|
4
|
+
data.tar.gz: 969abf35c27433d999b12acd65f80d430e30d9e2cea2526d5b9d77d3831aaee6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3db92aa074dfb64d90321cccd2aa3ee0a4ba5c0cf08bf61bbe0d847d077c8cea0e89328d73b1edd14f214ee42facfdd2f228fc958607b187619376189bc54569
|
|
7
|
+
data.tar.gz: 3cd2784a814488ce84edf01996becf78e68d037117e68acefdd429ca4ef65632c4e2266494848e942b21aabedebc11992f11d0189df4e728d3312aeb45c4b84e
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# bootstrap_flash_messages
|
|
2
2
|
|
|
3
|
-
version 1.0
|
|
3
|
+
version 1.1.0
|
|
4
4
|
Robin Brouwer
|
|
5
5
|
|
|
6
6
|
Bootstrap alerts and Rails flash messages combined in one easy-to-use gem.
|
|
@@ -10,9 +10,9 @@ Bootstrap alerts and Rails flash messages combined in one easy-to-use gem.
|
|
|
10
10
|
|
|
11
11
|
You can use this gem by putting the following inside your Gemfile:
|
|
12
12
|
|
|
13
|
-
gem "bootstrap_flash_messages", "~> 1.0
|
|
13
|
+
gem "bootstrap_flash_messages", "~> 1.1.0"
|
|
14
14
|
|
|
15
|
-
When you're using Bootstrap 2, you can use version 0.0.7.
|
|
15
|
+
When you're using Bootstrap 3, you can use version 1.0.2. When you're using Bootstrap 2, you can use version 0.0.7.
|
|
16
16
|
|
|
17
17
|
Now you need flash.en.yml for the flash messages.
|
|
18
18
|
|
|
@@ -23,6 +23,10 @@ And that's it!
|
|
|
23
23
|
|
|
24
24
|
## Changes
|
|
25
25
|
|
|
26
|
+
Version 1.1.0 changes (21/08/2026):
|
|
27
|
+
|
|
28
|
+
- Updated to latest Bootstrap, Ruby & Rails version.
|
|
29
|
+
|
|
26
30
|
Version 1.0.2 changes (05/08/2015):
|
|
27
31
|
|
|
28
32
|
- Added :fade_in.
|
|
@@ -83,9 +87,7 @@ Version 0.0.1 changes (08/08/2012):
|
|
|
83
87
|
|
|
84
88
|
## Usage
|
|
85
89
|
|
|
86
|
-
You need [Bootstrap
|
|
87
|
-
|
|
88
|
-
If you're [customizing Bootstrap](http://getbootstrap.com/customize/), make sure to grab the "Alert" and "Component Animations" (the latter one is optional, unless you want the fade-out animation on close).
|
|
90
|
+
You need [Bootstrap 5](http://getbootstrap.com/) for the styling and close button. You can still use it without Bootstrap, but you need to style it yourself. This gem uses the [Bootstrap alerts](https://getbootstrap.com/docs/5.3/components/alerts/).
|
|
89
91
|
|
|
90
92
|
All flash messages are defined inside config/locales/flash.en.yml. They are nested like this:
|
|
91
93
|
|
|
@@ -174,20 +176,9 @@ If you'd like for the flash message to also fade in, you can pass in the `:fade_
|
|
|
174
176
|
|
|
175
177
|
# Also add something like this to application.js:
|
|
176
178
|
window.setTimeout(function() {
|
|
177
|
-
$(".alert").addClass("
|
|
179
|
+
$(".alert").addClass("show");
|
|
178
180
|
}, 1000);
|
|
179
181
|
|
|
180
|
-
# If you didn't add the "Component Animations" to your Bootstrap configuration, add this to application.css:
|
|
181
|
-
.alert.fade {
|
|
182
|
-
opacity: 0;
|
|
183
|
-
-webkit-transition: opacity 0.15s linear;
|
|
184
|
-
-moz-transition: opacity 0.15s linear;
|
|
185
|
-
-o-transition: opacity 0.15s linear;
|
|
186
|
-
transition: opacity 0.15s linear;
|
|
187
|
-
}
|
|
188
|
-
.alert.fade.in {
|
|
189
|
-
opacity: 1;
|
|
190
|
-
}
|
|
191
182
|
|
|
192
183
|
Want a heading? Add `:heading`. The headings inside flash.en.yml are used for the headings.
|
|
193
184
|
|
|
@@ -257,7 +248,9 @@ I created the [gritter gem](https://github.com/RobinBrouwer/gritter) and used it
|
|
|
257
248
|
I started using Bootstrap and really liked the alerts. I loved the way gritter allowed you to set messages
|
|
258
249
|
and decided to do the same for the Bootstrap alerts. And this is the result!
|
|
259
250
|
|
|
260
|
-
##
|
|
251
|
+
## License
|
|
252
|
+
|
|
253
|
+
### The MIT License (MIT)
|
|
261
254
|
|
|
262
255
|
Copyright (C) 2012 Robin Brouwer
|
|
263
256
|
|
|
@@ -277,4 +270,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
277
270
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
278
271
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
279
272
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
280
|
-
SOFTWARE.
|
|
273
|
+
SOFTWARE.
|
|
@@ -8,14 +8,14 @@ Gem::Specification.new do |s|
|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
|
9
9
|
s.authors = ["Robin Brouwer"]
|
|
10
10
|
s.email = ["robin@sparkforce.nl"]
|
|
11
|
-
s.homepage = "
|
|
12
|
-
s.summary =
|
|
13
|
-
s.description =
|
|
14
|
-
|
|
15
|
-
s.rubyforge_project = "nowarning"
|
|
11
|
+
s.homepage = "https://github.com/RobinBrouwer/bootstrap_flash_messages"
|
|
12
|
+
s.summary = "Bootstrap alerts for Rails flash messages."
|
|
13
|
+
s.description = "Bootstrap alerts and Rails flash messages combined in one easy-to-use gem."
|
|
14
|
+
s.license = "MIT"
|
|
16
15
|
|
|
17
16
|
s.files = `git ls-files`.split("\n")
|
|
18
17
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
19
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
20
19
|
s.require_paths = ["lib"]
|
|
20
|
+
s.required_ruby_version = ">= 3.0"
|
|
21
21
|
end
|
|
@@ -49,13 +49,13 @@ module BootstrapFlashMessages
|
|
|
49
49
|
|
|
50
50
|
begin
|
|
51
51
|
options[:raise] = true
|
|
52
|
-
translation = I18n.t(i18n_key, options)
|
|
52
|
+
translation = I18n.t(i18n_key, **options)
|
|
53
53
|
rescue I18n::MissingTranslationData
|
|
54
54
|
begin
|
|
55
|
-
translation = I18n.t(i18n_default_action_key, options)
|
|
55
|
+
translation = I18n.t(i18n_default_action_key, **options)
|
|
56
56
|
rescue I18n::MissingTranslationData
|
|
57
57
|
options[:raise] = false
|
|
58
|
-
translation = I18n.t(i18n_default_key, options)
|
|
58
|
+
translation = I18n.t(i18n_default_key, **options)
|
|
59
59
|
end
|
|
60
60
|
end
|
|
61
61
|
|
|
@@ -11,23 +11,24 @@ module BootstrapFlashMessages
|
|
|
11
11
|
fade_in = args.include?(:fade_in)
|
|
12
12
|
|
|
13
13
|
messages = []
|
|
14
|
-
flash.
|
|
15
|
-
|
|
14
|
+
flash_messages = flash.to_hash.with_indifferent_access
|
|
15
|
+
flash_messages.each do |key, value|
|
|
16
|
+
next if key == 'timedout'
|
|
16
17
|
|
|
17
18
|
heading = ""
|
|
18
19
|
if show_heading
|
|
19
20
|
heading_text = I18n.t("flash_messages.headings.#{key}")
|
|
20
|
-
heading = (block ? content_tag(:h4, heading_text, :
|
|
21
|
+
heading = (block ? content_tag(:h4, heading_text, class: "alert-heading") : content_tag(:strong, heading_text))
|
|
21
22
|
end
|
|
22
23
|
close = ""
|
|
23
24
|
if show_close
|
|
24
|
-
close = content_tag(:button,
|
|
25
|
+
close = content_tag(:button, nil, type: "button", class: "btn-close", "data-bs-dismiss" => "alert", "aria-label" => "Close")
|
|
25
26
|
end
|
|
26
27
|
|
|
27
28
|
value = simple_format(value) if simple_format
|
|
28
29
|
value = raw(value) if unescape_html
|
|
29
30
|
|
|
30
|
-
messages << content_tag(:div,
|
|
31
|
+
messages << content_tag(:div, raw(heading + " " + value + close), role: "alert", class: "alert alert-#{BootstrapFlashMessages.alert_class_mapping(key)}#{' alert-dismissible' if show_close}#{" fade#{" show" unless fade_in}" if fade || fade_in}")
|
|
31
32
|
end
|
|
32
33
|
|
|
33
34
|
raw(messages.join)
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bootstrap_flash_messages
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Robin Brouwer
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies: []
|
|
13
12
|
description: Bootstrap alerts and Rails flash messages combined in one easy-to-use
|
|
14
13
|
gem.
|
|
@@ -32,10 +31,10 @@ files:
|
|
|
32
31
|
- lib/generators/bootstrap_flash_messages/USAGE
|
|
33
32
|
- lib/generators/bootstrap_flash_messages/locale_generator.rb
|
|
34
33
|
- lib/generators/bootstrap_flash_messages/templates/flash.en.yml
|
|
35
|
-
homepage:
|
|
36
|
-
licenses:
|
|
34
|
+
homepage: https://github.com/RobinBrouwer/bootstrap_flash_messages
|
|
35
|
+
licenses:
|
|
36
|
+
- MIT
|
|
37
37
|
metadata: {}
|
|
38
|
-
post_install_message:
|
|
39
38
|
rdoc_options: []
|
|
40
39
|
require_paths:
|
|
41
40
|
- lib
|
|
@@ -43,16 +42,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
43
42
|
requirements:
|
|
44
43
|
- - ">="
|
|
45
44
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: '0'
|
|
45
|
+
version: '3.0'
|
|
47
46
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
48
47
|
requirements:
|
|
49
48
|
- - ">="
|
|
50
49
|
- !ruby/object:Gem::Version
|
|
51
50
|
version: '0'
|
|
52
51
|
requirements: []
|
|
53
|
-
|
|
54
|
-
rubygems_version: 2.2.2
|
|
55
|
-
signing_key:
|
|
52
|
+
rubygems_version: 3.6.9
|
|
56
53
|
specification_version: 4
|
|
57
|
-
summary: Bootstrap alerts
|
|
54
|
+
summary: Bootstrap alerts for Rails flash messages.
|
|
58
55
|
test_files: []
|