- @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.user.changesets.where("id > ?", @changeset.id).order(:id => :asc).first
+ @prev_by_user = @changeset.user.changesets.where("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])
+ @title = "#{I18n.t('browse.note.title')} | #{@note.id}"
+ @next = Note.visible.where("id > ?", @note.id).order(:id => :asc).first
+ @prev = Note.visible.where("id < ?", @note.id).order(:id => :desc).first