X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/0509fc8d12fd763e98bc0c8e3a0d2b0ee6a11f9a..6659fb9b33503ee6519f89131a8a4b5fef515bcd:/app/controllers/site_controller.rb diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index 015da9e22..0e26185a1 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -5,6 +5,7 @@ class SiteController < ApplicationController before_filter :authorize_web before_filter :set_locale before_filter :require_user, :only => [:edit] + before_filter :require_oauth, :only => [:index] def index unless STATUS == :database_readonly or STATUS == :database_offline @@ -39,6 +40,21 @@ class SiteController < ApplicationController if editor == "remote" render :action => :index + return + end + + if params[:node] + bbox = Node.find(params[:node]).bbox.to_unscaled + @lat = bbox.centre_lat + @lon = bbox.centre_lon + elsif params[:way] + bbox = Way.find(params[:way]).bbox.to_unscaled + @lat = bbox.centre_lat + @lon = bbox.centre_lon + elsif params[:gpx] + trace = Trace.visible_to(@user).find(params[:gpx]) + @lat = trace.latitude + @lon = trace.longitude end end @@ -49,4 +65,8 @@ class SiteController < ApplicationController def preview render :text => RichText.new(params[:format], params[:text]).to_html end + + def id + render "id", :layout => false + end end