1 class BrowseController < ApplicationController
4 before_filter :authorize_web
5 before_filter { |c| c.check_database_readable(true) }
13 @relation = Relation.find(params[:id])
14 @next = Relation.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @relation.id }] )
15 @prev = Relation.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @relation.id }] )
16 rescue ActiveRecord::RecordNotFound
18 render :action => "not_found", :status => :not_found
22 @relation = Relation.find(params[:id])
23 rescue ActiveRecord::RecordNotFound
25 render :action => "not_found", :status => :not_found
29 @way = Way.find(params[:id])
30 @next = Way.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @way.id }] )
31 @prev = Way.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @way.id }] )
32 rescue ActiveRecord::RecordNotFound
34 render :action => "not_found", :status => :not_found
38 @way = Way.find(params[:id])
39 rescue ActiveRecord::RecordNotFound
41 render :action => "not_found", :status => :not_found
45 @node = Node.find(params[:id])
46 @next = Node.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @node.id }] )
47 @prev = Node.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @node.id }] )
48 rescue ActiveRecord::RecordNotFound
50 render :action => "not_found", :status => :not_found
54 @node = Node.find(params[:id])
55 rescue ActiveRecord::RecordNotFound
57 render :action => "not_found", :status => :not_found
61 @changeset = Changeset.find(params[:id])
62 @node_pages, @nodes = paginate(:old_nodes, :conditions => {:changeset_id => @changeset.id}, :per_page => 20, :parameter => 'node_page')
63 @way_pages, @ways = paginate(:old_ways, :conditions => {:changeset_id => @changeset.id}, :per_page => 20, :parameter => 'way_page')
64 @relation_pages, @relations = paginate(:old_relations, :conditions => {:changeset_id => @changeset.id}, :per_page => 20, :parameter => 'relation_page')
66 @title = "Changeset | #{@changeset.id}"
67 @next = Changeset.find(:first, :order => "id ASC", :conditions => [ "id > :id", { :id => @changeset.id }] )
68 @prev = Changeset.find(:first, :order => "id DESC", :conditions => [ "id < :id", { :id => @changeset.id }] )
69 rescue ActiveRecord::RecordNotFound
71 render :action => "not_found", :status => :not_found