X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/95595ee7f022448e6f9177accae5476577719057..655dc6787e9092a004b582b52ff8e9ccd0d40bb3:/app/controllers/trace_controller.rb diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index 49a361915..17b667969 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -9,6 +9,8 @@ class TraceController < ApplicationController before_filter :check_database_writable, :only => [:create, :edit, :delete, :make_public] before_filter :check_api_readable, :only => [:api_details, :api_data] 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] # Counts and selects pages of GPX traces for various criteria (by user, tags, public etc.). # target_user - if set, specifies the user to fetch traces for. if not set will fetch all traces @@ -18,6 +20,7 @@ class TraceController < ApplicationController if target_user.nil? and !display_name.blank? target_user = User.find(:first, :conditions => [ "visible = ? and display_name = ?", true, display_name]) if target_user.nil? + @title = t'trace.no_such_user.title' @not_found_user = display_name render :action => 'no_such_user', :status => :not_found return @@ -108,13 +111,13 @@ class TraceController < ApplicationController if @trace and @trace.visible? and (@trace.public? or @trace.user == @user) - @title = t 'trace.view.viewing_trace', :name => @trace.name + @title = t 'trace.view.title', :name => @trace.name else flash[:notice] = t 'trace.view.trace_not_found' redirect_to :controller => 'trace', :action => 'list' end rescue ActiveRecord::RecordNotFound - flash[:notice] = t 'trace.view.trace not found' + flash[:notice] = t 'trace.view.trace_not_found' redirect_to :controller => 'trace', :action => 'list' end @@ -165,6 +168,7 @@ class TraceController < ApplicationController @trace = Trace.find(params[:id]) if @user and @trace.user == @user + @title = t 'trace.edit.title', :name => @trace.name if params[:trace] @trace.description = params[:trace][:description] @trace.tagstring = params[:trace][:tagstring]