]> 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 a511d67d35fb54cc558ff124a894abf03469540f..d9b18769c37b934d8f77038c5884ee23418c9fe3 100644 (file)
@@ -78,6 +78,15 @@ class BrowseController < ApplicationController
     render :action => "not_found", :status => :not_found
   end
 
     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
+
 private
 
   def timeout
 private
 
   def timeout