X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ab7ac69e68474a8a6c15b2ce7ee96ab461ddf1e7..2875a2c4b36820db085e8b5ff5521650a692c3ad:/app/controllers/trace_controller.rb diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index e6c732d2d..532893ef1 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -2,6 +2,7 @@ class TraceController < ApplicationController layout 'site' before_filter :authorize_web + before_filter :set_locale before_filter :require_user, :only => [:mine, :create, :edit, :delete, :make_public] before_filter :authorize, :only => [:api_details, :api_data, :api_create] before_filter :check_database_readable, :except => [:api_details, :api_data, :api_create] @@ -92,6 +93,13 @@ class TraceController < ApplicationController end def mine + # Load the preference of whether the user set the trace public the last time + @trace = Trace.new + if @user.preferences.find(:first, :conditions => {:k => "gps.trace.public", :v => "default"}).nil? + @trace.public = false + else + @trace.public = true + end list(@user, "mine") end @@ -134,6 +142,7 @@ class TraceController < ApplicationController @trace.errors.add(:gpx_file, "can't be blank") end end + @title = I18n.t('trace.create.upload_trace') end def data