diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 3c31b0318..846e3adc9 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1191,28 +1191,59 @@ input.autocomplete.ajax-loading { } div.flash {margin-top: 8px;} +div.flash svg.icon-svg, #errorExplanation svg.icon-svg, .conflict svg.icon-svg { + margin-right: 4px; + margin-left: -26px; +} 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:not(:has(svg)) { + background: url(/exclamation.png) 8px 50% no-repeat #ffe3e3; +} +div.flash.error svg.icon-svg, #errorExplanation svg.icon-svg { + stroke: #880000; +} + +#errorExplanation:has(svg) { + position: relative; +} + +#errorExplanation:has(svg) > svg.icon-svg { + position: absolute; + top: 50%; + bottom: 50%; + margin-left: -24px; + margin-top: -9px; +} 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)), .conflict:not(:has(svg)) { + background: url(/warning.png) 8px 5px no-repeat #F3EDD1; +} +div.flash.warning svg.icon-svg, .conflict svg.icon-svg { + stroke: #A6750C; +} .nodata, .warning { text-align: center; diff --git a/app/assets/stylesheets/rtl.css b/app/assets/stylesheets/rtl.css index 83b08b23b..550071462 100644 --- a/app/assets/stylesheets/rtl.css +++ b/app/assets/stylesheets/rtl.css @@ -241,16 +241,21 @@ input.autocomplete { padding: 4px 30px 4px 4px; } -div.flash.error, #errorExplanation { - background: url(/exclamation.png) right 8px top 50% no-repeat; +div.flash svg.icon-svg, #errorExplanation svg.icon-svg { + margin-right: -26px; + margin-left: 4px; } -div.flash.notice { - background: url(/true.png) right 8px top 5px no-repeat; +div.flash.error:not(:has(svg)), #errorExplanation:not(:has(svg)) { + background: url(/exclamation.png) right 8px top 50% no-repeat #ffe3e3; } -div.flash.warning, .conflict { - background: url(/warning.png) right 8px top 5px no-repeat; +div.flash.notice:not(:has(svg)) { + background: url(/true.png) right 8px top 5px no-repeat #dfffdf; +} + +div.flash.warning:not(:has(svg)), .conflict { + background: url(/warning.png) right 8px top 5px no-repeat #F3EDD1; text-align:right; } diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7e8c764dd..26a1941ac 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -511,7 +511,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 @@ -1569,7 +1569,9 @@ module ApplicationHelper def render_error_messages(errors) html = +"" if errors.present? - html << "