]> git.openstreetmap.org Git - rails.git/blob - config/routes.rb
Handle public flag for GPX creation properly.
[rails.git] / config / routes.rb
1 ActionController::Routing::Routes.draw do |map|
2
3   # API
4   map.connect "api/#{API_VERSION}/node/create", :controller => 'node', :action => 'create'
5   map.connect "api/#{API_VERSION}/node/:id/segments", :controller => 'segment', :action => 'segments_for_node', :id => /\d+/
6   map.connect "api/#{API_VERSION}/node/:id/history", :controller => 'old_node', :action => 'history', :id => /\d+/
7   map.connect "api/#{API_VERSION}/node/:id", :controller => 'node', :action => 'read', :id => /\d+/, :conditions => { :method => :get }
8   map.connect "api/#{API_VERSION}/node/:id", :controller => 'node', :action => 'update', :id => /\d+/, :conditions => { :method => :put }
9   map.connect "api/#{API_VERSION}/node/:id", :controller => 'node', :action => 'delete', :id => /\d+/, :conditions => { :method => :delete }
10   map.connect "api/#{API_VERSION}/nodes", :controller => 'node', :action => 'nodes', :id => nil
11   
12   map.connect "api/#{API_VERSION}/segment/create", :controller => 'segment', :action => 'create'
13   map.connect "api/#{API_VERSION}/segment/:id/ways", :controller => 'way', :action => 'ways_for_segment', :id => /\d+/
14   map.connect "api/#{API_VERSION}/segment/:id/history", :controller => 'old_segment', :action => 'history', :id => /\d+/
15   map.connect "api/#{API_VERSION}/segment/:id", :controller => 'segment', :action => 'read', :id => /\d+/, :conditions => { :method => :get }
16   map.connect "api/#{API_VERSION}/segment/:id", :controller => 'segment', :action => 'update', :id => /\d+/, :conditions => { :method => :put }
17   map.connect "api/#{API_VERSION}/segment/:id", :controller => 'segment', :action => 'delete', :id => /\d+/, :conditions => { :method => :delete }
18   map.connect "api/#{API_VERSION}/segments", :controller => 'segment', :action => 'segments', :id => nil
19   
20   map.connect "api/#{API_VERSION}/way/create", :controller => 'way', :action => 'create'
21   map.connect "api/#{API_VERSION}/way/:id/history", :controller => 'old_way', :action => 'history', :id => /\d+/
22   map.connect "api/#{API_VERSION}/way/:id/full", :controller => 'way', :action => 'full', :id => /\d+/
23   map.connect "api/#{API_VERSION}/way/:id", :controller => 'way', :action => 'read', :id => /\d+/, :conditions => { :method => :get }
24   map.connect "api/#{API_VERSION}/way/:id", :controller => 'way', :action => 'update', :id => /\d+/, :conditions => { :method => :put }
25   map.connect "api/#{API_VERSION}/way/:id", :controller => 'way', :action => 'delete', :id => /\d+/, :conditions => { :method => :delete }
26   map.connect "api/#{API_VERSION}/ways", :controller => 'way', :action => 'ways', :id => nil
27
28   map.connect "api/#{API_VERSION}/map", :controller => 'api', :action => 'map'
29   
30   map.connect "api/#{API_VERSION}/trackpoints", :controller => 'api', :action => 'trackpoints'
31   
32   map.connect "api/#{API_VERSION}/search", :controller => 'search', :action => 'search_all'
33   map.connect "api/#{API_VERSION}/way/search", :controller => 'search', :action => 'search_ways'
34   map.connect "api/#{API_VERSION}/segment/search", :controller => 'search', :action => 'search_segments'
35   map.connect "api/#{API_VERSION}/nodes/search", :controller => 'search', :action => 'search_nodes'
36   
37   map.connect "api/#{API_VERSION}/user/details", :controller => 'user', :action => 'api_details'
38   map.connect "api/#{API_VERSION}/user/gpx_files", :controller => 'user', :action => 'api_gpx_files'
39  
40   map.connect "api/#{API_VERSION}/gpx/create/:filename/:description/:tags", :controller => 'trace', :action => 'api_create'
41   map.connect "api/#{API_VERSION}/gpx/:id/details", :controller => 'trace', :action => 'api_details'
42   map.connect "api/#{API_VERSION}/gpx/:id/data", :controller => 'trace', :action => 'api_data'
43   
44   # Potlatch API
45   
46   map.connect "api/#{API_VERSION}/amf", :controller =>'amf', :action =>'talk'
47   map.connect "api/#{API_VERSION}/swf/trackpoints", :controller =>'swf', :action =>'trackpoints'
48   
49   # web site
50
51   map.connect '/', :controller => 'site', :action => 'index'
52   map.connect '/user/save', :controller => 'user', :action => 'save'
53   map.connect '/user/confirm', :controller => 'user', :action => 'confirm'
54   map.connect '/user/go_public', :controller => 'user', :action => 'go_public'
55   map.connect '/user/reset_password', :controller => 'user', :action => 'reset_password'
56   map.connect '/index.html', :controller => 'site', :action => 'index'
57   map.connect '/edit.html', :controller => 'site', :action => 'edit'
58   map.connect '/search.html', :controller => 'way_tag', :action => 'search'
59   map.connect '/login.html', :controller => 'user', :action => 'login'
60   map.connect '/logout.html', :controller => 'user', :action => 'logout'
61   map.connect '/create-account.html', :controller => 'user', :action => 'new'
62   map.connect '/forgot-password.html', :controller => 'user', :action => 'lost_password'
63
64   # traces  
65   map.connect '/traces', :controller => 'trace', :action => 'list'
66   map.connect '/traces/page/:page', :controller => 'trace', :action => 'list'
67   map.connect '/traces/mine', :controller => 'trace', :action => 'mine'
68   map.connect '/trace/create', :controller => 'trace', :action => 'create'
69   map.connect '/traces/mine/page/:page', :controller => 'trace', :action => 'mine'
70   map.connect '/traces/mine/tag/:tag', :controller => 'trace', :action => 'mine'
71   map.connect '/traces/mine/tag/:tag/page/:page', :controller => 'trace', :action => 'mine'
72   map.connect '/traces/rss', :controller => 'trace', :action => 'georss'
73   map.connect '/user/:display_name/traces', :controller => 'trace', :action => 'list', :id => nil
74   map.connect '/user/:display_name/traces/page/:page', :controller => 'trace', :action => 'list', :id => nil
75   map.connect '/user/:display_name/traces/:id', :controller => 'trace', :action => 'view', :id => nil
76   map.connect '/user/:display_name/traces/:id/picture', :controller => 'trace', :action => 'picture', :id => nil
77   map.connect '/user/:display_name/traces/:id/icon', :controller => 'trace', :action => 'icon', :id => nil
78   map.connect '/traces/tag/:tag', :controller => 'trace', :action => 'list', :id => nil
79   map.connect '/traces/tag/:tag/page/:page', :controller => 'trace', :action => 'list', :id => nil
80
81   # user pages
82   map.connect '/user/:display_name/make_friend', :controller => 'user', :action => 'make_friend'
83   map.connect '/user/:display_name', :controller => 'user', :action => 'view'
84   map.connect '/user/:display_name/diary', :controller => 'diary_entry', :action => 'list'
85   map.connect '/user/:display_name/diary/:id', :controller => 'diary_entry', :action => 'list', :id => /\d+/
86   map.connect '/user/:display_name/diary/rss', :controller => 'diary_entry', :action => 'rss'
87   map.connect '/user/:display_name/diary/newpost', :controller => 'diary_entry', :action => 'new'
88   map.connect '/user/:display_name/account', :controller => 'user', :action => 'account'
89   map.connect '/user/:display_name/set_home', :controller => 'user', :action => 'set_home'
90   map.connect '/diary', :controller => 'diary_entry', :action => 'list'
91   map.connect '/diary/rss', :controller => 'diary_entry', :action => 'rss'
92   map.connect '/diary/:language', :controller => 'diary_entry', :action => 'list'
93   map.connect '/diary/:language/rss', :controller => 'diary_entry', :action => 'rss'
94
95   # test pages
96   map.connect '/test/populate/:table/:from/:count', :controller => 'test', :action => 'populate'
97   map.connect '/test/populate/:table/:count', :controller => 'test', :action => 'populate', :from => 1
98
99   # geocoder
100   map.connect '/geocoder/search/', :controller => 'geocoder', :action => 'search'
101   map.connect '/geocoder/results/', :controller => 'geocoder', :action => 'results'
102   map.connect '/postcode/:postcode/', :controller => 'geocoder', :action => 'search'
103
104   # messages
105
106   map.connect '/user/:display_name/inbox', :controller => 'message', :action => 'inbox'
107   map.connect '/message/new/:user_id', :controller => 'message', :action => 'new'
108   map.connect '/message/read/:message_id', :controller => 'message', :action => 'read'
109   map.connect '/message/mark/:message_id', :controller => 'message', :action => 'mark'
110   
111   # fall through
112      map.connect ':controller/:id/:action'
113   map.connect ':controller/:action'
114 end