]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/trace_controller.rb
Might be useful to set the locale everywhere we need the web, rather than just the...
[rails.git] / app / controllers / trace_controller.rb
index e6c732d2d3b760c29fbb48e4e685a32db37a56f0..33f6d0df72fcf1777e7f89f1fe966ac95c45e217 100644 (file)
@@ -1,6 +1,7 @@
 class TraceController < ApplicationController
   layout 'site'
 
+  before_filter :set_locale
   before_filter :authorize_web
   before_filter :require_user, :only => [:mine, :create, :edit, :delete, :make_public]
   before_filter :authorize, :only => [: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