X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/b9c9d6c1aafdd60c72b54345b4d2dc94317298a0..c20b31b54ed3043e9ebf3964aa7c08f5ddc73a95:/app/controllers/browse_controller.rb diff --git a/app/controllers/browse_controller.rb b/app/controllers/browse_controller.rb index 2962c6836..2036e4f10 100644 --- a/app/controllers/browse_controller.rb +++ b/app/controllers/browse_controller.rb @@ -72,17 +72,19 @@ class BrowseController < ApplicationController @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 }] ) - @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 }] ) + if @changeset.user.data_public? + @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 }] ) + end rescue ActiveRecord::RecordNotFound render :action => "not_found", :status => :not_found end - def bug - @type = "bug" - @bug = MapBug.find(params[:id]) - @next = MapBug.find(:first, :order => "id ASC", :conditions => [ "status != 'hidden' AND id > :id", { :id => @bug.id }] ) - @prev = MapBug.find(:first, :order => "id DESC", :conditions => [ "status != 'hidden' AND id < :id", { :id => @bug.id }] ) + def note + @type = "note" + @note = Note.find(params[:id]) + @next = Note.find(:first, :order => "id ASC", :conditions => [ "status != 'hidden' AND id > :id", { :id => @note.id }] ) + @prev = Note.find(:first, :order => "id DESC", :conditions => [ "status != 'hidden' AND id < :id", { :id => @note.id }] ) rescue ActiveRecord::RecordNotFound render :action => "not_found", :status => :not_found end