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

@ -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