1 class BrowseController < ApplicationController
4 before_filter :authorize_web
5 before_filter { |c| c.check_database_availability(true) }
14 @relation = Relation.find(params[:id])
16 @name = @relation.tags['name'].to_s
18 @name = "#" + @relation.id.to_s
21 @title = 'Relation | ' + (@name)
22 @next = Relation.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @relation.id }] )
23 @prev = Relation.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @relation.id }] )
24 rescue ActiveRecord::RecordNotFound
26 render :action => "not_found", :status => :not_found
32 @relation = Relation.find(params[:id])
34 @name = @relation.tags['name'].to_s
36 @name = "#" + @relation.id.to_s
39 @title = 'Relation History | ' + (@name)
40 rescue ActiveRecord::RecordNotFound
42 render :action => "not_found", :status => :not_found
48 @way = Way.find(params[:id])
50 @name = @way.tags['name'].to_s
52 @name = "#" + @way.id.to_s
55 @title = 'Way | ' + (@name)
56 @next = Way.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @way.id }] )
57 @prev = Way.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @way.id }] )
58 rescue ActiveRecord::RecordNotFound
60 render :action => "not_found", :status => :not_found
66 @way = Way.find(params[:id])
68 @name = @way.tags['name'].to_s
70 @name = "#" + @way.id.to_s
73 @title = 'Way History | ' + (@name)
74 rescue ActiveRecord::RecordNotFound
76 render :action => "not_found", :status => :not_found
82 @node = Node.find(params[:id])
84 @name = @node.tags_as_hash['name'].to_s
86 @name = "#" + @node.id.to_s
89 @title = 'Node | ' + (@name)
90 @next = Node.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @node.id }] )
91 @prev = Node.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @node.id }] )
92 rescue ActiveRecord::RecordNotFound
94 render :action => "not_found", :status => :not_found
100 @node = Node.find(params[:id])
102 @name = @node.tags_as_hash['name'].to_s
103 if @name.length == 0:
104 @name = "#" + @node.id.to_s
107 @title = 'Node History | ' + (@name)
108 rescue ActiveRecord::RecordNotFound
110 render :action => "not_found", :status => :not_found
116 @changeset = Changeset.find(params[:id])
117 @node_pages, @nodes = paginate(:old_nodes, :conditions => {:changeset_id => @changeset.id}, :per_page => 20, :parameter => 'node_page')
118 @way_pages, @ways = paginate(:old_ways, :conditions => {:changeset_id => @changeset.id}, :per_page => 20, :parameter => 'way_page')
119 @relation_pages, @relations = paginate(:old_relations, :conditions => {:changeset_id => @changeset.id}, :per_page => 20, :parameter => 'relation_page')
121 @title = "Changeset | #{@changeset.id}"
122 @next = Changeset.find(:first, :order => "id ASC", :conditions => [ "id > :id", { :id => @changeset.id }] )
123 @prev = Changeset.find(:first, :order => "id DESC", :conditions => [ "id < :id", { :id => @changeset.id }] )
124 rescue ActiveRecord::RecordNotFound
126 render :action => "not_found", :status => :not_found