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 @title = "#{I18n.t('browse.changeset.title')} | #{@changeset.id}"
66 @next = Changeset.where("id > ?", @changeset.id).order(:id => :asc).first
67 @prev = Changeset.where("id < ?", @changeset.id).order(:id => :desc).first
69 if @changeset.user.data_public?
70 @next_by_user = @changeset.user.changesets.where("id > ?", @changeset.id).order(:id => :asc).first
71 @prev_by_user = @changeset.user.changesets.where("id < ?", @changeset.id).order(:id => :desc).first
73 rescue ActiveRecord::RecordNotFound
74 render :action => "not_found", :status => :not_found
79 @note = Note.find(params[:id])
80 @title = "#{I18n.t('browse.note.title')} | #{@note.id}"
81 @next = Note.visible.where("id > ?", @note.id).order(:id => :asc).first
82 @prev = Note.visible.where("id < ?", @note.id).order(:id => :desc).first
83 rescue ActiveRecord::RecordNotFound
84 render :action => "not_found", :status => :not_found