]> git.openstreetmap.org Git - rails.git/commitdiff
Merge 16355:16480 from trunk.
authorTom Hughes <tom@compton.nu>
Mon, 13 Jul 2009 23:28:02 +0000 (23:28 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 13 Jul 2009 23:28:02 +0000 (23:28 +0000)
39 files changed:
app/controllers/browse_controller.rb
app/controllers/changeset_controller.rb
app/helpers/application_helper.rb
app/views/browse/_navigation.html.erb
app/views/browse/changeset.html.erb
app/views/changeset/_changeset.html.erb
app/views/changeset/_changeset_paging_nav.html.erb
app/views/changeset/list.atom.builder [new file with mode: 0644]
app/views/changeset/list.html.erb
app/views/changeset/list_bbox.html.erb [deleted file]
app/views/changeset/list_user.html.erb [deleted file]
app/views/layouts/site.html.erb
app/views/layouts/site.rss.builder [new file with mode: 0644]
app/views/user/view.html.erb
config/locales/be.yml
config/locales/ca.yml
config/locales/de.yml
config/locales/el.yml
config/locales/en.yml
config/locales/es.yml
config/locales/fr.yml
config/locales/he.yml
config/locales/hi.yml
config/locales/is.yml
config/locales/it.yml
config/locales/ja.yml
config/locales/ko.yml
config/locales/nl.yml
config/locales/pl.yml
config/locales/pt-BR.yml
config/locales/ru.yml
config/locales/sl.yml
config/locales/vi.yml
config/locales/yo.yml
config/locales/zh-CN.yml
config/locales/zh-TW.yml
config/routes.rb
lib/bounding_box.rb
test/functional/changeset_controller_test.rb

index 8124d4a339ec2d509ff29e2fdffc9fa2cf7039f0..91d8eb84fa4b5e42ea49d45cb118a6565d9e5e10 100644 (file)
@@ -69,7 +69,10 @@ class BrowseController < ApplicationController
       
     @title = "#{I18n.t('browse.changeset.title')} | #{@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 }] ) 
+    @prev = Changeset.find(:first, :order => "id DESC", :conditions => [ "id < :id", { :id => @changeset.id }] )
+
+    @next_by_user = Changeset.find(:first, :order => "id ASC", :conditions => [ "id > :id AND user_id = :user_id", {:id => @changeset.id, :user_id => @changeset.user_id }] )
+    @prev_by_user = Changeset.find(:first, :order => "id DESC", :conditions => [ "id < :id AND user_id = :user_id", {:id => @changeset.id, :user_id => @changeset.user_id }] )
   rescue ActiveRecord::RecordNotFound
     @type = "changeset"
     render :action => "not_found", :status => :not_found
index ca42751d37ac670c4504d5a492e9012af6826f00..d7f3d39c833aba270e7b13c18db3edc9d9c1452f 100644 (file)
@@ -255,79 +255,54 @@ class ChangesetController < ApplicationController
   # list edits (open changesets) in reverse chronological order
   def list
     conditions = conditions_nonempty
-    
-    
-   # @changesets = Changeset.find(:all, :order => "closed_at DESC", :conditions => ['closed_at < ?', DateTime.now], :limit=> 20)
-   
-   
-   #@edit_pages, @edits = paginate(:changesets,
-   #                                :include => [:user, :changeset_tags],
-   #                                :conditions => conditions,
-   #                                :order => "changesets.created_at DESC",
-   #                                :per_page => 20)
-   #
-    
-   @edits =  Changeset.find(:all,
-                                   :order => "changesets.created_at DESC",
-                                   :conditions => conditions,
-                                   :limit => 20)
-    
-  end
-  
-  ##
-  # list edits (changesets) belonging to a user
-  def list_user
-    user = User.find_by_display_name(params[:display_name], :conditions => {:visible => true})
-    
-    if user
-      @display_name = user.display_name
-      if not user.data_public? and @user != user
-        @edits = nil
-        render
-      else
-        conditions = cond_merge conditions, ['user_id = ?', user.id]
-        conditions = cond_merge conditions, conditions_nonempty
-        @edit_pages, @edits = paginate(:changesets,
-                                        :include => [:user, :changeset_tags],
-                                        :conditions => conditions,
-                                        :order => "changesets.created_at DESC",
-                                        :per_page => 20)
+
+    if params[:display_name]
+      user = User.find_by_display_name(params[:display_name], :conditions => { :visible => true })
+
+      if user 
+        if user.data_public? or user == @user
+          conditions = cond_merge conditions, ['user_id = ?', user.id]
+        else
+          conditions = cond_merge conditions, ['false']
+        end
+      elsif request.format == :html
+        @title = t 'user.no_such_user.title'
+        @not_found_user = params[:display_name]
+        render :template => 'user/no_such_user', :status => :not_found
       end
-    else
-      @not_found_user = params[:display_name]
-      render :template => 'user/no_such_user', :status => :not_found
     end
-  end
-  
-  ##
-  # list changesets in a bbox
-  def list_bbox
-    # support 'bbox' param or alternatively 'minlon', 'minlat' etc       
-    if params['bbox']
-       bbox = params['bbox']
-    elsif params['minlon'] and params['minlat'] and params['maxlon'] and params['maxlat']
-       bbox = h(params['minlon']) + ',' + h(params['minlat']) + ',' + h(params['maxlon']) + ',' + h(params['maxlat'])
+
+    if params[:bbox]
+      bbox = params[:bbox]
+    elsif params[:minlon] and params[:minlat] and params[:maxlon] and params[:maxlat]
+      bbox = params[:minlon] + ',' + params[:minlat] + ',' + params[:maxlon] + ',' + params[:maxlat]
+    end
+
+    if bbox
+      conditions = cond_merge conditions, conditions_bbox(bbox)
+      bbox = BoundingBox.from_s(bbox)
+      bbox_link = "<a href='#{url_for(:controller => "site", :action => "index", :minlon => bbox.min_lon, :minlat => bbox.min_lat, :maxlon => bbox.max_lon, :maxlat => bbox.max_lat, :box => "yes")}'>#{bbox.to_s}</a>"
+    end
+
+    @title =  t 'changeset.list.title'
+
+    if user and bbox
+      @description = t 'changeset.list.description_user_bbox', :user => user.display_name, :bbox => bbox_link
+    elsif user
+      @description = t 'changeset.list.description_user', :user => user.display_name
+    elsif bbox
+      @description = t 'changeset.list.description_bbox', :bbox => bbox_link
     else
-      #TODO: fix bugs in location determination for history tab (and other tabs) then uncomment this redirect
-      #redirect_to :action => 'list'
-      
-      # For now just render immediately, and skip the db
-      render
-      return
+      @description = t 'changeset.list.description'
     end
-       
-    conditions = conditions_bbox(bbox);
-    conditions = cond_merge conditions, conditions_nonempty
-    
+
     @edit_pages, @edits = paginate(:changesets,
                                    :include => [:user, :changeset_tags],
                                    :conditions => conditions,
                                    :order => "changesets.created_at DESC",
                                    :per_page => 20)
-                                   
-    @bbox = sanitise_boundaries(bbox.split(/,/)) unless bbox==nil
   end
-  
+
 private
   #------------------------------------------------------------
   # utility functions below.
index 3119c8435469003a9433793005306b4be504df70..b28ab7c1a6eca2dabe18a38d1b90e694bc9e5f6d 100644 (file)
@@ -6,4 +6,8 @@ module ApplicationHelper
   def rss_link_to(*args)
     return link_to(image_tag("RSS.gif", :size => "16x16", :border => 0), Hash[*args], { :class => "rsssmall" });
   end
+
+  def atom_link_to(*args)
+    return link_to(image_tag("RSS.gif", :size => "16x16", :border => 0), Hash[*args], { :class => "rsssmall" });
+  end
 end
index 57e724d4258a7a907f03475ac01f7fa6c02d971a..88812c2bb6e29b63eafe225d832a2614f7cec37c 100644 (file)
@@ -1,13 +1,40 @@
 <div style="float:right; text-align:center; width: 250px;">
+  <% if @next_by_user or @prev_by_user %>
+    <% if @prev_by_user %>
+      &lt;
+      <%= link_to @prev_by_user.id.to_s,
+                  { :id => @prev_by_user.id },
+                  { :title => t('browse.changeset_navigation.user.prev_tooltip', :user => @prev_by_user.user.display_name) } %>
+      |
+    <% end %>
+    <%=
+    user = (@prev_by_user || @next_by_user).user.display_name
+    link_to h(user),
+            { :controller => "changeset", :action => "list", :display_name => user },
+            { :title => t('browse.changeset_navigation.user.name_tooltip', :user => h(user)) }
+    %>
+    <% if @next_by_user %>
+      |
+      <%= link_to @next_by_user.id.to_s,
+                  { :id => @next_by_user.id },
+                  { :title => t('browse.changeset_navigation.user.next_tooltip', :user => @next_by_user.user.display_name) } %>
+      &gt;
+    <% end %>
+    <br/>
+  <% end %>
   <% if @prev %>
     &lt;
-    <%= link_to @prev.id.to_s, :id => @prev.id %>
+    <%= link_to @prev.id.to_s,
+                { :id => @prev.id },
+                { :title => t('browse.changeset_navigation.all.prev_tooltip') } %>
   <% end %>
   <% if @prev and @next %>
     | 
   <% end %>
   <% if @next %>
-    <%= link_to @next.id.to_s, :id => @next.id %>
+    <%= link_to @next.id.to_s,
+                { :id => @next.id },
+                { :title => t('browse.changeset_navigation.all.next_tooltip') } %>
     &gt;
   <% end %>
 </div>
index e5963c57f415dbd1d9a65773420016ae3c7f257b..8e110212893968f9f0c6c15d2e49fb5364386e82 100644 (file)
@@ -1,7 +1,7 @@
 <table width="100%">
   <tr>
     <td>
-      <h2><%= t 'browse.changeset.changeset' %> <%= h(@changeset.id) %></h2>
+      <h2><%= t 'browse.changeset.changeset', :id => @changeset.id %></h2>
     </td>
     <td>
       <%= render :partial => "navigation" %>
index 8ac433415a3a843272ff4669fcc1c7241f8be80f..f8f00addb35cdffd43c020f47506dca3d23f4c1f 100644 (file)
@@ -14,7 +14,7 @@
   <%if showusername %>  
     <td class="<%= cl %> user">
     <% if changeset.user.data_public? %>
-      <%= link_to h(changeset.user.display_name), :controller => "changeset", :action => "list_user", :display_name => changeset.user.display_name %>
+      <%= link_to h(changeset.user.display_name), :controller => "changeset", :action => "list", :display_name => changeset.user.display_name %>
     <% else %>
       <i><%= t'changeset.changeset.anonymous' %></i>
     <% end %>
@@ -25,7 +25,7 @@
     <% if changeset.tags['comment'] %>
       <%= h(changeset.tags['comment']) %>
     <% else %>
-      <i><%= t'changeset.changeset.no_comment' %></i>
+      <%= t'changeset.changeset.no_comment' %>
     <% end %>
   </td>
 
index b8ac1a65fca39f394c5aaf7762ed9e3013535437..94edfc31ed1f673aceba4fe62a5c50431fb8b449 100644 (file)
@@ -1,3 +1,4 @@
+<p>
 <% current_page = @edit_pages.current_page %>
 
 <%= t'changeset.changeset_paging_nav.showing_page' %> 
@@ -16,3 +17,4 @@ if @edit_pages.page_count > 1
 <%
 end
 %>
+</p>
diff --git a/app/views/changeset/list.atom.builder b/app/views/changeset/list.atom.builder
new file mode 100644 (file)
index 0000000..c71c22a
--- /dev/null
@@ -0,0 +1,89 @@
+atom_feed(:language => I18n.locale, :schema_date => 2009,
+          :id => url_for(params.merge({ :only_path => false })),
+          :root_url => url_for(params.merge({ :only_path => false, :format => nil })),
+          "xmlns:georss" => "http://www.georss.org/georss") do |feed|
+  feed.title @title
+
+  feed.subtitle :type => 'xhtml' do |xhtml|
+    xhtml.p @description
+  end
+
+  feed.updated @edits.map {|e|  [e.created_at, e.closed_at].max }.max
+  feed.icon "http://#{SERVER_URL}/favicon.ico"
+  feed.logo "http://#{SERVER_URL}/images/mag_map-rss2.0.png"
+
+  feed.rights :type => 'xhtml' do |xhtml|
+    xhtml.a :href => "http://creativecommons.org/licenses/by-sa/2.0/" do |a|
+      a.img :src => "http://#{SERVER_URL}/images/cc_button.png", :alt => "CC by-sa 2.0"
+    end
+  end
+
+  for changeset in @edits
+    feed.entry(changeset, :updated => changeset.closed_at, :id => changeset_url(changeset.id, :only_path => false)) do |entry|
+      entry.link :rel => "alternate",
+                 :href => changeset_read_url(changeset, :only_path => false),
+                 :type => "application/osm+xml"
+      entry.link :rel => "alternate",
+                 :href => changeset_download_url(changeset, :only_path => false),
+                 :type => "application/osmChange+xml"
+
+      entry.title t('browse.changeset.title') + " " + h(changeset.id)
+
+      if changeset.user.data_public?
+        entry.author do |author|
+          author.name changeset.user.display_name
+          author.uri url_for(:controller => 'user', :action => 'view', :display_name => changeset.user.display_name, :only_path => false)
+        end
+      end
+
+      feed.content :type => 'xhtml' do |xhtml|
+        xhtml.style "th { text-align: left } tr { vertical-align: top }"
+        xhtml.table do |table|
+          table.tr do |tr|
+            tr.th t("browse.changeset_details.created_at")
+            tr.td l(changeset.created_at)
+          end
+          table.tr do |tr|
+            tr.th t("browse.changeset_details.closed_at")
+            tr.td l(changeset.closed_at)
+          end
+          if changeset.user.data_public?
+            table.tr do |tr|
+              tr.th t("browse.changeset_details.belongs_to")
+              tr.td do |td|
+                td.a h(changeset.user.display_name), :href => url_for(:controller => "user", :action => "view", :display_name => changeset.user.display_name, :only_path => false)
+              end
+            end
+          end
+          unless changeset.tags.empty?
+            table.tr do |tr|
+              tr.th t("browse.tag_details.tags")
+              tr.td do |td|
+                td.table :cellpadding => "0" do |table|
+                  changeset.tags.sort.each do |tag|
+                    table.tr do |tr|
+                      tr.td "#{h(tag[0])} = #{sanitize(auto_link(tag[1]))}"
+                    end
+                  end
+                end
+              end
+            end
+          end
+        end
+      end
+
+      unless changeset.min_lat.nil?
+        minlon = changeset.min_lon/GeoRecord::SCALE.to_f
+        minlat = changeset.min_lat/GeoRecord::SCALE.to_f
+        maxlon = changeset.max_lon/GeoRecord::SCALE.to_f
+        maxlat = changeset.max_lat/GeoRecord::SCALE.to_f
+
+        # See http://georss.org/Encodings#Geometry
+        lower_corner = "#{minlat} #{minlon}"
+        upper_corner = "#{maxlat} #{maxlon}"
+
+        feed.georss :box, lower_corner + " " + upper_corner
+      end
+    end
+  end
+end
index cfe4afd3faa5d0d9de765505f5a797220a3202ec..0fcf5ddda4af872576ceb4f38f73fd88eecf750e 100644 (file)
@@ -1,7 +1,12 @@
-<h1><%= t'changeset.list.recent_changes' %></h1>
-<p><%= t'changeset.list.recently_edited_changesets' %></p>
+<h1><%= @title %></h1>
+<p><%= @description %></p>
 
-<%= render :partial => 'changesets' %>
+<%= render :partial => 'changeset_paging_nav' %>
+<%= render :partial => 'changesets', :locals => { :showusername => !params.has_key?(:display_name) } %>
+<%= render :partial => 'changeset_paging_nav' %>
 
-<p><%= t'changeset.list.for_more_changesets' %></p>
-<br>
+<%= atom_link_to params.merge({ :format => :atom }) %>
+
+<% content_for :head do %>
+<%= auto_discovery_link_tag :atom, params.merge({ :format => :atom }) %>
+<% end %>
diff --git a/app/views/changeset/list_bbox.html.erb b/app/views/changeset/list_bbox.html.erb
deleted file mode 100644 (file)
index 87c6179..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<h1><%= t'changeset.list_bbox.history' %></h1>
-<%
-if @bbox!=nil
-       minlon = @bbox[0] 
-       minlat = @bbox[1] 
-       maxlon = @bbox[2]
-       maxlat = @bbox[3] 
-
-       %>
-<p>
-<%= t'changeset.list_bbox.changesets_within_the_area' %> 
-      (<a href='/?minlon=<%= minlon %>&minlat=<%= minlat %>&maxlon=<%= maxlon %>&maxlat=<%= maxlat %>&box=yes' title='<%= t'changeset.list_bbox.show_area_box' %>'><%= format("%0.3f",minlon) -%>,<%= format("%0.3f",minlat) -%>,<%= format("%0.3f",maxlon) -%>,<%= format("%0.3f",maxlat) -%></a>) 
-
-</p>
-
-<%     if @edits.nil? or @edits.empty? %>
-<p><b><%= t'changeset.list_bbox.no_changesets' %></b></p>
-<%     else %>
-
-<%= render :partial => 'changeset_paging_nav' %>
-<%= render :partial => 'changesets' %>
-<%= render :partial => 'changeset_paging_nav' %>
-
-<p><%= t'changeset.list_bbox.all_changes_everywhere' , :recent_changes_link => link_to(t('changeset.list_bbox.recent_changes'), :controller => "browse", :action => "changesets") %> </p>
-
-<%
-       end
-
-else 
-       #bbox is nil. happens if the user surfs to this page directly.
-%>
-
-<p><%= t'changeset.list_bbox.no_area_specified' %></p>
-<p><%= t'changeset.list_bbox.first_use_view', :view_tab_link => '<a href="/" title="' + t('changeset.list_bbox.view_the_map') + '">' + t('changeset.list_bbox.view_tab') + '</a>' %></p>
-<p><%= t'changeset.list_bbox.alternatively_view', :recent_changes_link => link_to(t('changeset.list_bbox.recent_changes'), :controller => "browse", :action => "changesets") %></p>
-
-<%
-end
-%>
-<br>
-
diff --git a/app/views/changeset/list_user.html.erb b/app/views/changeset/list_user.html.erb
deleted file mode 100644 (file)
index 7240e60..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<h1><%= t'changeset.list_user.edits_by_username', :username_link => link_to(h(@display_name), {:controller=>'user', :action=>'view', :display_name=>@display_name}) %></h1>
-
-<% if not @edits or @edits.empty? %>
-<p><b><%= t'changeset.list_user.no_visible_edits_by', :name => h(@display_name) %>.</b></p>
-<% else %>
-<%= render :partial => 'changeset_paging_nav' %>
-<%= render :partial => 'changesets', :locals => {:showusername => false} %>
-<%= render :partial => 'changeset_paging_nav' %>
-<% end %>
-
-<p><%= t'changeset.list_user.for_all_changes', :recent_changes_link => link_to(t('changeset.list_user.recent_changes'), :controller => "browse", :action => "changesets") %></p>
-<br>
-
index 138b69b1cd89a8d84b26c72716d2fbd15f093696..59b7c304bd94e573c030e057f750b802dd782dcd 100644 (file)
         traceclass = ''
         viewclass = 'active' if params['controller'] == 'site' and params['action'] == 'index' 
         editclass = 'active' if params['controller'] == 'site' and params['action'] == 'edit' 
-        historyclass = 'active' if params['controller'] == 'changeset' and params['action'] == 'list_bbox
+        historyclass = 'active' if params['controller'] == 'changeset' and params['action'] == 'list' 
         exportclass = 'active' if params['controller'] == 'site' and params['action'] == 'export'
         traceclass = 'active' if params['controller'] == 'trace'
         diaryclass = 'active' if params['controller'] == 'diary_entry'
         %>
         <li><%= link_to t('layouts.view'), {:controller => 'site', :action => 'index'}, {:id => 'viewanchor', :title => t('layouts.view_tooltip'), :class => viewclass} %></li>
         <li><%= link_to t('layouts.edit'), {:controller => 'site', :action => 'edit'}, {:id => 'editanchor', :title => t('layouts.edit_tooltip'), :class => editclass} %></li>
-        <li><%= link_to t('layouts.history'), {:controller => 'changeset', :action => 'list_bbox' }, {:id => 'historyanchor', :title => t('layouts.history_tooltip'), :class => historyclass} %></li>
+        <li><%= link_to t('layouts.history'), {:controller => 'changeset', :action => 'list' }, {:id => 'historyanchor', :title => t('layouts.history_tooltip'), :class => historyclass} %></li>
         <% if params['controller'] == 'site' and (params['action'] == 'index' or params['action'] == 'export') %>
         <li><%= link_to_remote t('layouts.export'), {:url => {:controller => 'export', :action => 'start'}}, {:id => 'exportanchor', :title => t('layouts.export_tooltip'), :class => exportclass, :href => url_for(:controller => 'site', :action => 'export')} %></li>
         <% else %>
diff --git a/app/views/layouts/site.rss.builder b/app/views/layouts/site.rss.builder
new file mode 100644 (file)
index 0000000..90198e8
--- /dev/null
@@ -0,0 +1,2 @@
+xml.instruct!
+xml << yield
index 1b582c0b9ff4272886ee308b6db46eef1fef1397..e50610037e7bde0d4f9ab4b17deedba56c1484e9 100644 (file)
@@ -4,14 +4,14 @@
 <!-- Displaying user's own profile page -->
 <%= link_to t('user.view.my diary'), :controller => 'diary_entry', :action => 'list', :display_name => @user.display_name %>
 | <%= link_to t('user.view.new diary entry'), :controller => 'diary_entry', :action => 'new', :display_name => @user.display_name %>
-| <%= link_to t('user.view.my edits'), :controller => 'changeset', :action => 'list_user', :display_name => @user.display_name %>
+| <%= link_to t('user.view.my edits'), :controller => 'changeset', :action => 'list', :display_name => @user.display_name %>
 | <%= link_to t('user.view.my traces'), :controller => 'trace', :action=>'mine' %>
 | <%= link_to t('user.view.my settings'), :controller => 'user', :action => 'account', :display_name => @user.display_name %>
 <% else %>
 <!-- Displaying another user's profile page -->
 <%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :display_name => @this_user.display_name %>
 | <%= link_to t('user.view.diary'), :controller => 'diary_entry', :action => 'list', :display_name => @this_user.display_name %>
-| <%= link_to t('user.view.edits'), :controller => 'changeset', :action => 'list_user', :display_name => @this_user.display_name %>
+| <%= link_to t('user.view.edits'), :controller => 'changeset', :action => 'list', :display_name => @this_user.display_name %>
 | <%= link_to t('user.view.traces'), :controller => 'trace', :action => 'view', :display_name => @this_user.display_name %>
 | <% if @user and @user.is_friends_with?(@this_user) %>
   <%= link_to t('user.view.remove as friend'), :controller => 'user', :action => 'remove_friend', :display_name => @this_user.display_name %>
index ab79381615e887b4b3803c21f3ee1d131edfec1c..9cb4bd40c8a2be3ca2d8b4710a71566b66367ded 100644 (file)
@@ -77,7 +77,7 @@ be:
   browse:
     changeset:
       title: "Набор зменаў"
-      changeset: "Набор зменаў:"
+      changeset: "Набор зменаў: {{id}}"
       download: "Сцягнуць {{changeset_xml_link}} ці {{osmchange_xml_link}}"
       changesetxml: "Changeset XML"
       osmchangexml: "osmChange XML"
index e9c2be56ec1ba7ef55d05e39d5a495265d2d3b24..0387eba4ecda372305da34126621d34d78a72e4a 100644 (file)
@@ -76,7 +76,7 @@ ca:
   browse:
     changeset:
       title: "Conjunt de canvis"
-      changeset: "Conjunt de canvis"
+      changeset: "Conjunt de canvis {{id}}"
       download: "Baixa {{changeset_xml_link}} o {{osmchange_xml_link}}"
       changesetxml: "XML del conjunt de canvis"
       osmchangexml: "XML en format osmChange"
index 611935a2e83d5d2fd16a9746d34ed31313c7fee3..c5718bec2349f6c534f38f71f4c8c77eb9130794 100644 (file)
@@ -83,7 +83,7 @@ de:
   browse:
     changeset:
       title: "Changeset" 
-      changeset: "Changeset:"
+      changeset: "Changeset: {{id}}"
       download: "{{changeset_xml_link}} oder {{osmchange_xml_link}} herunterladen"
       changesetxml: "Changeset XML"
       osmchangexml: "osmChange XML"
index 0e98f4f558c5b6a404dae3f5d65f0f82e4863b8e..eae9845c5b8583e42b24c2b2bdfcff9d5ecf05f2 100644 (file)
@@ -79,7 +79,7 @@ el:
  browse:
    changeset:
      title: "Αλλαγή συλλογης"
-     changeset: "Αλλαγή συλλογης:"
+     changeset: "Αλλαγή συλλογης: {{id}}"
 #     download: "Download {{changeset_xml_link}} or {{osmchange_xml_link}}"
      changesetxml: "Αλλαγή συλλογης XML"
      osmchangexml: "osmαλλαγή XML"
index 114c06ac0e0f941735291b1e35edd059473e40f9..59e723cd18d340f878c07289a7e60d172082a72d 100644 (file)
@@ -83,10 +83,18 @@ en:
   browse:
     changeset:
       title: "Changeset"
-      changeset: "Changeset:"
+      changeset: "Changeset: {{id}}"
       download: "Download {{changeset_xml_link}} or {{osmchange_xml_link}}"
       changesetxml: "Changeset XML"
       osmchangexml: "osmChange XML"
+    changeset_navigation:
+      user:
+        name_tooltip: "View edits by {{user}}"
+        prev_tooltip: "Previous edit by {{user}}"
+        next_tooltip: "Next edit by {{user}}"
+      all:
+        prev_tooltip: "Previous changeset"
+        next_tooltip: "Next changeset"
     changeset_details:
       created_at: "Created at:"
       closed_at: "Closed at:"
@@ -239,27 +247,12 @@ en:
       user: "User"
       comment: "Comment"
       area: "Area"
-    list_bbox:
-      history: "History"
-      changesets_within_the_area: "Changesets within the area:"
-      show_area_box: "show area box"
-      no_changesets: "No changesets"
-      all_changes_everywhere: "For all changes everywhere see {{recent_changes_link}}"
-      recent_changes: "Recent Changes"
-      no_area_specified: "No area specified"
-      first_use_view: "First use the {{view_tab_link}} to pan and zoom to an area of interest, then click the history tab."
-      view_the_map: "view the map"
-      view_tab: "view tab"
-      alternatively_view: "Alternatively, view all {{recent_changes_link}}"
     list:
-      recent_changes: "Recent Changes"
-      recently_edited_changesets: "Recently edited changesets:"
-      for_more_changesets: "For more changesets, select a user and view their edits, or see the editing 'history' of a specific area."
-    list_user:
-      edits_by_username: "Edits by {{username_link}}"
-      no_visible_edits_by: "No visible edits by {{name}}."
-      for_all_changes: "For changes by all users see {{recent_changes_link}}"
-      recent_changes: "Recent Changes"
+      title: "Changesets"
+      description: "Recent edits"
+      description_user: "Recent edits by {{user}}"
+      description_bbox: "Recent edits within {{bbox}}"
+      description_user_bbox: "Recent edits by {{user}} within {{bbox}}"
   diary_entry:
     new:
       title: New Diary Entry
index 7516e0300fe30518febf776850763ecb421d4562..6363f58b902607ca5c118e1c6d2eeacac60b2f3e 100644 (file)
@@ -75,7 +75,7 @@ es:
   browse:
     changeset:
       title: "Conjunto de cambios"
-      changeset: "Conjunto de cambios"
+      changeset: "Conjunto de cambios {{id}}"
       download: "Descargar {{changeset_xml_link}} o {{osmchange_xml_link}}"
       changesetxml: "XML del conjunto de cambios"
       osmchangexml: "XML en formato osmChange"
index 83481d9f3e5322dd835b75538232193739139064..f56ea29a07a736dfd5bad1a824962fcc98ba8452 100644 (file)
@@ -5,7 +5,7 @@ fr:
     coordinates: "Coordonnées"
   browse:
     changeset:
-      changeset: "Changeset :"
+      changeset: "Changeset : {{id}}"
       download: "Télécharger {{changeset_xml_link}} ou {{osmchange_xml_link}}"
       changesetxml: "Changeset XML"
       osmchangexml: "osmChange XML"
index 45c1680285ad33f7f16822a62d80b761324ecfdf..b5001ade31cfc180f73ca2a35d324839bd132b69 100644 (file)
@@ -77,7 +77,7 @@ he:
   browse:
     changeset:
       title: "Changeset"
-      changeset: "Changeset:"
+      changeset: "Changeset: {{id}}"
       download: "Download {{changeset_xml_link}} or {{osmchange_xml_link}}"
       changesetxml: "Changeset XML"
       osmchangexml: "osmChange XML"
index 4374e5303dfbd7f5132ae2c06452e55c09f83e11..5f1cb67872cad1801df6d2c9802c8ba40c6ec5f7 100644 (file)
@@ -77,7 +77,7 @@ hi:
   browse:
     changeset:
       title: "Changeset"
-      changeset: "Changeset:"
+      changeset: "Changeset: {{id}}"
       download: "Download {{changeset_xml_link}} or {{osmchange_xml_link}}"
       changesetxml: "Changeset XML"
       osmchangexml: "osmChange XML"
index 3860c5b01978bff4b880a9044fe0b8111c13b0d3..8e333d36e4736e9616b63830266d65b0ceb34d29 100644 (file)
@@ -83,10 +83,18 @@ is:
   browse:
     changeset:
       title: "Breytingarsett"
-      changeset: "Breytingarsett:"
+      changeset: "Breytingarsett: {{id}}"
       download: "Niðurhala breytingunni á {{changeset_xml_link}} eða á {{osmchange_xml_link}}"
       changesetxml: "Breytingarsetts XML sniði"
       osmchangexml: "osmChange XML sniði"
+    changeset_navigation:
+      user:
+        name_tooltip: "Skoða breytingarsett eftir {{user}}"
+        prev_tooltip: "Fyrri breytingarsett eftir {{user}}"
+        next_tooltip: "Næsta breytingarsett eftir {{user}}"
+      all:
+        prev_tooltip: "Fyrra breytingarsett"
+        next_tooltip: "Næsta breytingarsett"
     changeset_details:
       created_at: "Búið til:"
       closed_at: "Lokað:"
index d4c83fa7a3859a83741dff9d0c42f423c9a984dd..3e367877dc6d65729b67abf39c49282fac5075a8 100644 (file)
@@ -77,7 +77,7 @@ it:
   browse:
     changeset:
       title: "Gruppo di modifiche"
-      changeset: "Gruppo di modifiche:"
+      changeset: "Gruppo di modifiche: {{id}}"
       download: "Scarica il {{changeset_xml_link}} oppure le {{osmchange_xml_link}}"
       changesetxml: "gruppo di modifiche XML"
       osmchangexml: "modificheOsm XML"
index bf7c2e8a244d90764a3318274ef82eff2b587827..114e360676b5aa7501a473f64497da9747dca8c4 100644 (file)
@@ -79,7 +79,7 @@ ja:
   browse:
     changeset:
       title: "変更セット"
-      changeset: "変更セット:"
+      changeset: "変更セット: {{id}}"
       download: "ダウンロード{{changeset_xml_link}} or {{osmchange_xml_link}}"
       changesetxml: "変更セットXML"
       osmchangexml: "osm変更XML"
index 41f6f9e96850c82e0dddf678eb077b98bd1e2c90..414927ba351623ff52f0609ac6a54a0bf0bf205f 100644 (file)
@@ -79,7 +79,7 @@ ko:
   browse:
     changeset:
       title: "변경셋"
-      changeset: "변경셋:"
+      changeset: "변경셋: {{id}}"
       download: "내려받기 {{changeset_xml_link}} 혹은 {{osmchange_xml_link}}"
       changesetxml: "변경셋 XML"
       osmchangexml: "osmChange XML"
index 837d29d355b69c3de31b3cb66fbbaa814a48a740..67ce9a2b23fae246b447eb2a274e28a110c195d9 100644 (file)
@@ -77,7 +77,7 @@ nl:
   browse:
     changeset:
       title: "Changeset"
-      changeset: "Changeset:"
+      changeset: "Changeset: {{id}}"
       download: "Download {{changeset_xml_link}} of {{osmchange_xml_link}}"
       changesetxml: "Changeset-XML"
       osmchangexml: "osmChange-XML"
index 8dd0345ffabcdf7d58ec312d4dd6864a777d65eb..2d261acd35f637ea7168984f17d3b3ae2e7a0afa 100644 (file)
@@ -77,7 +77,7 @@ pl:
   browse:
     changeset:
       title: "Changeset"
-      changeset: "Changeset:"
+      changeset: "Changeset: {{id}}"
       download: "Ściągnij {{changeset_xml_link}} lub {{osmchange_xml_link}}"
       changesetxml: "XML w formacie Changesetu"
       osmchangexml: "XML w formacie osmChange"
index 602870877f1a0aeb12bbd718f92889396762e0ee..25b8f18ff7f4007ca6f5c8e7742cee520228dc1d 100644 (file)
@@ -79,7 +79,7 @@ pt-BR:
   browse:
     changeset:
       title: "Alterações"
-      changeset: "Alterações:"
+      changeset: "Alterações: {{id}}"
       download: "Baixar {{changeset_xml_link}} ou {{osmchange_xml_link}}"
       changesetxml: "XML do conjunto de alterações"
       osmchangexml: "osmChange XML"
index 700619645fac09166acfdbb2b5901bcee5bd0222..58859588a2abc883b8ef996786dcbd8d9f528bce 100644 (file)
@@ -77,7 +77,7 @@ ru:
   browse:
     changeset:
       title: "Пакет изменений"
-      changeset: "Пакет изменений:"
+      changeset: "Пакет изменений: {{id}}"
       download: "Загрузить {{changeset_xml_link}} или {{osmchange_xml_link}}"
       changesetxml: "XML пакета изменений"
       osmchangexml: "osmChange XML"
index 7c2d84ec22eb0704ce4c79d2bc8a9b24f07456c0..b05af69b697f3f99fc0bbdbdded807955ebe6845 100644 (file)
@@ -79,7 +79,7 @@ sl:
   browse:
     changeset:
       title: "Paket sprememb"
-      changeset: "Paket sprememb:"
+      changeset: "Paket sprememb: {{id}}"
       download: "Prenesi {{changeset_xml_link}} ali {{osmchange_xml_link}}"
       changesetxml: "Changeset XML"
       osmchangexml: "osmChange XML"
index 48ba761667b84240d2fa785241f5f4f87bb16ff3..41f84b66ed75b8430d91637d32d69f0493800d94 100644 (file)
@@ -83,7 +83,7 @@ vi:
   browse:
     changeset:
       title: "Bộ thay đổi"
-      changeset: "Bộ thay đổi:"
+      changeset: "Bộ thay đổi: {{id}}"
       download: "Tải xuống {{changeset_xml_link}} hoặc {{osmchange_xml_link}}"
       changesetxml: "Bộ thay đổi XML"
       osmchangexml: "osmChange XML"
index bc207113bbc5fadc952bc7a438f4472a550c3d1f..ce6c0564427ab71e496109fdb1a24adae53dddae 100644 (file)
@@ -79,7 +79,7 @@ yo:
   browse:
     changeset:
       title: "Changeset"
-      changeset: "Changeset:"
+      changeset: "Changeset: {{id}}"
       download: "Download {{changeset_xml_link}} or {{osmchange_xml_link}}"
       changesetxml: "Changeset XML"
       osmchangexml: "osmChange XML"
index b1ef83dc21104637618cc1f27d1ef5d599ec3a2f..b4a7e027d66ad293bc9c8c6d7f94eed8d8e3d40d 100644 (file)
@@ -77,7 +77,7 @@ zh-CN:
   browse:
     changeset:
       title: "修改集合"
-      changeset: "修改集合:"
+      changeset: "修改集合: {{id}}"
       download: "下载 {{changeset_xml_link}} 或 {{osmchange_xml_link}}"
       changesetxml: "Changeset XML"
       osmchangexml: "osmChange XML"
index 104137e4ba315f414871f8f8f331461b0e84ba32..9792d1477352786691b153f593c6ab0ce5120c65 100644 (file)
@@ -79,7 +79,7 @@ zh-TW:
   browse:
     changeset:
       title: "變更組合"
-      changeset: "變更組合:"
+      changeset: "變更組合: {{id}}"
       download: "下載 {{changeset_xml_link}} 或 {{osmchange_xml_link}}"
       changesetxml: "Changeset XML"
       osmchangexml: "osmChange XML"
index 681149c2a30f6e82ff2b3e85ef527bbea5712e05..f26a1503270479c94aafb3f926a6205acc1c788c 100644 (file)
@@ -6,9 +6,9 @@ ActionController::Routing::Routes.draw do |map|
 
   map.connect "api/#{API_VERSION}/changeset/create", :controller => 'changeset', :action => 'create'
   map.connect "api/#{API_VERSION}/changeset/:id/upload", :controller => 'changeset', :action => 'upload', :id => /\d+/
-  map.connect "api/#{API_VERSION}/changeset/:id/download", :controller => 'changeset', :action => 'download', :id => /\d+/
+  map.changeset_download "api/#{API_VERSION}/changeset/:id/download", :controller => 'changeset', :action => 'download', :id => /\d+/
   map.connect "api/#{API_VERSION}/changeset/:id/expand_bbox", :controller => 'changeset', :action => 'expand_bbox', :id => /\d+/
-  map.connect "api/#{API_VERSION}/changeset/:id", :controller => 'changeset', :action => 'read', :id => /\d+/, :conditions => { :method => :get }
+  map.changeset_read "api/#{API_VERSION}/changeset/:id", :controller => 'changeset', :action => 'read', :id => /\d+/, :conditions => { :method => :get }
   map.connect "api/#{API_VERSION}/changeset/:id", :controller => 'changeset', :action => 'update', :id => /\d+/, :conditions => { :method => :put }
   map.connect "api/#{API_VERSION}/changeset/:id/close", :controller => 'changeset', :action => 'close', :id =>/\d+/
   map.connect "api/#{API_VERSION}/changesets", :controller => 'changeset', :action => 'query'
@@ -81,14 +81,16 @@ ActionController::Routing::Routes.draw do |map|
   map.connect '/browse/node/:id/history', :controller => 'browse', :action => 'node_history', :id => /\d+/
   map.connect '/browse/relation/:id', :controller => 'browse', :action => 'relation', :id => /\d+/
   map.connect '/browse/relation/:id/history', :controller => 'browse', :action => 'relation_history', :id => /\d+/
-  map.connect '/browse/changeset/:id', :controller => 'browse', :action => 'changeset', :id => /\d+/
+  map.changeset '/browse/changeset/:id', :controller => 'browse', :action => 'changeset', :id => /\d+/
   map.connect '/browse/changesets', :controller => 'changeset', :action => 'list'
+  map.connect '/browse/changesets/feed', :controller => 'changeset', :action => 'list', :format => :atom
   
   # web site
   map.root :controller => 'site', :action => 'index'
   map.connect '/', :controller => 'site', :action => 'index'
   map.connect '/edit', :controller => 'site', :action => 'edit'
-  map.connect '/history', :controller => 'changeset', :action => 'list_bbox'
+  map.connect '/history', :controller => 'changeset', :action => 'list'
+  map.connect '/history/feed', :controller => 'changeset', :action => 'list', :format => :atom
   map.connect '/export', :controller => 'site', :action => 'export'
   map.connect '/login', :controller => 'user', :action => 'login'
   map.connect '/logout', :controller => 'user', :action => 'logout'
@@ -146,7 +148,8 @@ ActionController::Routing::Routes.draw do |map|
 
   # user pages
   map.connect '/user/:display_name', :controller => 'user', :action => 'view'
-  map.connect '/user/:display_name/edits', :controller => 'changeset', :action => 'list_user'
+  map.connect '/user/:display_name/edits', :controller => 'changeset', :action => 'list'
+  map.connect '/user/:display_name/edits/feed', :controller => 'changeset', :action => 'list', :format =>:atom
   map.connect '/user/:display_name/make_friend', :controller => 'user', :action => 'make_friend'
   map.connect '/user/:display_name/remove_friend', :controller => 'user', :action => 'remove_friend'
   map.connect '/user/:display_name/diary', :controller => 'diary_entry', :action => 'list'
index d943768ad67e489f1f74199dd8c9b328947a7914..30bbebb8d928ed056f591a5361b56c613363248e 100644 (file)
@@ -4,7 +4,7 @@ class BoundingBox
   end
 
   def self.from_s(s)
-    BoundingBox.new(s.split(/,/))
+    BoundingBox.new(*s.split(/,/))
   end
 
   def min_lon
index d60fe2fbc9621344512f373f479916ee85b3942d..8f0b2147786cebe98788bb3e76e3cf703956be6e 100644 (file)
@@ -1490,11 +1490,11 @@ EOF
   def test_list
     changesets = Changeset.find(:all, :order => "created_at DESC", :conditions => ['min_lat IS NOT NULL'], :limit=> 20)
     assert changesets.size <= 20
-    get :list
+    get :list, {:format => "html"}
     assert_response :success
     assert_template "list"
     # Now check that all 20 (or however many were returned) changesets are in the html
-    assert_select "h1", :text => "Recent Changes", :count => 1
+    assert_select "h1", :text => "Changesets", :count => 1
     assert_select "table[id='changeset_list'] tr", :count => changesets.size + 1
     changesets.each do |changeset|
       # FIXME this test needs rewriting - test for table contents
@@ -1505,16 +1505,16 @@ EOF
   # Checks the display of the user changesets listing
   def test_list_user
     user = users(:public_user)
-    get :list_user, {:display_name => user.display_name}
+    get :list, {:format => "html", :display_name => user.display_name}
     assert_response :success
-    assert_template 'list_user'
+    assert_template "list"
     ## FIXME need to add more checks to see which if edits are actually shown if your data is public
   end
   
   ##
   # Check the not found of the list user changesets
   def test_list_user_not_found
-    get :list_user, {:display_name => "Some random user"}
+    get :list, {:format => "html", :display_name => "Some random user"}
     assert_response :not_found
     assert_template 'user/no_such_user'
   end