X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/35c88713546d4c606e0aca9c4a4b3a63ae88759b..4ca38904dc11fa7329e186bd675e15e3c401ca86:/app/controllers/browse_controller.rb diff --git a/app/controllers/browse_controller.rb b/app/controllers/browse_controller.rb index 97daaa268..3ecec6348 100644 --- a/app/controllers/browse_controller.rb +++ b/app/controllers/browse_controller.rb @@ -16,6 +16,8 @@ class BrowseController < ApplicationController end @title = 'Relation | ' + (@name) + @next = Relation.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @relation.id }] ) + @prev = Relation.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @relation.id }] ) rescue ActiveRecord::RecordNotFound render :nothing => true, :status => :not_found end @@ -46,6 +48,8 @@ class BrowseController < ApplicationController end @title = 'Way | ' + (@name) + @next = Way.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @way.id }] ) + @prev = Way.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @way.id }] ) rescue ActiveRecord::RecordNotFound render :nothing => true, :status => :not_found end @@ -76,6 +80,8 @@ class BrowseController < ApplicationController end @title = 'Node | ' + (@name) + @next = Node.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @node.id }] ) + @prev = Node.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @node.id }] ) rescue ActiveRecord::RecordNotFound render :nothing => true, :status => :not_found end