This allows more complex HTML in the message, closing #896.
/* Rules for "flash" notice boxes shown at the top of the content area */
/* Rules for "flash" notice boxes shown at the top of the content area */
- background-color: #ff7070;
-}
-.warning {
- padding: $lineheight;
- background-color: #ffe0cc;
-}
+ &.error {
+ background-color: #ff7070;
+ }
-.notice {
- padding: $lineheight;
- background-color: #CBEEA7;
+ &.warning {
+ background-color: #ffe0cc;
+ }
+
+ &.notice {
+ background-color: #CBEEA7;
+ }
+
+ div.message {
+ display: inline-block;
+ margin-left: $lineheight / 2;
+ vertical-align: middle;
+ }
}
/* Rules for highlighting fields with rails validation errors */
}
/* Rules for highlighting fields with rails validation errors */
+ <div class="flash error">
<%= image_tag("notice.png", :class => "small_icon", :border => 0) %>
<%= image_tag("notice.png", :class => "small_icon", :border => 0) %>
- <%= raw flash[:error] %>
- </p>
+ <div class="message"><%= raw flash[:error] %></div>
+ </div>
<% end %>
<% if flash[:warning] %>
<% end %>
<% if flash[:warning] %>
+ <div class="flash warning">
<%= image_tag("notice.png", :class => "small_icon", :border => 0) %>
<%= image_tag("notice.png", :class => "small_icon", :border => 0) %>
- <%= raw flash[:warning] %>
- </p>
+ <div class="message"><%= raw flash[:warning] %></div>
+ </div>
<% end %>
<% if flash[:notice] %>
<% end %>
<% if flash[:notice] %>
+ <div class="flash notice">
<%= image_tag("notice.png", :class => "small_icon", :border => 0) %>
<%= image_tag("notice.png", :class => "small_icon", :border => 0) %>
- <%= raw flash[:notice] %>
- </p>
+ <div class="message"><%= raw flash[:notice] %></div>
+ </div>
:message => { :title => "Test Message", :body => "Test message body" }
assert_response :success
assert_template "new"
:message => { :title => "Test Message", :body => "Test message body" }
assert_response :success
assert_template "new"
- assert_select "p.error", /wait a while/
+ assert_select ".error", /wait a while/