layout 'site'
def index
+ @nodes = Node.find(:all, :order => "timestamp DESC", :limit=> 20)
end
def relation
-Welcome to the browse subpages!
+<h2><%= @nodes.length %> Recently Changed Nodes</h2>
+<ul>
+<% @nodes.each do |node|
+ name = node.tags_as_hash['name'].to_s
+ if name.length == 0:
+ name = "(No name)"
+ end
+ name = name + " - " + node.id.to_s
+%>
+ <li><%= link_to h(name), :action => "node", :id => node.id %></li>
+<% end %>
+</ul>
<h2>Node Browser: <%= h(@name) %></h2>
<%= render :partial => 'common', :locals => { :obj => @node, :type => "node" } %>
<%= render :partial => 'tag_table', :locals => { :tags => @node.tags_as_hash } %>
+<% if @node.ways.length != 0 %>
+ <br style="clear:both" />
+ <div style="float:right; width: 250px;">
+ <h2>Part of:</h2>
+ <ul>
+ <% @node.ways.each do |way| %>
+ <li> <%= link_to "Way " + way.id.to_s, :action => "way", :id => way.id.to_s %> </li>
+ <% end %>
+ </ul>
+ </div>
+<% end %>
<h2>Way Browser: <%= h(@name) %></h2>
<%= render :partial => 'common', :locals => { :obj => @way, :type => "way" } %>
<%= render :partial => 'tag_table', :locals => { :tags => @way.tags } %>
+
+<% if @way.nodes.length != 0 %>
+ <br style="clear:both" />
+ <div style="float:right; width: 250px;">
+ <h2>Parts:</h2>
+ <ul>
+ <% @way.nodes.each do |node| %>
+ <li> <%= link_to "Node " + node.id.to_s, :action => "node", :id => node.id.to_s %> </li>
+ <% end %>
+ </ul>
+ </div>
+<% end %>