From c128e47a562240228b3e3517261a49f3774f9215 Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Sun, 29 Sep 2024 19:19:53 +0000 Subject: [PATCH] Drops icon-error and style the error icon from CSS (#23980). git-svn-id: https://svn.redmine.org/redmine/trunk@23092 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/assets/images/icons.svg | 5 ----- app/assets/stylesheets/application.css | 12 ++++++------ app/helpers/icons_helper.rb | 4 +++- app/views/admin/info.html.erb | 6 +++++- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/app/assets/images/icons.svg b/app/assets/images/icons.svg index 938ca792f..43d476b46 100644 --- a/app/assets/images/icons.svg +++ b/app/assets/images/icons.svg @@ -158,11 +158,6 @@ - - - - - diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 9e02fb871..ddda3d9af 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1673,14 +1673,14 @@ a.icon:hover svg, a.icon-only:hover svg { stroke: #c61a1a; } -svg.icon-error { - stroke: #f37c60; -} - svg.icon-ok { stroke: #5db651; } +.icon-error svg.icon-svg { + stroke: #c61a1a +} + .icon-warning svg { stroke: #e4bc4b; } @@ -1771,7 +1771,7 @@ span.icon-label { .icon-time-add:not(:has(svg)) { background-image: url(/time_add.png); } .icon-stats:not(:has(svg)) { background-image: url(/stats.png); } .icon-warning:not(:has(svg)) { background-image: url(/warning.png); } -.icon-error:not(svg) { background-image: url(/exclamation.png); } +.icon-error:not(:has(svg)) { background-image: url(/exclamation.png); } .icon-fav:not(:has(svg)) { background-image: url(/fav.png); } .icon-fav-off:not(:has(svg)) { background-image: url(/fav_off.png); } .icon-reload:not(:has(svg)) { background-image: url(/reload.png); } @@ -1791,7 +1791,7 @@ span.icon-label { .icon-email:not(:has(svg)) { background-image: url(/email.png); } .icon-email-disabled:not(:has(svg)) { background-image: url(/email_disabled.png); } .icon-email-add:not(:has(svg)) { background-image: url(/email_add.png); } -.icon-ok:not(svg) { background-image: url(/true.png); } +.icon-ok:not(:has(svg)) { background-image: url(/true.png); } .icon-not-ok:not(svg) { background-image: url(/false.png); } .icon-link-break:not(:has(svg)) { background-image: url(/link_break.png); } .icon-list:not(:has(svg)) { background-image: url(/text_list_bullets.png); } diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb index 7ba87063b..e297d950b 100644 --- a/app/helpers/icons_helper.rb +++ b/app/helpers/icons_helper.rb @@ -57,11 +57,13 @@ module IconsHelper def sprite_icon(icon_name, size: DEFAULT_ICON_SIZE, sprite: DEFAULT_SPRITE, css_class: nil) sprite_path = "#{sprite}.svg" + css_classes = "s#{size} icon-svg" + css_classes += " #{css_class}" unless css_class.nil? content_tag( :svg, content_tag(:use, '', { 'href' => "#{asset_path(sprite_path)}#icon--#{icon_name}" }), - class: "s#{size} icon-svg", + class: css_classes, aria: { hidden: true } diff --git a/app/views/admin/info.html.erb b/app/views/admin/info.html.erb index 197bf5993..23917ef7a 100644 --- a/app/views/admin/info.html.erb +++ b/app/views/admin/info.html.erb @@ -6,7 +6,11 @@ <% @checklist.each do |label, result| %> <%= label.is_a?(Symbol) ? l(label) : label %> - <%= result ? sprite_icon('checked', css_class: "icon-ok") : sprite_icon('error', css_class: "icon-error") %> + + "> + <%= result ? sprite_icon('checked') : sprite_icon('warning') %> + + <% end %> -- 2.39.5