)
end
- if params[:node]
- bbox = Node.find(params[:node]).bbox.to_unscaled
- @lat = bbox.centre_lat
- @lon = bbox.centre_lon
- @zoom = 18
- elsif params[:way]
- bbox = Way.find(params[:way]).bbox.to_unscaled
- @lat = bbox.centre_lat
- @lon = bbox.centre_lon
- @zoom = 17
- elsif params[:note]
- note = Note.find(params[:note])
- @lat = note.lat
- @lon = note.lon
- @zoom = 17
- elsif params[:gpx] && current_user
- trace = Trace.visible_to(current_user).find(params[:gpx])
- @lat = trace.latitude
- @lon = trace.longitude
- @zoom = 16
+ begin
+ if params[:node]
+ bbox = Node.visible.find(params[:node]).bbox.to_unscaled
+ @lat = bbox.centre_lat
+ @lon = bbox.centre_lon
+ @zoom = 18
+ elsif params[:way]
+ bbox = Way.visible.find(params[:way]).bbox.to_unscaled
+ @lat = bbox.centre_lat
+ @lon = bbox.centre_lon
+ @zoom = 17
+ elsif params[:note]
+ note = Note.visible.find(params[:note])
+ @lat = note.lat
+ @lon = note.lon
+ @zoom = 17
+ elsif params[:gpx] && current_user
+ trace = Trace.visible_to(current_user).find(params[:gpx])
+ @lat = trace.latitude
+ @lon = trace.longitude
+ @zoom = 16
+ end
+ rescue ActiveRecord::RecordNotFound
+ # don't try and derive a location from a missing/deleted object
end
end
def help; end
- def about; end
+ def about
+ @locale = params[:about_locale] || I18n.locale
+ end
def export; end
put "changeset/create" => "api/changesets#create"
post "changeset/:id/upload" => "api/changesets#upload", :id => /\d+/
get "changeset/:id/download" => "api/changesets#download", :as => :changeset_download, :id => /\d+/
- post "changeset/:id/expand_bbox" => "api/changesets#expand_bbox", :id => /\d+/
get "changeset/:id" => "api/changesets#show", :as => :changeset_show, :id => /\d+/
post "changeset/:id/subscribe" => "api/changesets#subscribe", :as => :changeset_subscribe, :id => /\d+/
post "changeset/:id/unsubscribe" => "api/changesets#unsubscribe", :as => :changeset_unsubscribe, :id => /\d+/
get "/welcome" => "site#welcome"
get "/fixthemap" => "site#fixthemap"
get "/help" => "site#help"
+ get "/about/:about_locale" => "site#about"
get "/about" => "site#about"
get "/history" => "changesets#index"
get "/history/feed" => "changesets#feed", :defaults => { :format => :atom }
get "/trace/create", :to => redirect(:path => "/traces/new")
get "/trace/:id/data" => "traces#data", :id => /\d+/, :as => "trace_data"
get "/trace/:id/edit", :to => redirect(:path => "/traces/%{id}/edit")
- post "/trace/:id/delete" => "traces#delete", :id => /\d+/
# diary pages
resources :diary_entries, :path => "diary", :only => [:new, :create, :index] do