]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/browse_controller.rb
Merge branch 'master' into openstreetbugs
[rails.git] / app / controllers / browse_controller.rb
index 9aec1060a19b3c836e455c0abcc0dd36c79ec8cc..2962c6836a9a1a4f7e202c728a226e9a3f150ae0 100644 (file)
@@ -77,4 +77,13 @@ class BrowseController < ApplicationController
   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 }] )
+  rescue ActiveRecord::RecordNotFound
+    render :action => "not_found", :status => :not_found
+  end
 end