symphonia 6.0.1 → 6.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f034a817b0bd541952d88dc3cba25f070c3cae9f1b41b3af8bca9fde726e5619
4
- data.tar.gz: 73f459bc41f83962e7d4cae3025d0b14a73d8cacf7a213b657da2c481aa287b1
3
+ metadata.gz: 24d7848d1bca3b518accb57564e9c07c7b4650e5a02e5bd9c3bd33fbe60c5d72
4
+ data.tar.gz: '078af52f5b5c5efe3fd4ac6bf2935250e25a83e98bfc842f8878413d21ec86a9'
5
5
  SHA512:
6
- metadata.gz: 791777de872efd8f029e91ba45840d783b82be97e184d046f6becbef28317d2de307a75d8013f69c256fafc4f15ee93c56409135278fd5f18f5b816263644585
7
- data.tar.gz: 67aceb9801e3acf318c4227d7bf41046d0a3304533493a649d80cb187369725d710aa18bd4ebdbd7c477bed5afbba64377d0b65e27b207549d2e23ad75eb3e00
6
+ metadata.gz: 85b194d20074685cd3f206e06be37240876fd805892180e60c38060d366efeb48b662c1296f5b277042778c997588d363224697e2c545f475dc970caae447962
7
+ data.tar.gz: b23fad9e94c8d44c72feb31d42666f8bbdc610d9a598830d223a8784b32a1856464596af5ac651cc44a485bd7bf0ea341c5e310d4f9e5e86451209f4bb4fbdca
@@ -3,31 +3,27 @@ module Symphonia
3
3
 
4
4
  include FormHelper
5
5
 
6
- def bootstrap_class_for(flash_type)
7
- case flash_type.to_sym
8
- when :notice
9
- 'alert-success'
10
- when :error, :alert
11
- 'alert-danger'
12
- when :warning
13
- 'alert-warning'
14
- when :info
15
- 'alert-info'
16
- else
17
- flash_type.to_s
18
- end
6
+ def bootstrap_flash_map
7
+ {
8
+ "notice" => { class_name: "alert-success", icon: "check-circle" },
9
+ "error" => { class_name: "alert-danger", icon: "circle-exclamation" },
10
+ "warning" => { class_name: "alert-warning", icon: "circle-exclamation" },
11
+ "info" => { class_name: "alert-info", icon: "info-circle" },
12
+ }
19
13
  end
20
14
 
21
15
  # Renders flash messages
22
16
  def render_flash_messages(flash_messages = nil)
23
- s = ''
17
+ s = ""
24
18
  Array(flash_messages || flash).each do |type, message|
25
- s << tag.div(class: "d-print-none alert #{bootstrap_class_for(type)}") do
26
- tag.button('', class: 'fa fa-circle-xmark close', data: { dismiss: 'alert' }) + Array.wrap(message).collect { |m| icon(type, text: m) }.join("<br>").html_safe
19
+ bootstrap_flash = bootstrap_flash_map[type]
20
+ s << tag.div(class: "d-print-none alert #{bootstrap_flash[:class_name]} alert-dismissible fade show", role: "alert") do
21
+ icon(bootstrap_flash[:icon], text: message) +
22
+ tag.button("", class: "btn-close close", data: { "bs-dismiss" => "alert" }, "aria-label" => t(:button_close))
27
23
  end
28
24
  end
29
25
 
30
- s.html_safe
26
+ s
31
27
  end
32
28
 
33
29
  def render_menu(menu, options = {})
@@ -1,5 +1,5 @@
1
1
  module Symphonia
2
2
 
3
- VERSION = '6.0.1'
3
+ VERSION = '6.0.2'
4
4
 
5
5
  end
@@ -24,19 +24,19 @@ RSpec.describe Symphonia::ApplicationHelper do
24
24
 
25
25
  describe "#render_flash_messages" do
26
26
  it "render error" do
27
- r = helper.render_flash_messages(error: "flash message")
27
+ r = helper.render_flash_messages("error" => "flash message")
28
28
  expect(r).to include "danger"
29
29
  end
30
30
  it "render notice" do
31
- r = helper.render_flash_messages(notice: "flash message")
31
+ r = helper.render_flash_messages("notice" => "flash message")
32
32
  expect(r).to include "success"
33
33
  end
34
34
  it "render warning" do
35
- r = helper.render_flash_messages(warning: "flash message")
35
+ r = helper.render_flash_messages("warning" => "flash message")
36
36
  expect(r).to include "warning"
37
37
  end
38
38
  it "render info" do
39
- r = helper.render_flash_messages(info: "flash message")
39
+ r = helper.render_flash_messages("info" => "flash message")
40
40
  expect(r).to include "info"
41
41
  end
42
42
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: symphonia
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.1
4
+ version: 6.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas Pokorny
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-17 00:00:00.000000000 Z
11
+ date: 2023-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: api-pagination
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.7'
19
+ version: '5.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '4.7'
26
+ version: '5.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: authlogic
29
29
  requirement: !ruby/object:Gem::Requirement