web47core 3.2.3.45 → 3.2.3.47
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 +4 -4
- data/app/controllers/status_controller.rb +4 -4
- data/app/helpers/svg_icon_helper.rb +12 -20
- data/app/views/status/index.html.haml +2 -3
- data/lib/web47core/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fac443ea8a3048e4785964d2899475fd8ac9025610a8f654250a900831228d06
|
|
4
|
+
data.tar.gz: ad2d4ae7bf3120c6ea32c065a486f0c8c7c7533b228b2cdb3c9ea1933648fad2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d8ad5891e0a99c57d3a4d507c368adf58060d2ff3b85558dbef0be63f3ef67ed0971270ec5d7bf46f46a5cef06fccd70b2b157b8a8c27293746d3be961838c09
|
|
7
|
+
data.tar.gz: e9c1e1d9ade0fb0923f42199477d47692b83564c372a900217acefc8904291c1eefefd90f02a06284cc49a89a94899f29f5444b0bc71e9e953ea8ea44ae5b12c
|
|
@@ -40,11 +40,11 @@ class StatusController < ActionController::Base
|
|
|
40
40
|
def ui_decorators(components)
|
|
41
41
|
components.each do |key, values|
|
|
42
42
|
if values[:success]
|
|
43
|
-
components[key][:icon_name] = '
|
|
44
|
-
components[key][:icon_color] =
|
|
43
|
+
components[key][:icon_name] = 'circle-check'
|
|
44
|
+
components[key][:icon_color] = :green
|
|
45
45
|
else
|
|
46
|
-
components[key][:icon_name] = '
|
|
47
|
-
components[key][:icon_color] =
|
|
46
|
+
components[key][:icon_name] = 'circle-x'
|
|
47
|
+
components[key][:icon_color] = :red
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
50
|
end
|
|
@@ -6,30 +6,23 @@ module SvgIconHelper
|
|
|
6
6
|
def svg_icon(name, size: 24, type: :outline, classes: [], color: 'currentColor', stroke_width: 2)
|
|
7
7
|
return if name.blank?
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
Rails.cache.fetch(key, expires_in: 15.minutes) do
|
|
11
|
-
fetch_svg_icon(name, size: size, type: type, classes: classes, color: color, stroke_width: stroke_width)
|
|
12
|
-
end
|
|
9
|
+
fetch_svg_icon(name, size: size, type: type, classes: classes, color: color, stroke_width: stroke_width)
|
|
13
10
|
end
|
|
14
11
|
|
|
15
12
|
def fetch_svg_icon(name, size: 24, type: :outline, classes: [], color: 'currentColor', stroke_width: 2)
|
|
16
13
|
return if name.blank?
|
|
17
14
|
|
|
18
15
|
classes = classes.compact.flatten.join(' ')
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
[preferred_path, outline_path, filled_path].collect do |path|
|
|
30
|
-
[preferred_path, color] if lookup_context.exists?(path, [], true)
|
|
31
|
-
end.compact.first
|
|
32
|
-
end
|
|
16
|
+
preferred_path = if I18n.exists?("nav.icons.#{name}")
|
|
17
|
+
"icons/#{I18n.t("nav.icons.#{name}")}"
|
|
18
|
+
else
|
|
19
|
+
"icons/#{type}/#{name}"
|
|
20
|
+
end
|
|
21
|
+
outline_path = "icons/outline/#{name}"
|
|
22
|
+
filled_path = "icons/filled/#{name}"
|
|
23
|
+
(partial, stroke) = [preferred_path, outline_path, filled_path].collect do |path|
|
|
24
|
+
[preferred_path, color] if lookup_context.exists?(path, [], true)
|
|
25
|
+
end.compact.first
|
|
33
26
|
if partial.blank?
|
|
34
27
|
partial = 'icons/outline/bug'
|
|
35
28
|
stroke = 'red'
|
|
@@ -48,8 +41,7 @@ module SvgIconHelper
|
|
|
48
41
|
title: name) do
|
|
49
42
|
render partial
|
|
50
43
|
end
|
|
51
|
-
rescue StandardError
|
|
52
|
-
puts "Error: #{error}"
|
|
44
|
+
rescue StandardError
|
|
53
45
|
tag.svg(xmlns: 'http://www.w3.org/2000/svg',
|
|
54
46
|
viewBox: '0 0 24 24',
|
|
55
47
|
width: size,
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
%meta{ name: 'apple-mobile-web-app-capable', content: 'yes'}
|
|
7
7
|
%meta{ name: 'apple-mobile-web-app-status-bar-style', content: 'black'}
|
|
8
8
|
= stylesheet_link_tag 'https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css'
|
|
9
|
-
= stylesheet_link_tag 'https://fonts.googleapis.com/icon?family=Material+Icons'
|
|
10
9
|
%title="#{Rails.env} Status"
|
|
11
10
|
%body{ style: 'background-color: #006064;'}
|
|
12
11
|
%header
|
|
@@ -32,7 +31,7 @@
|
|
|
32
31
|
%td
|
|
33
32
|
%h4.flow-text=key.to_s.titleize
|
|
34
33
|
%td.center
|
|
35
|
-
%
|
|
36
|
-
= value[:icon_name]
|
|
34
|
+
%svg{xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 24 24', width: 32, height: 32, fill: 'none', stroke: value[:icon_color].to_s, style: "color: #{value[:icon_color]}", 'stroke-width': 2, 'stroke-linecap': 'round', 'stroke-linejoin': 'round', title: value[:icon_name]}
|
|
35
|
+
= render "icons/outline/#{value[:icon_name]}"
|
|
37
36
|
%td.center.hide-on-small-only
|
|
38
37
|
%h4.flow-text.large=value[:message]
|
data/lib/web47core/version.rb
CHANGED