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
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
<% end %>
<li><%= link_to h("History"), :controller => "api/#{API_VERSION}/"+type, :id => obj.id, :action => "history" %></li>
</ul>
-Last edited: <%= h(obj.timestamp) %>
-<% if obj.user.data_public %>
-by <%= link_to h(obj.user.display_name), :controller => 'user', :action => 'view' , :display_name => obj.user.display_name %>
-<% end %>
+<%= render :partial => 'common_editedby', :locals => { :obj => obj } %>
--- /dev/null
+Last edited: <%= h(obj.timestamp) %>
+<% if obj.user.data_public %>
+by <%= link_to h(obj.user.display_name), :controller => 'user', :action => 'view' , :display_name => obj.user.display_name %>
+<% end %>
--- /dev/null
+<h2>Node History: <%= h(@name) %></h2>
+<%= render :partial => 'common', :locals => { :obj => @node, :type => "node" } %>
+<h2>Hisorical Versions</h2>
+<% @node.old_nodes.reverse.each do |node| %>
+<%= render :partial => 'common_editedby', :locals => { :obj => node } %>
+<%= render :partial => 'tag_table', :locals => { :tags => node.tags_as_hash } %>
+<hr />
+<% end %>
--- /dev/null
+<h2>Way History: <%= h(@name) %></h2>
+<%= render :partial => 'common', :locals => { :obj => @way, :type => "way" } %>
+<h2>Hisorical Versions</h2>
+<% @way.old_ways.reverse.each do |way| %>
+<%= render :partial => 'common_editedby', :locals => { :obj => way } %>
+<%= render :partial => 'tag_table', :locals => { :tags => way.tags } %>
+<hr />
+<% end %>
# Data browsing
map.connect '/way/:id', :controller => 'browse', :action => 'way_view', :id => /\d+/
+ map.connect '/way/:id/history', :controller => 'browse', :action => 'way_history', :id => /\d+/
map.connect '/node/:id', :controller => 'browse', :action => 'node_view', :id => /\d+/
+ map.connect '/node/:id/history', :controller => 'browse', :action => 'node_history', :id => /\d+/
+ map.connect '/relation/:id', :controller => 'browse', :action => 'relation_view', :id => /\d+/
# web site