1 class BrowseController < ApplicationController
2 before_filter :authorize_web
6 @nodes = Node.find(:all, :order => "timestamp DESC", :limit=> 20)
9 @nodes = Node.find(:all, :order => "timestamp DESC", :limit=> 20)
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
25 render :nothing => true, :status => :not_found
31 @relation = Relation.find(params[:id])
33 @name = @relation.tags['name'].to_s
35 @name = "#" + @relation.id.to_s
38 @title = 'Relation History | ' + (@name)
39 rescue ActiveRecord::RecordNotFound
40 render :nothing => true, :status => :not_found
46 @way = Way.find(params[:id])
48 @name = @way.tags['name'].to_s
50 @name = "#" + @way.id.to_s
53 @title = 'Way | ' + (@name)
54 @next = Way.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @way.id }] )
55 @prev = Way.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @way.id }] )
56 rescue ActiveRecord::RecordNotFound
57 render :nothing => true, :status => :not_found
63 @way = Way.find(params[:id])
65 @name = @way.tags['name'].to_s
67 @name = "#" + @way.id.to_s
70 @title = 'Way History | ' + (@name)
71 rescue ActiveRecord::RecordNotFound
72 render :nothing => true, :status => :not_found
78 @node = Node.find(params[:id])
80 @name = @node.tags_as_hash['name'].to_s
82 @name = "#" + @node.id.to_s
85 @title = 'Node | ' + (@name)
86 @next = Node.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @node.id }] )
87 @prev = Node.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @node.id }] )
88 rescue ActiveRecord::RecordNotFound
89 render :nothing => true, :status => :not_found
95 @node = Node.find(params[:id])
97 @name = @node.tags_as_hash['name'].to_s
99 @name = "#" + @node.id.to_s
102 @title = 'Node History | ' + (@name)
103 rescue ActiveRecord::RecordNotFound
104 render :nothing => true, :status => :not_found