X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/17b23b075642d6bf2ba66a0448a7a7acfd2824b6..324c37a39ba7a59eee633f0b19203670d491b520:/app/controllers/browse_controller.rb diff --git a/app/controllers/browse_controller.rb b/app/controllers/browse_controller.rb index e3f20c803..5526aacca 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 @@ -7,7 +7,6 @@ class BrowseController < ApplicationController around_filter :web_timeout, :except => [:start] def start - render :partial => "sidebar" end def relation @@ -31,9 +30,6 @@ class BrowseController < ApplicationController @way = Way.find(params[:id], :include => [:way_tags, {:changeset => :user}, {:nodes => [:node_tags, {:ways => :way_tags}]}, :containing_relation_members]) @next = Way.visible.where("id > ?", @way.id).order("id ASC").first @prev = Way.visible.where("id < ?", @way.id).order("id DESC").first - - # Used for edit link, takes approx middle node of way - @midnode = @way.nodes[@way.nodes.length/2] rescue ActiveRecord::RecordNotFound render :action => "not_found", :status => :not_found end @@ -80,4 +76,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