From: Shaun McDonald Date: Tue, 14 Oct 2008 18:33:03 +0000 (+0000) Subject: more work on the data browser to show the changesets. Also showing the version number... X-Git-Tag: live~7573^2~265 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/e7147d0d7adae704ead9f4985bcda918e622d833 more work on the data browser to show the changesets. Also showing the version number. Would be good to have an additional route for showing a specific version of the node/way/relation from the changeset. --- diff --git a/app/controllers/browse_controller.rb b/app/controllers/browse_controller.rb index 94a8a09a0..2c6c3dc5f 100644 --- a/app/controllers/browse_controller.rb +++ b/app/controllers/browse_controller.rb @@ -118,6 +118,8 @@ class BrowseController < ApplicationController @changeset = Changeset.find(params[:id]) @title = "Changeset | #{@changeset.id}" + @next = Changeset.find(:first, :order => "id ASC", :conditions => [ "id > :id", { :id => @changeset.id }] ) + @prev = Changeset.find(:first, :order => "id DESC", :conditions => [ "id < :id", { :id => @changeset.id }] ) rescue ActiveRecord::RecordNotFound @type = "changeset" render :action => "not_found", :status => :not_found diff --git a/app/views/browse/_changeset_details.rhtml b/app/views/browse/_changeset_details.rhtml index d8a911f8a..27335dd88 100644 --- a/app/views/browse/_changeset_details.rhtml +++ b/app/views/browse/_changeset_details.rhtml @@ -1,19 +1,68 @@ - <%= render :partial => "common_details", :object => changeset_details %> + + + + + + <% if changeset_details.user.data_public? %> + + + + + <% end %> + + <% unless changeset_details.tags_as_hash.empty? %> + + + + + <% end %> - <% unless node_details.ways.empty? and node_details.containing_relation_members.empty? %> + <% unless changeset_details.old_nodes.empty? %> + + + + + <% end %> + + <% unless changeset_details.old_ways.empty? %> - + <% end %> + + <% unless changeset_details.old_relations.empty? %> + + + + + <% end %>
Created at:<%= h(changeset_details.created_at) %>
Belongs to:<%= link_to h(changeset_details.user.display_name), :controller => "user", :action => "view", :display_name => changeset_details.user.display_name %>
Tags: + + <%= render :partial => "tag", :collection => changeset_details.tags_as_hash %> +
+
Has the following nodes: + + <% changeset_details.old_nodes.each do |node| %> + + <% end %> +
<%= link_to "Node #{node.id.to_s}, version #{node.version.to_s}", :action => "node", :id => node.id.to_s %>
+
Part of:Has the following ways: - <% node_details.ways.each do |way| %> - + <% changeset_details.old_ways.each do |way| %> + <% end %> - <%= render :partial => "containing_relation", :collection => node_details.containing_relation_members %> + <%= + #render :partial => "containing_relation", :collection => changeset_details.containing_relation_members + %>
<%= link_to "Way " + way.id.to_s, :action => "way", :id => way.id.to_s %>
<%= link_to "Way #{way.id.to_s}, version #{way.version.to_s}", :action => "way", :id => way.id.to_s %>
Has the following relations: + + <% changeset_details.old_relations.each do |relation| %> + + <% end %> +
<%= link_to "Relation #{relation.id.to_s}, version #{relation.version.to_s}", :action => "relation", :id => relation.id.to_s %>
+
diff --git a/app/views/browse/_common_details.rhtml b/app/views/browse/_common_details.rhtml index 968594bb6..1f9f9ffe6 100644 --- a/app/views/browse/_common_details.rhtml +++ b/app/views/browse/_common_details.rhtml @@ -3,17 +3,22 @@ <%= h(common_details.timestamp) %> -<% if common_details.changeset.user.data_public %> +<% if common_details.changeset.user.data_public? %> Edited by: <%= link_to h(common_details.changeset.user.display_name), :controller => "user", :action => "view", :display_name => common_details.changeset.user.display_name %> <% end %> + + Version: + <%= h(common_details.version) %> + + In changeset: - <%= common_details.changeset_id %> -<%= link_to common_details.changeset_id, :action => :changeset %> + <% unless common_details.tags_as_hash.empty? %> diff --git a/app/views/browse/changeset.rhtml b/app/views/browse/changeset.rhtml index 4ecdb8e99..9345eb087 100644 --- a/app/views/browse/changeset.rhtml +++ b/app/views/browse/changeset.rhtml @@ -9,30 +9,9 @@ - - Created at: - <%= h(@changeset.created_at) %> - - - <% if @changeset.user.data_public? %> - - Belongs to: - <%= link_to h(@changeset.user.display_name), :controller => "user", :action => "view", :display_name => @changeset.user.display_name %> - - <% end %> - <% unless @changeset.tags_as_hash.empty? %> - - Tags: - - - <%= render :partial => "tag", :collection => @changeset.tags_as_hash %> -
- - - <% end %> + <%= render :partial => "changeset_details", :object => @changeset %>
<%= link_to "Download XML", :controller => "changeset", :action => "read" %> - <% # render :partial => "map", :object => @node %>