web47core 3.2.33 → 3.2.35

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
  SHA256:
3
- metadata.gz: 6be16f0ebd8d5d1f778dfad34b3224b415bb9490f013d952b559f8c56af02f2c
4
- data.tar.gz: ed20a5c570436996f98644b3cde2b89f90486afb9f4e6332c11833f1b13d22dc
3
+ metadata.gz: 507f1a54c183040f0556e3ab8bec5bffac4ffe69ad5bc5c61bc7af05e6fec2c7
4
+ data.tar.gz: 59d36d5dc86de4c074138842a81dbe3dad4c9365d872393e3f44872c62e39e46
5
5
  SHA512:
6
- metadata.gz: 421de28fc249d9cfc39fcdfc60abeb4d3dc0ecabadb4c62c022903b7e7f1b10884f054b7a5bf946c1b03a129eb66bd109211a954e5be14d5355b8822cbb10b30
7
- data.tar.gz: cdda78679f159b02a47688c14f6dc4387bc014b30128fb25db9bf04a8663d4fc9b8f0f0eee793dc3a6930c5eae310dd83b3d82d91f0e31009ef2bb9ab1445aaf
6
+ metadata.gz: df0c33fc82e216700b19c47a52541c2d51c257ca9f59d59cf9870bfd55882bd31d2480a0a2f77b9ba58bd07bb1a9479d0096335cedc31e54ca7cef17dbf9e9be
7
+ data.tar.gz: 5f0f90d0b998d31e3b47a4a817eb896caf00a8e5286f36470ca51dd5fa7315eaaeabd958a25d0387252aae4ec412b609a3ee21e000400438e43158726c5613ad
@@ -2,18 +2,28 @@
2
2
 
3
3
  # Helper methods for rendering the flash information received from the server and displaying it as toast messages
4
4
  module CoreFlashToastHelper
5
+ def flash_color(key)
6
+ case key.to_sym
7
+ when :notice then 'text-success'
8
+ when :alert then 'text-danger'
9
+ when :error then 'text-danger'
10
+ when :warning then 'text-warning'
11
+ else 'text-info'
12
+ end
13
+ end
14
+
5
15
  # @abstract render the whole toast container if there are toast messages to render
6
16
  # @return HTML - To render in the page
7
17
  def toast_container
8
18
  return if flash.blank?
9
19
 
10
- content_tag(:div, class: 'toast-container position-fixed top-0 start-50 translate-middle-x mt-5') do
20
+ content_tag(:div, class: 'toast-container position-fixed top-25 start-50 translate-middle-x mt-5') do
11
21
  flash.each { |key, value| concat(toast_flash_message(key, value)) unless 'timedout'.eql?(key) }
12
22
  end
13
23
  end
14
24
 
15
25
  def toast_flash_message(key, value)
16
- content_tag(:div, class: 'toast', role: :alert, aria: { live: :assertive, atomic: true }) do
26
+ content_tag(:div, class: 'toast hide', role: :alert, aria: { live: :assertive, atomic: true }) do
17
27
  concat(toast_flash_header(key))
18
28
  concat(content_tag(:div, class: 'toast-body') { value })
19
29
  end
@@ -21,8 +31,8 @@ module CoreFlashToastHelper
21
31
 
22
32
  def toast_flash_header(key)
23
33
  content_tag(:div, class: 'toast-header') do
