]> git.openstreetmap.org Git - rails.git/blob - config/routes.rb
Make the location of the GPX traces configurable.
[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/ways", :controller => 'way', :action => 'ways_for_node', :id => /\d+/
6   map.connect "api/#{API_VERSION}/node/:id/relations", :controller => 'relation', :action => 'relations_for_node', :id => /\d+/
7   map.connect "api/#{API_VERSION}/node/:id/history", :controller => 'old_node', :action => 'history', :id => /\d+/
8   map.connect "api/#{API_VERSION}/node/:id", :controller => 'node', :action => 'read', :id => /\d+/, :conditions => { :method => :get }
9   map.connect "api/#{API_VERSION}/node/:id", :controller => 'node', :action => 'update', :id => /\d+/, :conditions => { :method => :put }
10   map.connect "api/#{API_VERSION}/node/:id", :controller => 'node', :action => 'delete', :id => /\d+/, :conditions => { :method => :delete }
11   map.connect "api/#{API_VERSION}/nodes", :controller => 'node', :action => 'nodes', :id => nil
12   
13   map.connect "api/#{API_VERSION}/way/create", :controller => 'way', :action => 'create'
14   map.connect "api/#{API_VERSION}/way/:id/history", :controller => 'old_way', :action => 'history', :id => /\d+/
15   map.connect "api/#{API_VERSION}/way/:id/full", :controller => 'way', :action => 'full', :id => /\d+/
16   map.connect "api/#{API_VERSION}/way/:id/relations", :controller => 'relation', :action => 'relations_for_way', :id => /\d+/
17   map.connect "api/#{API_VERSION}/way/:id", :controller => 'way', :action => 'read', :id => /\d+/, :conditions => { :method => :get }
18   map.connect "api/#{API_VERSION}/way/:id", :controller => 'way', :action => 'update', :id => /\d+/, :conditions => { :method => :put }
19   map.connect "api/#{API_VERSION}/way/:id", :controller => 'way', :action => 'delete', :id => /\d+/, :conditions => { :method => :delete }
20   map.connect "api/#{API_VERSION}/ways", :controller => 'way', :action => 'ways', :id => nil
21
22   map.connect "api/#{API_VERSION}/capabilities", :controller => 'api', :action => 'capabilities'
23   map.connect "api/#{API_VERSION}/relation/create", :controller => 'relation', :action => 'create'
24   map.connect "api/#{API_VERSION}/relation/:id/relations", :controller => 'relation', :action => 'relations_for_relation', :id => /\d+/
25   map.connect "api/#{API_VERSION}/relation/:id/history", :controller => 'old_relation', :action => 'history', :id => /\d+/
26   map.connect "api/#{API_VERSION}/relation/:id/full", :controller => 'relation', :action => 'full', :id => /\d+/
27   map.connect "api/#{API_VERSION}/relation/:id", :controller => 'relation', :action => 'read', :id => /\d+/, :conditions => { :method => :get }
28   map.connect "api/#{API_VERSION}/relation/:id", :controller => 'relation', :action => 'update', :id => /\d+/, :conditions => { :method => :put }
29   map.connect "api/#{API_VERSION}/relation/:id", :controller => 'relation', :action => 'delete', :id => /\d+/, :conditions => { :method => :delete }
30   map.connect "api/#{API_VERSION}/relations", :controller => 'relation', :action => 'relations', :id => nil
31
32   map.connect "api/#{API_VERSION}/map", :controller => 'api', :action => 'map'
33   
34   map.connect "api/#{API_VERSION}/trackpoints", :controller => 'api', :action => 'trackpoints'
35
36   map.connect "api/#{API_VERSION}/changes", :controller => 'api', :action => 'changes'
37   
38   map.connect "api/#{API_VERSION}/search", :controller => 'search', :action => 'search_all'
39   map.connect "api/#{API_VERSION}/ways/search", :controller => 'search', :action => 'search_ways'
40   map.connect "api/#{API_VERSION}/relations/search", :controller => 'search', :action => 'search_relations'
41   map.connect "api/#{API_VERSION}/nodes/search", :controller => 'search', :action => 'search_nodes'
42   
43   map.connect "api/#{API_VERSION}/user/details", :controller => 'user', :action => 'api_details'
44   map.connect "api/#{API_VERSION}/user/preferences", :controller => 'user_preference', :action => 'read', :conditions => { :method => :get }
45   map.connect "api/#{API_VERSION}/user/preferences/:preference_key", :controller => 'user_preference', :action => 'read_one', :conditions => { :method => :get }
46   map.connect "api/#{API_VERSION}/user/preferences", :controller => 'user_preference', :action => 'update', :conditions => { :method => :put }
47   map.connect "api/#{API_VERSION}/user/preferences/:preference_key", :controller => 'user_preference', :action => 'update_one', :conditions => { :method => :put }
48   map.connect "api/#{API_VERSION}/user/preferences/:preference_key", :controller => 'user_preference', :action => 'delete_one', :conditions => { :method => :delete }
49   map.connect "api/#{API_VERSION}/user/gpx_files", :controller => 'user', :action => 'api_gpx_files'
50  
51   map.connect "api/#{API_VERSION}/gpx/create", :controller => 'trace', :action => 'api_create'
52   map.connect "api/#{API_VERSION}/gpx/:id/details", :controller => 'trace', :action => 'api_details'
53   map.connect "api/#{API_VERSION}/gpx/:id/data", :controller => 'trace', :action => 'api_data'
54   
55   # Potlatch API
56   
57   map.connect "api/#{API_VERSION}/amf", :controller =>'amf', :action =>'talk'
58   map.connect "api/#{API_VERSION}/swf/trackpoints", :controller =>'swf', :action =>'trackpoints'
59   
60   # Data browsing
61   map.connect '/browse', :controller => 'browse', :action => 'index'
62   map.connect '/browse/start', :controller => 'browse', :action => 'start'
63   map.connect '/browse/way/:id', :controller => 'browse', :action => 'way', :id => /\d+/
64   map.connect '/browse/way/:id/history', :controller => 'browse', :action => 'way_history', :id => /\d+/
65   map.connect '/browse/node/:id', :controller => 'browse', :action => 'node', :id => /\d+/
66   map.connect '/browse/node/:id/history', :controller => 'browse', :action => 'node_history', :id => /\d+/
67   map.connect '/browse/relation/:id', :controller => 'browse', :action => 'relation', :id => /\d+/
68   map.connect '/browse/relation/:id/history', :controller => 'browse', :action => 'relation_history', :id => /\d+/
69   
70   # web site
71
72   map.connect '/', :controller => 'site', :action => 'index'
73   map.connect '/edit', :controller => 'site', :action => 'edit'
74   map.connect '/export', :controller => 'site', :action => 'export'
75   map.connect '/login', :controller => 'user', :action => 'login'
76   map.connect '/logout', :controller => 'user', :action => 'logout'
77   map.connect '/offline', :controller => 'site', :action => 'offline'
78   map.connect '/user/new', :controller => 'user', :action => 'new'
79   map.connect '/user/save', :controller => 'user', :action => 'save'
80   map.connect '/user/confirm', :controller => 'user', :action => 'confirm'
81   map.connect '/user/go_public', :controller => 'user', :action => 'go_public'
82   map.connect '/user/reset-password', :controller => 'user', :action => 'reset_password'
83   map.connect '/user/upload-image', :controller => 'user', :action => 'upload_image'
84   map.connect '/user/delete-image', :controller => 'user', :action => 'delete_image'
85   map.connect '/user/forgot-password', :controller => 'user', :action => 'lost_password'
86
87   map.connect '/index.html', :controller => 'site', :action => 'index'
88   map.connect '/edit.html', :controller => 'site', :action => 'edit'
89   map.connect '/export.html', :controller => 'site', :action => 'export'
90   map.connect '/search.html', :controller => 'way_tag', :action => 'search'
91   map.connect '/login.html', :controller => 'user', :action => 'login'
92   map.connect '/logout.html', :controller => 'user', :action => 'logout'
93   map.connect '/create-account.html', :controller => 'user', :action => 'new'
94   map.connect '/forgot-password.html', :controller => 'user', :action => 'lost_password'
95
96   # traces  
97   map.connect '/traces', :controller => 'trace', :action => 'list'
98   map.connect '/traces/page/:page', :controller => 'trace', :action => 'list'
99   map.connect '/traces/rss', :controller => 'trace', :action => 'georss'
100   map.connect '/traces/tag/:tag', :controller => 'trace', :action => 'list'
101   map.connect '/traces/tag/:tag/page/:page', :controller => 'trace', :action => 'list'
102   map.connect '/traces/tag/:tag/rss', :controller => 'trace', :action => 'georss'
103   map.connect '/traces/mine', :controller => 'trace', :action => 'mine'
104   map.connect '/traces/mine/page/:page', :controller => 'trace', :action => 'mine'
105   map.connect '/traces/mine/tag/:tag', :controller => 'trace', :action => 'mine'
106   map.connect '/traces/mine/tag/:tag/page/:page', :controller => 'trace', :action => 'mine'
107   map.connect '/trace/create', :controller => 'trace', :action => 'create'
108   map.connect '/trace/:id/data', :controller => 'trace', :action => 'data'
109   map.connect '/trace/:id/data.:format', :controller => 'trace', :action => 'data'
110   map.connect '/trace/:id/edit', :controller => 'trace', :action => 'edit'
111   map.connect '/trace/:id/delete', :controller => 'trace', :action => 'delete'
112   map.connect '/trace/:id/make_public', :controller => 'trace', :action => 'make_public'
113   map.connect '/user/:display_name/traces', :controller => 'trace', :action => 'list'
114   map.connect '/user/:display_name/traces/page/:page', :controller => 'trace', :action => 'list'
115   map.connect '/user/:display_name/traces/rss', :controller => 'trace', :action => 'georss'
116   map.connect '/user/:display_name/traces/tag/:tag', :controller => 'trace', :action => 'list'
117   map.connect '/user/:display_name/traces/tag/:tag/page/:page', :controller => 'trace', :action => 'list'
118   map.connect '/user/:display_name/traces/tag/:tag/rss', :controller => 'trace', :action => 'georss'
119   map.connect '/user/:display_name/traces/:id', :controller => 'trace', :action => 'view'
120   map.connect '/user/:display_name/traces/:id/picture', :controller => 'trace', :action => 'picture'
121   map.connect '/user/:display_name/traces/:id/icon', :controller => 'trace', :action => 'icon'
122
123   # user pages
124   map.connect '/user/:display_name', :controller => 'user', :action => 'view'
125   map.connect '/user/:display_name/make_friend', :controller => 'user', :action => 'make_friend'
126   map.connect '/user/:display_name/remove_friend', :controller => 'user', :action => 'remove_friend'
127   map.connect '/user/:display_name/diary', :controller => 'diary_entry', :action => 'list'
128   map.connect '/user/:display_name/diary/:id', :controller => 'diary_entry', :action => 'view', :id => /\d+/
129   map.connect '/user/:display_name/diary/:id/newcomment', :controller => 'diary_entry', :action => 'comment', :id => /\d+/
130   map.connect '/user/:display_name/diary/rss', :controller => 'diary_entry', :action => 'rss'
131   map.connect '/user/:display_name/diary/newpost', :controller => 'diary_entry', :action => 'new'
132   map.connect '/user/:display_name/account', :controller => 'user', :action => 'account'
133   map.connect '/user/:display_name/set_home', :controller => 'user', :action => 'set_home'
134   map.connect '/diary', :controller => 'diary_entry', :action => 'list'
135   map.connect '/diary/rss', :controller => 'diary_entry', :action => 'rss'
136   map.connect '/diary/:language', :controller => 'diary_entry', :action => 'list'
137   map.connect '/diary/:language/rss', :controller => 'diary_entry', :action => 'rss'
138
139   # test pages
140   map.connect '/test/populate/:table/:from/:count', :controller => 'test', :action => 'populate'
141   map.connect '/test/populate/:table/:count', :controller => 'test', :action => 'populate', :from => 1
142
143   # geocoder
144   map.connect '/geocoder/search', :controller => 'geocoder', :action => 'search'
145   map.connect '/geocoder/description', :controller => 'geocoder', :action => 'description'
146
147   # export
148   map.connect '/export/start', :controller => 'export', :action => 'start'
149   map.connect '/export/finish', :controller => 'export', :action => 'finish'
150
151   # messages
152
153   map.connect '/user/:display_name/inbox', :controller => 'message', :action => 'inbox'
154   map.connect '/user/:display_name/outbox', :controller => 'message', :action => 'outbox'
155   map.connect '/message/new/:user_id', :controller => 'message', :action => 'new'
156   map.connect '/message/read/:message_id', :controller => 'message', :action => 'read'
157   map.connect '/message/mark/:message_id', :controller => 'message', :action => 'mark'
158   map.connect '/message/reply/:message_id', :controller => 'message', :action => 'reply'
159
160   # fall through
161   map.connect ':controller/:id/:action'
162   map.connect ':controller/:action'
163 end