mirror of
https://github.com/meineerde/redmine.git
synced 2026-01-31 11:37:14 +00:00
Replaces legacy icons in flash notices with SVG icons (#41952).
git-svn-id: https://svn.redmine.org/redmine/trunk@23562 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
f84ef7a6b4
commit
f8292b56df
@ -1194,28 +1194,49 @@ input.autocomplete.ajax-loading {
|
||||
}
|
||||
|
||||
div.flash {margin-top: 8px;}
|
||||
div.flash:has(svg) {
|
||||
padding-left: 10px;
|
||||
}
|
||||
div.flash svg.icon-svg {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
div.flash.error, #errorExplanation {
|
||||
background: url(/exclamation.png) 8px 50% no-repeat;
|
||||
background-color: #ffe3e3;
|
||||
border-color: #d88;
|
||||
color: #880000;
|
||||
}
|
||||
div.flash.error:not(:has(svg)), #errorExplanation {
|
||||
background: url(/exclamation.png) 8px 50% no-repeat #ffe3e3;
|
||||
}
|
||||
div.flash.error svg.icon-svg {
|
||||
stroke: #880000;
|
||||
}
|
||||
|
||||
div.flash.notice {
|
||||
background: url(/true.png) 8px 5px no-repeat;
|
||||
background-color: #dfffdf;
|
||||
border-color: #9fcf9f;
|
||||
color: #005f00;
|
||||
}
|
||||
div.flash.notice:not(:has(svg)) {
|
||||
background: url(/true.png) 8px 50% no-repeat #dfffdf;
|
||||
}
|
||||
div.flash.notice svg.icon-svg {
|
||||
stroke: #005f00;
|
||||
}
|
||||
|
||||
div.flash.warning, .conflict {
|
||||
background: url(/warning.png) 8px 5px no-repeat;
|
||||
background-color: #F3EDD1;
|
||||
border-color: #eadbbc;
|
||||
color: #A6750C;
|
||||
text-align: left;
|
||||
}
|
||||
div.flash.warning:not(:has(svg)) {
|
||||
background: url(/warning.png) 8px 5px no-repeat #F3EDD1;
|
||||
}
|
||||
div.flash.warning svg.icon-svg {
|
||||
stroke: #A6750C;
|
||||
}
|
||||
|
||||
.nodata, .warning {
|
||||
text-align: center;
|
||||
|
||||
@ -518,7 +518,7 @@ module ApplicationHelper
|
||||
def render_flash_messages
|
||||
s = +''
|
||||
flash.each do |k, v|
|
||||
s << content_tag('div', v.html_safe, :class => "flash #{k}", :id => "flash_#{k}")
|
||||
s << content_tag('div', notice_icon(k) + v.html_safe, :class => "flash #{k}", :id => "flash_#{k}")
|
||||
end
|
||||
s.html_safe
|
||||
end
|
||||
|
||||
@ -79,6 +79,19 @@ module IconsHelper
|
||||
sprite_icon(icon_name, name, size: 14)
|
||||
end
|
||||
|
||||
def notice_icon(type, **options)
|
||||
icon_name = case type
|
||||
when 'notice'
|
||||
'checked'
|
||||
when 'warning'
|
||||
'warning'
|
||||
when 'error'
|
||||
'warning'
|
||||
end
|
||||
|
||||
sprite_icon(icon_name, **options)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def svg_sprite_icon(icon_name, size: DEFAULT_ICON_SIZE, sprite: DEFAULT_SPRITE, css_class: nil)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user