24
- concat(content_tag(:i, class: [toast_flash_icon(key), 'me-2', toast_flash_color(key)].join(' ')) {})
25
- concat(content_tag(:div, style: ['me-auto', 'fw-medium', toast_flash_color(key)].join(' ')) { key.humanize })
34
+ concat(svg_icon(toast_flash_icon(key), classes: [toast_flash_color(key), 'me-2'].join(' '), size: 24))
35
+ concat(content_tag(:div, class: ['me-auto', 'fw-medium', toast_flash_color(key)].join(' ')) { key.humanize })
26
36
  concat(tag(:button,
27
37
  class: 'btn-close',
28
38
  type: :button,
@@ -31,16 +41,12 @@ module CoreFlashToastHelper
31
41
  end
32
42
  end
33
43
 
34
- # @abstract map the flash key to an icon
35
- # @return String - name of the icon to render
36
44
  def toast_flash_color(key)
37
- case key.downcase
38
- when 'alert', 'error'
39
- 'text-danger'
40
- when 'warning'
41
- 'text-warning'
42
- else
43
- 'text-info'
45
+ case key.to_sym
46
+ when :notice then 'text-success'
47
+ when :alert, :error then 'text-danger'
48
+ when :warning then 'text-warning'
49
+ else 'text-info'
44
50
  end
45
51
  end
46
52
 
@@ -49,11 +55,11 @@ module CoreFlashToastHelper
49
55
  def toast_flash_icon(key)
50
56
  case key
51
57
  when 'alert', 'error'
52
- 'ri-alert-fill'
58
+ 'alert-square-rounded'
53
59
  when 'warning'
54
- 'ri-error-warning-fill'
60
+ 'alert-triangle'
55
61
  else
56
- 'ri-information-fill'
62
+ 'info-circle'
57
63
  end
58
64
  end
59
65
  end
@@ -0,0 +1,51 @@
1
+ # app/helpers/svg_icon_helper.rb
2
+ module SvgIconHelper
3
+ # @abstract Render the appropriate icon based on the name and type
4
+ # @return [View]
5
+ def svg_icon(name, size: 24, type: :outline, classes: [], color: 'currentColor')
6
+ classes = ['icon', classes].compact.flatten.join(' ')
7
+ key = "icon_partial_path:#{name}:#{type}"
8
+ (partial, stroke) = Rails.cache.fetch(key, expires_in: 1.hour) do
9
+ path_with_type = "icons/#{name}-#{type}"
10
+ path_without_type = "icons/#{name}"
11
+
12
+ if I18n.exists?("nav.icons.#{name}")
13
+ [['icons', I18n.t("nav.icons.#{name}")].join('/'), color]
14
+ elsif lookup_context.exists?(path_with_type, [], true)
15
+ [path_with_type, color]
16
+ elsif lookup_context.exists?(path_without_type, [], true)
17
+ [path_without_type, color]
18
+ else
19
+ %w(icons/bug-outline red)
20
+ end
21
+ end
22
+
23
+ tag.svg(xmlns: "http://www.w3.org/2000/svg",
24
+ viewBox: "0 0 24 24",
25
+ width: size,
26
+ height: size,
27
+ class: classes,
28
+ fill: 'none',
29
+ stroke: stroke,
30
+ stroke_width: 1,
31
+ stroke_linecap: 'round',
32
+ stroke_linejoin: 'round') do
33
+ render partial
34
+ end
35
+ rescue StandardError
36
+ tag.svg(xmlns: "http://www.w3.org/2000/svg",
37
+ viewBox: "0 0 24 24",
38
+ width: size,
39
+ height: size,
40
+ class: classes,
41
+ fill: 'none',
42
+ stroke: 'red',
43
+ stroke_width: 1,
44
+ stroke_linecap: 'round',
45
+ stroke_linejoin: 'round',
46
+ data: { bs_toggle: :tooltip },
47
+ title: "#{name}-#{type}") do
48
+ render 'icons/bug-outline'
49
+ end
50
+ end
51
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Web47core
4
- VERSION = '3.2.33'
4
+ VERSION = '3.2.35'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web47core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.33
4
+ version: 3.2.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Schroeder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-02 00:00:00.000000000 Z
11
+ date: 2025-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -136,20 +136,6 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: materialize-sass
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :runtime
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: mongoid
155
141
  requirement: !ruby/object:Gem::Requirement
@@ -192,20 +178,6 @@ dependencies:
192
178
  - - ">="
193
179
  - !ruby/object:Gem::Version
194
180
  version: '0'
195
- - !ruby/object:Gem::Dependency
196
- name: sass
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- version: '0'
202
- type: :runtime
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - ">="
207
- - !ruby/object:Gem::Version
208
- version: '0'
209
181
  - !ruby/object:Gem::Dependency
210
182
  name: twilio-ruby
211
183
  requirement: !ruby/object:Gem::Requirement
@@ -430,20 +402,6 @@ dependencies:
430
402
  - - ">="
431
403
  - !ruby/object:Gem::Version
432
404
  version: '0'
433
- - !ruby/object:Gem::Dependency
434
- name: sass-rails
435
- requirement: !ruby/object:Gem::Requirement
436
- requirements:
437
- - - ">="
438
- - !ruby/object:Gem::Version
439
- version: '0'
440
- type: :development
441
- prerelease: false
442
- version_requirements: !ruby/object:Gem::Requirement
443
- requirements:
444
- - - ">="
445
- - !ruby/object:Gem::Version
446
- version: '0'
447
405
  - !ruby/object:Gem::Dependency
448
406
  name: shoulda
449
407
  requirement: !ruby/object:Gem::Requirement
@@ -583,6 +541,7 @@ files:
583
541
  - app/helpers/core_sso_servers_helper.rb
584
542
  - app/helpers/core_table_helper.rb
585
543
  - app/helpers/model_modal_helper.rb
544
+ - app/helpers/svg_icon_helper.rb
586
545
  - app/views/common/_create_actions.html.haml
587
546
  - app/views/common/_flash.html.haml
588
547
  - app/views/common/_form_actions.html.haml