Render flash in sidebar

This commit is contained in:
John Firebaugh 2013-10-04 17:34:06 -07:00
parent 6157280d19
commit ecbe27b373
3 changed files with 29 additions and 20 deletions

View file

@ -561,10 +561,6 @@ nav.secondary {
width: $sidebarWidth;
border-right: $keyline;
.alert {
background: #e00;
}
h2, h3, h4 {
padding: $lineheight;
border-bottom: $keyline;
@ -1541,17 +1537,19 @@ a.donate {
/* Rules for "flash" notice boxes shown at the top of the content area */
.flash {
padding: $lineheight;
&#error {
background-color: #ff7070;
}
&#warning {
background-color: #ffe0cc;
}
&#notice {
background-color: #CBEEA7;
}
.error {
padding: $lineheight;
background-color: #ff7070;
}
.warning {
padding: $lineheight;
background-color: #ffe0cc;
}
.notice {
padding: $lineheight;
background-color: #CBEEA7;
}
/* Rules for highlighting fields with rails validation errors */

View file

@ -1,11 +1,20 @@
<% if flash[:error] %>
<div id="error" class="flash"><%=image_tag("notice.png", :class => "small_icon", :border=>0)%><%= raw flash[:error] %></div>
<p class="error">
<%= image_tag("notice.png", :class => "small_icon", :border => 0) %>
<%= raw flash[:error] %>
</p>
<% end %>
<% if flash[:warning] %>
<div id="warning" class="flash"><%=image_tag("notice.png", :class => "small_icon", :border=>0)%><%= raw flash[:warning] %></div>
<p class="warning">
<%= image_tag("notice.png", :class => "small_icon", :border => 0) %>
<%= raw flash[:warning] %>
</p>
<% end %>
<% if flash[:notice] %>
<div id="notice" class="flash"><%=image_tag("notice.png", :class => "small_icon", :border=>0)%><%= raw flash[:notice] %></div>
<p class="notice">
<%= image_tag("notice.png", :class => "small_icon", :border => 0) %>
<%= raw flash[:notice] %>
</p>
<% end %>

View file

@ -17,11 +17,13 @@
<div id="sidebar_content">
<% if STATUS == :database_offline or STATUS == :api_offline %>
<p class="alert"><%= t 'layouts.osm_offline' %></p>
<p class="error"><%= t 'layouts.osm_offline' %></p>
<% elsif STATUS == :database_readonly or STATUS == :api_readonly %>
<p class="alert"><%= t 'layouts.osm_read_only' %></p>
<p class="error"><%= t 'layouts.osm_read_only' %></p>
<% end %>
<%= render :partial => "layouts/flash" %>
<%= yield %>
</div>
</div>