From 8891d17efc306b65f90b0b3e8aeef8e78167320c Mon Sep 17 00:00:00 2001 From: Christian Ratz Date: Mon, 2 Dec 2013 11:52:51 +0100 Subject: [PATCH] use icons from icon font for flash msgs --- app/assets/stylesheets/default/application.css.erb | 14 +++++--------- .../fonts/openproject_icon_font.css.sass | 7 +++++++ app/helpers/application_helper.rb | 4 ++-- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/app/assets/stylesheets/default/application.css.erb b/app/assets/stylesheets/default/application.css.erb index b1fe20503d..efa6e467e9 100644 --- a/app/assets/stylesheets/default/application.css.erb +++ b/app/assets/stylesheets/default/application.css.erb @@ -528,7 +528,7 @@ div#tab-content-members fieldset div.select-boxes .select2-container { /***** Flash & error messages ****/ #errorExplanation, div.flash, .nodata, .warning { - padding: 4px 4px 4px 30px; + padding: 4px; margin-bottom: 12px; border: 2px solid; margin: 0 0 10px; @@ -570,7 +570,7 @@ div.flash.error a:hover, div.flash.warning a:hover, div.flash.notice a:hover, #e color: #A6750C; } -#errorExplanation ul { font-size: 0.9em;} +#errorExplanation ul { font-size: 0.9em; margin-left: 30px;} #errorExplanation h2, #errorExplanation p { display: none; } /***** Ajax indicator ******/ @@ -2206,23 +2206,19 @@ div.flash { } div.flash.error, #errorExplanation { - background: #FAAA96 url(<%= asset_path 'webalys/error.png' %>) 8px 50% no-repeat; + background-color: #FAAA96; border: none; color: #000000; } -#errorExplanation { - background-position: 12px 50%; -} - div.flash.notice { - background: #C8F0BE url(<%= asset_path 'webalys/check.png' %>) 11px 6px no-repeat; + background-color: #C8F0BE; border: none; color: #000000; } div.flash.warning { /* orange */ - background: #FFC38C url(<%= asset_path 'webalys/warning.png' %>) 9px 5px no-repeat; + background-color: #FFC38C; border: none; color: #000000; text-align: left; diff --git a/app/assets/stylesheets/fonts/openproject_icon_font.css.sass b/app/assets/stylesheets/fonts/openproject_icon_font.css.sass index 539d590729..d33c2665f5 100644 --- a/app/assets/stylesheets/fonts/openproject_icon_font.css.sass +++ b/app/assets/stylesheets/fonts/openproject_icon_font.css.sass @@ -110,6 +110,11 @@ $link_hover_color: #008BD0 .icon5:before @include icon5-rules +#errorExplanation:before + @include icon-common + @include icon-rules + float: left + #context-menu .icon:before, .icon-context:before @include icon-context-rules @@ -151,6 +156,7 @@ dt.changeset:before, .icon-duplicate:before content: "\e00b" +#errorExplanation:before, .icon-error:before content: "\e00c" @@ -726,6 +732,7 @@ dt.reply:before, .icon-yes2:before content: "\e0c7" +.icon-notice:before, .icon-yes:before content: "\e0c8" diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3e12241077..4c66e66bf1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -266,9 +266,9 @@ module ApplicationHelper # Renders flash messages def render_flash_messages if User.current.impaired? - flash.map { |k,v| content_tag('div', content_tag('a', join_flash_messages(v), :href => 'javascript:;'), :class => "flash #{k}") }.join.html_safe + flash.map { |k,v| content_tag('div', content_tag('a', join_flash_messages(v), :href => 'javascript:;'), :class => "flash #{k} icon icon-#{k}") }.join.html_safe else - flash.map { |k,v| content_tag('div', join_flash_messages(v), :class => "flash #{k}") }.join.html_safe + flash.map { |k,v| content_tag('div', join_flash_messages(v), :class => "flash #{k} icon icon-#{k}") }.join.html_safe end end