X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/80ff70a1ffdcdf5711de8e1ceaa2b0b474630789..634565c5d399b71192484ac10fc2f8f1570e95f3:/app/controllers/browse_controller.rb?ds=sidebyside 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