1 class BrowseController < ApplicationController
4 before_filter :authorize_web
5 before_filter :set_locale
6 before_filter { |c| c.check_database_readable(true) }
7 around_filter :web_timeout
11 @relation = Relation.find(params[:id])
12 @next = Relation.visible.where("id > ?", @relation.id).order(:id => :asc).first
13 @prev = Relation.visible.where("id < ?", @relation.id).order(:id => :desc).first
14 rescue ActiveRecord::RecordNotFound
15 render :action => "not_found", :status => :not_found
20 @relation = Relation.find(params[:id])
21 rescue ActiveRecord::RecordNotFound
22 render :action => "not_found", :status => :not_found
27 @way = Way.preload(:way_tags, :containing_relation_members, :changeset => :user, :nodes => [:node_tags, :ways => :way_tags]).find(params[:id])
28 @next = Way.visible.where("id > ?", @way.id).order(:id => :asc).first
29 @prev = Way.visible.where("id < ?", @way.id).order(:id => :desc).first
30 rescue ActiveRecord::RecordNotFound
31 render :action => "not_found", :status => :not_found
36 @way = Way.preload(:way_tags, :old_ways => { :changeset => :user }).find(params[:id])
37 rescue ActiveRecord::RecordNotFound
38 render :action => "not_found", :status => :not_found
43 @node = Node.find(params[:id])
44 @next = Node.visible.where("id > ?", @node.id).order(:id => :asc).first
45 @prev = Node.visible.where("id < ?", @node.id).order(:id => :desc).first
46 rescue ActiveRecord::RecordNotFound
47 render :action => "not_found", :status => :not_found
52 @node = Node.find(params[:id])
53 rescue ActiveRecord::RecordNotFound
54 render :action => "not_found", :status => :not_found
60 @changeset = Changeset.find(params[:id])
61 @node_pages, @nodes = paginate(:old_nodes, :conditions => {:changeset_id => @changeset.id}, :per_page => 10, :parameter => 'node_page')
62 @way_pages, @ways = paginate(:old_ways, :conditions => {:changeset_id => @changeset.id}, :per_page => 10, :parameter => 'way_page')
63 @relation_pages, @relations = paginate(:old_relations, :conditions => {:changeset_id => @changeset.id}, :per_page => 10, :parameter => 'relation_page')
65 @next = Changeset.where("id > ?", @changeset.id).order(:id => :asc).first
66 @prev = Changeset.where("id < ?", @changeset.id).order(:id => :desc).first
68 if @changeset.user.data_public?
69 @next_by_user = @changeset.user.changesets.where("id > ?", @changeset.id).order(:id => :asc).first
70 @prev_by_user = @changeset.user.changesets.where("id < ?", @changeset.id).order(:id => :desc).first
72 rescue ActiveRecord::RecordNotFound
73 render :action => "not_found", :status => :not_found
78 @note = Note.find(params[:id])
79 @next = Note.visible.where("id > ?", @note.id).order(:id => :asc).first
80 @prev = Note.visible.where("id < ?", @note.id).order(:id => :desc).first
81 rescue ActiveRecord::RecordNotFound
82 render :action => "not_found", :status => :not_found