- @title = "Changeset | #{@changeset.id}"
- @next = Changeset.find(:first, :order => "id ASC", :conditions => [ "id > :id", { :id => @changeset.id }] )
- @prev = Changeset.find(:first, :order => "id DESC", :conditions => [ "id < :id", { :id => @changeset.id }] )
+ @title = "#{I18n.t('browse.changeset.title')} | #{@changeset.id}"
+ @next = Changeset.where("id > ?", @changeset.id).order("id ASC").first
+ @prev = Changeset.where("id < ?", @changeset.id).order("id DESC").first
+
+ if @changeset.user.data_public?
+ @next_by_user = Changeset.where("user_id = ? AND id > ?", @changeset.user_id, @changeset.id).order("id ASC").first
+ @prev_by_user = Changeset.where("user_id = ? AND id < ?", @changeset.user_id, @changeset.id).order("id DESC").first
+ end
+ 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 }] )