]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/browse_controller.rb
Add history for ways and nodes, split 'last edited by' into a seperate template to...
[rails.git] / app / controllers / browse_controller.rb
index 1806558f2d43146747f4ab068bcd7c7f42fcac12..785d8cdcf74ebf7a1a6b9a1a2bb1e19678fd5448 100644 (file)
@@ -31,6 +31,21 @@ class BrowseController < ApplicationController
       render :nothing => true, :status => :not_found
     end
   end
+  
+  def way_history 
+    begin
+      @way = Way.find(params[:id])
+     
+      @name = @way.tags['name'].to_s 
+      if @name.length == 0:
+       @name = "#" + @way.id.to_s
+      end
+       
+      @title = 'Way History | ' + (@name)
+    rescue ActiveRecord::RecordNotFound
+      render :nothing => true, :status => :not_found
+    end
+  end
 
   def node_view 
     begin
@@ -46,4 +61,18 @@ class BrowseController < ApplicationController
       render :nothing => true, :status => :not_found
     end
   end
+  def node_history 
+    begin
+      @node = Node.find(params[:id])
+     
+      @name = @node.tags_as_hash['name'].to_s 
+      if @name.length == 0:
+       @name = "#" + @node.id.to_s
+      end
+       
+      @title = 'Node | ' + (@name)
+    rescue ActiveRecord::RecordNotFound
+      render :nothing => true, :status => :not_found
+    end
+  end
 end