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