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
27 render :nothing => true, :status => :not_found
33 @relation = Relation.find(params[:id])
35 @name = @relation.tags['name'].to_s
37 @name = "#" + @relation.id.to_s
40 @title = 'Relation History | ' + (@name)
41 rescue ActiveRecord::RecordNotFound
42 render :nothing => true, :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
59 render :nothing => true, :status => :not_found
65 @way = Way.find(params[:id])
67 @name = @way.tags['name'].to_s
69 @name = "#" + @way.id.to_s
72 @title = 'Way History | ' + (@name)
73 rescue ActiveRecord::RecordNotFound
74 render :nothing => true, :status => :not_found
80 @node = Node.find(params[:id])
82 @name = @node.tags_as_hash['name'].to_s
84 @name = "#" + @node.id.to_s
87 @title = 'Node | ' + (@name)
88 @next = Node.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @node.id }] )
89 @prev = Node.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @node.id }] )
90 rescue ActiveRecord::RecordNotFound
91 render :nothing => true, :status => :not_found
97 @node = Node.find(params[:id])
99 @name = @node.tags_as_hash['name'].to_s
100 if @name.length == 0:
101 @name = "#" + @node.id.to_s
104 @title = 'Node History | ' + (@name)
105 rescue ActiveRecord::RecordNotFound
106 render :nothing => true, :status => :not_found