]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/site_controller.rb
Redirect /?query= to /search?query=
[rails.git] / app / controllers / site_controller.rb
index f4564100c1edc6ff284411b710776415f68fd7ed..5c391d7b228359ca6041f8c26d9b5f86c9dc35bb 100644 (file)
@@ -1,6 +1,6 @@
 class SiteController < ApplicationController
-  layout 'site', :except => [:key, :permalink]
-  layout false, :only => [:key, :permalink]
+  layout 'site'
+  layout :map_layout, :only => [:index, :export]
 
   before_filter :authorize_web
   before_filter :set_locale
@@ -34,18 +34,18 @@ class SiteController < ApplicationController
 
   def key
     expires_in 7.days, :public => true
+    render :layout => false
   end
 
   def edit
     editor = preferred_editor
 
     if editor == "remote"
+      require_oauth
       render :action => :index
       return
     end
 
-    @extra_body_class = "site-edit-#{editor}"
-
     if params[:node]
       bbox = Node.find(params[:node]).bbox.to_unscaled
       @lat = bbox.centre_lat
@@ -97,6 +97,8 @@ class SiteController < ApplicationController
       redirect_to relation_path(params[:relation])
     elsif params[:note]
       redirect_to browse_note_path(params[:note])
+    elsif params[:query]
+      redirect_to search_path(:query => params[:query])
     end
   end