From: Tom Hughes Date: Fri, 10 Mar 2017 16:30:04 +0000 (+0000) Subject: Show offline/readonly messages as normal flash messages X-Git-Tag: live~4041 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/5cdb835de3d3b40c1b40f13349da99d63e7c4047 Show offline/readonly messages as normal flash messages --- diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 40f5727cb..f7c6e74ad 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -591,12 +591,6 @@ body.compact { float: right; cursor: pointer; } - - p.error { - background-color: #ff7070; - padding: 10px; - font-weight: bold; - } } .overlay-sidebar #sidebar { diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index acc478c15..2ceeda7be 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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 diff --git a/app/views/layouts/map.html.erb b/app/views/layouts/map.html.erb index 9cd4f8a64..d8bf787a4 100644 --- a/app/views/layouts/map.html.erb +++ b/app/views/layouts/map.html.erb @@ -24,12 +24,6 @@