1 class BrowseController < ApplicationController
4 before_filter :authorize_web
5 before_filter :set_locale
6 before_filter { |c| c.check_database_readable(true) }
7 before_filter :require_oauth
8 around_filter :web_timeout
12 @feature = Relation.find(params[:id])
14 rescue ActiveRecord::RecordNotFound
15 render :action => "not_found", :status => :not_found
20 @feature = Relation.find(params[:id])
22 rescue ActiveRecord::RecordNotFound
23 render :action => "not_found", :status => :not_found
28 @feature = Way.preload(:way_tags, :containing_relation_members, :changeset => :user, :nodes => [:node_tags, :ways => :way_tags]).find(params[:id])
30 rescue ActiveRecord::RecordNotFound
31 render :action => "not_found", :status => :not_found
36 @feature = Way.preload(:way_tags, :old_ways => { :changeset => :user }).find(params[:id])
38 rescue ActiveRecord::RecordNotFound
39 render :action => "not_found", :status => :not_found
44 @feature = Node.find(params[:id])
46 rescue ActiveRecord::RecordNotFound
47 render :action => "not_found", :status => :not_found
52 @feature = Node.find(params[:id])
54 rescue ActiveRecord::RecordNotFound
55 render :action => "not_found", :status => :not_found
60 @changeset = Changeset.find(params[:id])
61 @comments = @changeset.comments.unscope(:where => :visible).includes(:author) if @user and @user.moderator?
62 @comments ||= @changeset.comments.includes(:author)
63 @node_pages, @nodes = paginate(:old_nodes, :conditions => {:changeset_id => @changeset.id}, :per_page => 20, :parameter => 'node_page')
64 @way_pages, @ways = paginate(:old_ways, :conditions => {:changeset_id => @changeset.id}, :per_page => 20, :parameter => 'way_page')
65 @relation_pages, @relations = paginate(:old_relations, :conditions => {:changeset_id => @changeset.id}, :per_page => 20, :parameter => 'relation_page')
66 if @changeset.user.data_public?
67 @next_by_user = @changeset.user.changesets.where("id > ?", @changeset.id).reorder(:id => :asc).first
68 @prev_by_user = @changeset.user.changesets.where("id < ?", @changeset.id).reorder(:id => :desc).first
70 rescue ActiveRecord::RecordNotFound
71 render :action => "not_found", :status => :not_found
76 @note = Note.find(params[:id])
77 rescue ActiveRecord::RecordNotFound
78 render :action => "not_found", :status => :not_found