1 class BrowseController < ApplicationController
2 before_filter :authorize_web
8 @nodes = Node.find(:all, :order => "timestamp DESC", :limit=> 20)
13 @relation = Relation.find(params[:id])
15 @name = @relation.tags['name'].to_s
17 @name = "#" + @relation.id.to_s
20 @title = 'Relation | ' + (@name)
21 @next = Relation.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @relation.id }] )
22 @prev = Relation.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @relation.id }] )
23 rescue ActiveRecord::RecordNotFound
24 render :nothing => true, :status => :not_found
30 @relation = Relation.find(params[:id])
32 @name = @relation.tags['name'].to_s
34 @name = "#" + @relation.id.to_s
37 @title = 'Relation History | ' + (@name)
38 rescue ActiveRecord::RecordNotFound
39 render :nothing => true, :status => :not_found
45 @way = Way.find(params[:id])
47 @name = @way.tags['name'].to_s
49 @name = "#" + @way.id.to_s
52 @title = 'Way | ' + (@name)
53 @next = Way.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @way.id }] )
54 @prev = Way.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @way.id }] )
55 rescue ActiveRecord::RecordNotFound
56 render :nothing => true, :status => :not_found
62 @way = Way.find(params[:id])
64 @name = @way.tags['name'].to_s
66 @name = "#" + @way.id.to_s
69 @title = 'Way History | ' + (@name)
70 rescue ActiveRecord::RecordNotFound
71 render :nothing => true, :status => :not_found
77 @node = Node.find(params[:id])
79 @name = @node.tags_as_hash['name'].to_s
81 @name = "#" + @node.id.to_s
84 @title = 'Node | ' + (@name)
85 @next = Node.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @node.id }] )
86 @prev = Node.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @node.id }] )
87 rescue ActiveRecord::RecordNotFound
88 render :nothing => true, :status => :not_found
94 @node = Node.find(params[:id])
96 @name = @node.tags_as_hash['name'].to_s
98 @name = "#" + @node.id.to_s
101 @title = 'Node History | ' + (@name)
102 rescue ActiveRecord::RecordNotFound
103 render :nothing => true, :status => :not_found