1 class BrowseController < ApplicationController
2 before_filter :authorize_web
6 @nodes = Node.find(:all, :order => "timestamp DESC", :limit=> 20)
11 @relation = Relation.find(params[:id])
13 @name = @relation.tags['name'].to_s
15 @name = "#" + @relation.id.to_s
18 @title = 'Relation | ' + (@name)
19 @next = Relation.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @relation.id }] )
20 @prev = Relation.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @relation.id }] )
21 rescue ActiveRecord::RecordNotFound
22 render :nothing => true, :status => :not_found
28 @relation = Relation.find(params[:id])
30 @name = @relation.tags['name'].to_s
32 @name = "#" + @relation.id.to_s
35 @title = 'Relation History | ' + (@name)
36 rescue ActiveRecord::RecordNotFound
37 render :nothing => true, :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
54 render :nothing => true, :status => :not_found
60 @way = Way.find(params[:id])
62 @name = @way.tags['name'].to_s
64 @name = "#" + @way.id.to_s
67 @title = 'Way History | ' + (@name)
68 rescue ActiveRecord::RecordNotFound
69 render :nothing => true, :status => :not_found
75 @node = Node.find(params[:id])
77 @name = @node.tags_as_hash['name'].to_s
79 @name = "#" + @node.id.to_s
82 @title = 'Node | ' + (@name)
83 @next = Node.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @node.id }] )
84 @prev = Node.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @node.id }] )
85 rescue ActiveRecord::RecordNotFound
86 render :nothing => true, :status => :not_found
92 @node = Node.find(params[:id])
94 @name = @node.tags_as_hash['name'].to_s
96 @name = "#" + @node.id.to_s
99 @title = 'Node History | ' + (@name)
100 rescue ActiveRecord::RecordNotFound
101 render :nothing => true, :status => :not_found