X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/70dfeb0f3b32f61302412730653b28604b1b9e6b..0f5646d7f0e0ccaf3e7b5fd36c9ac4047d5df210:/app/controllers/trace_controller.rb diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index 2eaacbf34..9addcbfec 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -11,6 +11,8 @@ class TraceController < ApplicationController before_filter :check_api_writable, :only => [:api_create] before_filter :require_allow_read_gpx, :only => [:api_details, :api_data] before_filter :require_allow_write_gpx, :only => [:api_create] + before_filter :offline_warning, :only => [:mine, :view] + before_filter :offline_redirect, :only => [:create, :edit, :delete, :data, :api_data, :api_create] around_filter :api_call_handle_error, :only => [:api_details, :api_data, :api_create] # Counts and selects pages of GPX traces for various criteria (by user, tags, public etc.). @@ -387,4 +389,12 @@ private end + def offline_warning + flash.now[:warning] = t 'trace.offline_warning.message' if OSM_STATUS == :gpx_offline + end + + def offline_redirect + redirect_to :action => :offline if OSM_STATUS == :gpx_offline + end + end