1 class BrowseController < ApplicationController
4 before_filter :authorize_web
5 before_filter { |c| c.check_database_availability(true) }
11 @nodes = Node.find(:all, :order => "timestamp DESC", :limit=> 20)
16 @relation = Relation.find(params[:id])
18 @name = @relation.tags['name'].to_s
20 @name = "#" + @relation.id.to_s
23 @title = 'Relation | ' + (@name)
24 @next = Relation.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @relation.id }] )
25 @prev = Relation.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @relation.id }] )
26 rescue ActiveRecord::RecordNotFound
28 render :action => "not_found", :status => :not_found
34 @relation = Relation.find(params[:id])
36 @name = @relation.tags['name'].to_s
38 @name = "#" + @relation.id.to_s
41 @title = 'Relation History | ' + (@name)
42 rescue ActiveRecord::RecordNotFound
44 render :action => "not_found", :status => :not_found
50 @way = Way.find(params[:id])
52 @name = @way.tags['name'].to_s
54 @name = "#" + @way.id.to_s
57 @title = 'Way | ' + (@name)
58 @next = Way.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @way.id }] )
59 @prev = Way.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @way.id }] )
60 rescue ActiveRecord::RecordNotFound
62 render :action => "not_found", :status => :not_found
68 @way = Way.find(params[:id])
70 @name = @way.tags['name'].to_s
72 @name = "#" + @way.id.to_s
75 @title = 'Way History | ' + (@name)
76 rescue ActiveRecord::RecordNotFound
78 render :action => "not_found", :status => :not_found
84 @node = Node.find(params[:id])
86 @name = @node.tags_as_hash['name'].to_s
88 @name = "#" + @node.id.to_s
91 @title = 'Node | ' + (@name)
92 @next = Node.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @node.id }] )
93 @prev = Node.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @node.id }] )
94 rescue ActiveRecord::RecordNotFound
96 render :action => "not_found", :status => :not_found
102 @node = Node.find(params[:id])
104 @name = @node.tags_as_hash['name'].to_s
105 if @name.length == 0:
106 @name = "#" + @node.id.to_s
109 @title = 'Node History | ' + (@name)
110 rescue ActiveRecord::RecordNotFound
112 render :action => "not_found", :status => :not_found