1 class BrowseController < ApplicationController
4 before_filter :authorize_web
5 before_filter { |c| c.check_database_readable(true) }
13 @relation = Relation.find(params[:id])
15 @name = @relation.tags['name'].to_s
17 @name = "#" + @relation.id.to_s
20 @title = 'Relation | ' + (@name)
21 @next = Relation.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @relation.id }] )
22 @prev = Relation.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @relation.id }] )
23 rescue ActiveRecord::RecordNotFound
25 render :action => "not_found", :status => :not_found
29 @relation = Relation.find(params[:id])
31 @name = @relation.tags['name'].to_s
33 @name = "#" + @relation.id.to_s
36 @title = 'Relation History | ' + (@name)
37 rescue ActiveRecord::RecordNotFound
39 render :action => "not_found", :status => :not_found
43 @way = Way.find(params[:id])
45 @name = @way.tags['name'].to_s
47 @name = "#" + @way.id.to_s
50 @title = 'Way | ' + (@name)
51 @next = Way.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @way.id }] )
52 @prev = Way.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @way.id }] )
53 rescue ActiveRecord::RecordNotFound
55 render :action => "not_found", :status => :not_found
59 @way = Way.find(params[:id])
61 @name = @way.tags['name'].to_s
63 @name = "#" + @way.id.to_s
66 @title = 'Way History | ' + (@name)
67 rescue ActiveRecord::RecordNotFound
69 render :action => "not_found", :status => :not_found
73 @node = Node.find(params[:id])
75 @name = @node.tags_as_hash['name'].to_s
77 @name = "#" + @node.id.to_s
80 @title = 'Node | ' + (@name)
81 @next = Node.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @node.id }] )
82 @prev = Node.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @node.id }] )
83 rescue ActiveRecord::RecordNotFound
85 render :action => "not_found", :status => :not_found
89 @node = Node.find(params[:id])
91 @name = @node.tags_as_hash['name'].to_s
93 @name = "#" + @node.id.to_s
96 @title = 'Node History | ' + (@name)
97 rescue ActiveRecord::RecordNotFound
99 render :action => "not_found", :status => :not_found
103 @changeset = Changeset.find(params[:id])
104 @node_pages, @nodes = paginate(:old_nodes, :conditions => {:changeset_id => @changeset.id}, :per_page => 20, :parameter => 'node_page')
105 @way_pages, @ways = paginate(:old_ways, :conditions => {:changeset_id => @changeset.id}, :per_page => 20, :parameter => 'way_page')
106 @relation_pages, @relations = paginate(:old_relations, :conditions => {:changeset_id => @changeset.id}, :per_page => 20, :parameter => 'relation_page')
108 @title = "Changeset | #{@changeset.id}"
109 @next = Changeset.find(:first, :order => "id ASC", :conditions => [ "id > :id", { :id => @changeset.id }] )
110 @prev = Changeset.find(:first, :order => "id DESC", :conditions => [ "id < :id", { :id => @changeset.id }] )
111 rescue ActiveRecord::RecordNotFound
113 render :action => "not_found", :status => :not_found