X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/34b147266c397bb1318bbfefb48df1c704855843..ef40b61ff40881966ae4280cfdcb9f92965e9d10:/app/controllers/browse_controller.rb diff --git a/app/controllers/browse_controller.rb b/app/controllers/browse_controller.rb index 8124d4a33..91d8eb84f 100644 --- a/app/controllers/browse_controller.rb +++ b/app/controllers/browse_controller.rb @@ -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