Merge remote-tracking branch 'upstream/pull/5403'
This commit is contained in:
commit
2cfc030bba
7 changed files with 51 additions and 27 deletions
|
@ -259,12 +259,7 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
request.content_security_policy = policy
|
||||
|
||||
case Settings.status
|
||||
when "database_offline", "api_offline"
|
||||
flash.now[:warning] = t("layouts.osm_offline")
|
||||
when "database_readonly", "api_readonly"
|
||||
flash.now[:warning] = t("layouts.osm_read_only")
|
||||
end
|
||||
flash.now[:warning] = { :partial => "layouts/offline_flash" } unless api_status == "online"
|
||||
|
||||
request.xhr? ? "xhr" : "map"
|
||||
end
|
||||
|
|
|
@ -107,6 +107,14 @@ class SiteController < ApplicationController
|
|||
rescue ActiveRecord::RecordNotFound
|
||||
# don't try and derive a location from a missing/deleted object
|
||||
end
|
||||
|
||||
if api_status != "online"
|
||||
flash.now[:warning] = { :partial => "layouts/offline_flash" }
|
||||
elsif current_user && !current_user.data_public?
|
||||
flash.now[:warning] = { :partial => "not_public_flash" }
|
||||
else
|
||||
@enable_editor = true
|
||||
end
|
||||
end
|
||||
|
||||
def copyright
|
||||
|
@ -129,11 +137,7 @@ class SiteController < ApplicationController
|
|||
def export; end
|
||||
|
||||
def offline
|
||||
flash.now[:warning] = if Settings.status == "database_offline"
|
||||
t("layouts.osm_offline")
|
||||
else
|
||||
t("layouts.osm_read_only")
|
||||
end
|
||||
flash.now[:warning] = { :partial => "layouts/offline_flash" }
|
||||
render :html => nil, :layout => true
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue