Show offline/readonly messages as normal flash messages

This commit is contained in:
Tom Hughes 2017-03-10 16:30:04 +00:00
parent ae4c00da8c
commit 5cdb835de3
3 changed files with 6 additions and 12 deletions

View file

@ -591,12 +591,6 @@ body.compact {
float: right;
cursor: pointer;
}
p.error {
background-color: #ff7070;
padding: 10px;
font-weight: bold;
}
}
.overlay-sidebar #sidebar {

View file

@ -415,6 +415,12 @@ class ApplicationController < ActionController::Base
:img_src => %w(developer.mapquest.com)
)
if STATUS == :database_offline || STATUS == :api_offline
flash.now[:warning] = t("layouts.osm_offline")
elsif STATUS == :database_readonly || STATUS == :api_readonly
flash.now[:warning] = t("layouts.osm_read_only")
end
request.xhr? ? "xhr" : "map"
end

View file

@ -24,12 +24,6 @@
<div id="sidebar">
<%= render :partial => "layouts/search", :locals => { :autofocus => true } %>
<% if STATUS == :database_offline or STATUS == :api_offline %>
<p class="error"><%= t 'layouts.osm_offline' %></p>
<% elsif STATUS == :database_readonly or STATUS == :api_readonly %>
<p class="error"><%= t 'layouts.osm_read_only' %></p>
<% end %>
<div id="flash">
<%= render :partial => "layouts/flash" %>
</div>