changeset comments and a couple of other small fixes
authorRichard Fairhurst <richard@systemed.net>
Sun, 16 Nov 2008 13:30:02 +0000 (13:30 +0000)
committerRichard Fairhurst <richard@systemed.net>
Sun, 16 Nov 2008 13:30:02 +0000 (13:30 +0000)
app/controllers/amf_controller.rb
public/potlatch/potlatch.swf

index 1fa433c9e198d49f8e6c9e623530af55bde24396..6e1b364d4794dbfef7ebeca2166e354078f1c604 100644 (file)
@@ -135,6 +135,14 @@ class AmfController < ApplicationController
 
        # close previous changeset and add comment
        if closeid
+         cs = Changeset.find(closeid)
+         cs.open = false
+         if closecomment.empty?
+               cs.save!
+         else
+           cs.tags['comment']=closecomment
+           cs.save_with_tags!
+         end
        end
        
        # open a new changeset
@@ -206,14 +214,13 @@ class AmfController < ApplicationController
     begin
       check_boundaries(xmin, ymin, xmax, ymax)
     rescue Exception => err
-      # FIXME: report an error rather than just return an empty result
-      return [[]]
+      return [-2,"Sorry - I can't get the map for that area."]
     end
 
        nodes_in_area = Node.find_by_area(ymin, xmin, ymax, xmax, :conditions => ["current_ways.visible = ?", false], :include => :ways_via_history)
        way_ids = nodes_in_area.collect { |node| node.ways_via_history_ids }.flatten.uniq
 
-       [way_ids]
+       [0,way_ids]
   end
 
   # Get a way including nodes and tags.
index d26ff6e0d5d6c5abb5dcb6ef0958488f08b92a98..cf17a3091e4ad07362976700026183defa1f7548 100755 (executable)
Binary files a/public/potlatch/potlatch.swf and b/public/potlatch/potlatch.swf differ