]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/changeset_controller.rb
Use some rails magic to avoid having to duplicate all the changeset
[rails.git] / app / controllers / changeset_controller.rb
index 778bb73aed716c071c277752b74ee256465fcd52..8d029aae50d10078483c9ba9961ff7cb1566f5d5 100644 (file)
@@ -4,8 +4,8 @@ class ChangesetController < ApplicationController
   layout 'site'
   require 'xml/libxml'
 
-  session :off, :except => [:list, :list_user, :list_bbox]
   before_filter :authorize_web, :only => [:list, :list_user, :list_bbox]
+  before_filter :set_locale, :only => [:list, :list_user, :list_bbox]
   before_filter :authorize, :only => [:create, :update, :delete, :upload, :include, :close]
   before_filter :require_public_data, :only => [:create, :update, :delete, :upload, :include, :close]
   before_filter :check_api_writable, :only => [:create, :update, :delete, :upload, :include]
@@ -114,7 +114,7 @@ class ChangesetController < ApplicationController
   # changeset.
   #
   # Returns: a diffResult document, as described in 
-  # http://wiki.openstreetmap.org/index.php/OSM_Protocol_Version_0.6
+  # http://wiki.openstreetmap.org/wiki/OSM_Protocol_Version_0.6
   def upload
     # only allow POST requests, as the upload method is most definitely
     # not idempotent, as several uploads with placeholder IDs will have
@@ -255,23 +255,20 @@ class ChangesetController < ApplicationController
   # list edits (open changesets) in reverse chronological order
   def list
     conditions = conditions_nonempty
-    
-    
-   # @changesets = Changeset.find(:all, :order => "closed_at DESC", :conditions => ['closed_at < ?', DateTime.now], :limit=> 20)
-   
-   
-   #@edit_pages, @edits = paginate(:changesets,
-   #                                :include => [:user, :changeset_tags],
-   #                                :conditions => conditions,
-   #                                :order => "changesets.created_at DESC",
-   #                                :per_page => 20)
-   #
-    
-   @edits =  Changeset.find(:all,
-                                   :order => "changesets.created_at DESC",
-                                   :conditions => conditions,
-                                   :limit => 20)
-    
+
+    # @changesets = Changeset.find(:all, :order => "closed_at DESC", :conditions => ['closed_at < ?', DateTime.now], :limit=> 20)
+
+    #@edit_pages, @edits = paginate(:changesets,
+    #                                :include => [:user, :changeset_tags],
+    #                                :conditions => conditions,
+    #                                :order => "changesets.created_at DESC",
+    #                                :per_page => 20)
+    #
+
+    @edits =  Changeset.find(:all,
+                             :order => "changesets.created_at DESC",
+                             :conditions => conditions,
+                             :limit => 20)
   end
   
   ##
@@ -307,6 +304,8 @@ class ChangesetController < ApplicationController
        bbox = params['bbox']
     elsif params['minlon'] and params['minlat'] and params['maxlon'] and params['maxlat']
        bbox = h(params['minlon']) + ',' + h(params['minlat']) + ',' + h(params['maxlon']) + ',' + h(params['maxlat'])
+    elsif params['format'] == "rxml"
+      raise OSM::APIBadUserInput.new("Bounding box must be supplied for the RSS feed")
     else
       #TODO: fix bugs in location determination for history tab (and other tabs) then uncomment this redirect
       #redirect_to :action => 'list'