X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/8ae5d94b2f16d6f2cf1739e19ebc3793a18a0a4a..4d91fe3dd95c1058cb8d24fd4c900223e30b9059:/app/controllers/browse_controller.rb diff --git a/app/controllers/browse_controller.rb b/app/controllers/browse_controller.rb index 2a7e2c5f7..2c22a9b83 100644 --- a/app/controllers/browse_controller.rb +++ b/app/controllers/browse_controller.rb @@ -1,5 +1,5 @@ class BrowseController < ApplicationController - layout 'site' + layout 'site', :except => [ :start ] before_filter :authorize_web before_filter :set_locale @@ -79,4 +79,13 @@ class BrowseController < ApplicationController rescue ActiveRecord::RecordNotFound render :action => "not_found", :status => :not_found end + + 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 end