]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/browse_controller.rb
Add a title to note browse pages
[rails.git] / app / controllers / browse_controller.rb
index e5557280e6ee7f4824a2c8144fbfefebe1c28c6a..622bcadd5da137cfa648d91dee03ed9c9c5ccadd 100644 (file)
@@ -76,4 +76,14 @@ class BrowseController < ApplicationController
   rescue ActiveRecord::RecordNotFound
     render :action => "not_found", :status => :not_found
   end
+
+  def note
+    @type = "note"
+    @note = Note.find(params[:id])
+    @title = "#{I18n.t('browse.note.title')} | #{@note.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