]> 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 5c7912d154ec12a73769c6a41d8ee9de4e5021db..2962c6836a9a1a4f7e202c728a226e9a3f150ae0 100644 (file)
@@ -4,7 +4,7 @@ class BrowseController < ApplicationController
   before_filter :authorize_web  
   before_filter :set_locale 
   before_filter { |c| c.check_database_readable(true) }
-  around_filter :timeout, :except => [:start]
+  around_filter :web_timeout, :except => [:start]
 
   def start 
   end
@@ -78,13 +78,12 @@ class BrowseController < ApplicationController
     render :action => "not_found", :status => :not_found
   end
 
-private
-
-  def timeout
-    SystemTimer.timeout_after(30) do
-      yield
-    end
-  rescue Timeout::Error
-    render :action => "timeout", :status => :request_timeout
+  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