- map.root :controller => 'site', :action => 'index'
- map.connect '/', :controller => 'site', :action => 'index'
- map.connect '/edit', :controller => 'site', :action => 'edit'
- map.connect '/history', :controller => 'changeset', :action => 'list_bbox'
- map.connect '/export', :controller => 'site', :action => 'export'
- map.connect '/login', :controller => 'user', :action => 'login'
- map.connect '/logout', :controller => 'user', :action => 'logout'
- map.connect '/offline', :controller => 'site', :action => 'offline'
- map.connect '/user/new', :controller => 'user', :action => 'new'
- map.connect '/user/save', :controller => 'user', :action => 'save'
- map.connect '/user/confirm', :controller => 'user', :action => 'confirm'
- map.connect '/user/confirm-email', :controller => 'user', :action => 'confirm_email'
- map.connect '/user/go_public', :controller => 'user', :action => 'go_public'
- map.connect '/user/reset-password', :controller => 'user', :action => 'reset_password'
- map.connect '/user/upload-image', :controller => 'user', :action => 'upload_image'
- map.connect '/user/delete-image', :controller => 'user', :action => 'delete_image'
- map.connect '/user/forgot-password', :controller => 'user', :action => 'lost_password'
-
- map.connect '/index.html', :controller => 'site', :action => 'index'
- map.connect '/edit.html', :controller => 'site', :action => 'edit'
- map.connect '/history.html', :controller => 'changeset', :action => 'list_bbox'
- map.connect '/export.html', :controller => 'site', :action => 'export'
- map.connect '/search.html', :controller => 'way_tag', :action => 'search'
- map.connect '/login.html', :controller => 'user', :action => 'login'
- map.connect '/logout.html', :controller => 'user', :action => 'logout'
- map.connect '/create-account.html', :controller => 'user', :action => 'new'
- map.connect '/forgot-password.html', :controller => 'user', :action => 'lost_password'
-
- # traces
- map.connect '/traces', :controller => 'trace', :action => 'list'
- map.connect '/traces/page/:page', :controller => 'trace', :action => 'list'
- map.connect '/traces/rss', :controller => 'trace', :action => 'georss'
- map.connect '/traces/tag/:tag', :controller => 'trace', :action => 'list'
- map.connect '/traces/tag/:tag/page/:page', :controller => 'trace', :action => 'list'
- map.connect '/traces/tag/:tag/rss', :controller => 'trace', :action => 'georss'
- map.connect '/traces/mine', :controller => 'trace', :action => 'mine'
- map.connect '/traces/mine/page/:page', :controller => 'trace', :action => 'mine'
- map.connect '/traces/mine/tag/:tag', :controller => 'trace', :action => 'mine'
- map.connect '/traces/mine/tag/:tag/page/:page', :controller => 'trace', :action => 'mine'
- map.connect '/trace/create', :controller => 'trace', :action => 'create'
- map.connect '/trace/:id/data', :controller => 'trace', :action => 'data'
- map.connect '/trace/:id/data.:format', :controller => 'trace', :action => 'data'
- map.connect '/trace/:id/edit', :controller => 'trace', :action => 'edit'
- map.connect '/trace/:id/delete', :controller => 'trace', :action => 'delete'
- map.connect '/trace/:id/make_public', :controller => 'trace', :action => 'make_public'
- map.connect '/user/:display_name/traces', :controller => 'trace', :action => 'list'
- map.connect '/user/:display_name/traces/page/:page', :controller => 'trace', :action => 'list'
- map.connect '/user/:display_name/traces/rss', :controller => 'trace', :action => 'georss'
- map.connect '/user/:display_name/traces/tag/:tag', :controller => 'trace', :action => 'list'
- map.connect '/user/:display_name/traces/tag/:tag/page/:page', :controller => 'trace', :action => 'list'
- map.connect '/user/:display_name/traces/tag/:tag/rss', :controller => 'trace', :action => 'georss'
- map.connect '/user/:display_name/traces/:id', :controller => 'trace', :action => 'view'
- map.connect '/user/:display_name/traces/:id/picture', :controller => 'trace', :action => 'picture'
- map.connect '/user/:display_name/traces/:id/icon', :controller => 'trace', :action => 'icon'
+ root :to => 'site#index', :via => [:get, :post]
+ match '/edit' => 'site#edit', :via => :get, :as => :edit
+ match '/copyright/:copyright_locale' => 'site#copyright', :via => :get
+ match '/copyright' => 'site#copyright', :via => :get
+ match '/welcome' => 'site#welcome', :via => :get, :as => :welcome
+ match '/fixthemap' => 'site#fixthemap', :via => :get, :as => :fixthemap
+ match '/help' => 'site#help', :via => :get, :as => :help
+ match '/about' => 'site#about', :via => :get, :as => :about
+ match '/history' => 'changeset#list', :via => :get
+ match '/history/feed' => 'changeset#feed', :via => :get, :defaults => { :format => :atom }
+ match '/export' => 'site#export', :via => :get
+ match '/login' => 'user#login', :via => [:get, :post]
+ match '/logout' => 'user#logout', :via => [:get, :post]
+ match '/offline' => 'site#offline', :via => :get
+ match '/key' => 'site#key', :via => :get
+ match '/id' => 'site#id', :via => :get
+ match '/user/new' => 'user#new', :via => :get
+ match '/user/new' => 'user#create', :via => :post
+ match '/user/terms' => 'user#terms', :via => :get
+ match '/user/save' => 'user#save', :via => :post
+ match '/user/:display_name/confirm/resend' => 'user#confirm_resend', :via => :get
+ match '/user/:display_name/confirm' => 'user#confirm', :via => [:get, :post]
+ match '/user/confirm' => 'user#confirm', :via => [:get, :post]
+ match '/user/confirm-email' => 'user#confirm_email', :via => [:get, :post]
+ match '/user/go_public' => 'user#go_public', :via => :post
+ match '/user/reset-password' => 'user#reset_password', :via => [:get, :post]
+ match '/user/forgot-password' => 'user#lost_password', :via => [:get, :post]
+ match '/user/suspended' => 'user#suspended', :via => :get
+
+ get '/index.html', :to => redirect(:path => "/")
+ get '/create-account.html', :to => redirect(:path => "/user/new")
+ get '/forgot-password.html', :to => redirect(:path => "/user/forgot-password")
+
+ # permalink
+ match '/go/:code' => 'site#permalink', :via => :get, :code => /[a-zA-Z0-9_@~]+[=-]*/
+
+ # rich text preview
+ match '/preview/:format' => 'site#preview', :via => :post, :as => :preview
+
+ # traces
+ match '/user/:display_name/traces/tag/:tag/page/:page' => 'trace#list', :via => :get
+ match '/user/:display_name/traces/tag/:tag' => 'trace#list', :via => :get
+ match '/user/:display_name/traces/page/:page' => 'trace#list', :via => :get
+ match '/user/:display_name/traces' => 'trace#list', :via => :get
+ match '/user/:display_name/traces/tag/:tag/rss' => 'trace#georss', :via => :get, :defaults => { :format => :rss }
+ match '/user/:display_name/traces/rss' => 'trace#georss', :via => :get, :defaults => { :format => :rss }
+ match '/user/:display_name/traces/:id' => 'trace#view', :via => :get
+ match '/user/:display_name/traces/:id/picture' => 'trace#picture', :via => :get
+ match '/user/:display_name/traces/:id/icon' => 'trace#icon', :via => :get
+ match '/traces/tag/:tag/page/:page' => 'trace#list', :via => :get
+ match '/traces/tag/:tag' => 'trace#list', :via => :get
+ match '/traces/page/:page' => 'trace#list', :via => :get
+ match '/traces' => 'trace#list', :via => :get
+ match '/traces/tag/:tag/rss' => 'trace#georss', :via => :get, :defaults => { :format => :rss }
+ match '/traces/rss' => 'trace#georss', :via => :get, :defaults => { :format => :rss }
+ match '/traces/mine/tag/:tag/page/:page' => 'trace#mine', :via => :get
+ match '/traces/mine/tag/:tag' => 'trace#mine', :via => :get
+ match '/traces/mine/page/:page' => 'trace#mine', :via => :get
+ match '/traces/mine' => 'trace#mine', :via => :get
+ match '/trace/create' => 'trace#create', :via => [:get, :post]
+ match '/trace/:id/data' => 'trace#data', :via => :get, :id => /\d+/
+ match '/trace/:id/edit' => 'trace#edit', :via => [:get, :post, :patch], :id => /\d+/, :as => "trace_edit"
+ match '/trace/:id/delete' => 'trace#delete', :via => :post, :id => /\d+/
+
+ # diary pages
+ match '/diary/new' => 'diary_entry#new', :via => [:get, :post]
+ match '/diary/friends' => 'diary_entry#list', :friends => true, :via => :get, :as => "friend_diaries"
+ match '/diary/nearby' => 'diary_entry#list', :nearby => true, :via => :get, :as => "nearby_diaries"
+ match '/user/:display_name/diary/rss' => 'diary_entry#rss', :via => :get, :defaults => { :format => :rss }
+ match '/diary/:language/rss' => 'diary_entry#rss', :via => :get, :defaults => { :format => :rss }
+ match '/diary/rss' => 'diary_entry#rss', :via => :get, :defaults => { :format => :rss }
+ match '/user/:display_name/diary/comments/:page' => 'diary_entry#comments', :via => :get, :page => /\d+/
+ match '/user/:display_name/diary/comments/' => 'diary_entry#comments', :via => :get
+ match '/user/:display_name/diary' => 'diary_entry#list', :via => :get
+ match '/diary/:language' => 'diary_entry#list', :via => :get
+ match '/diary' => 'diary_entry#list', :via => :get
+ match '/user/:display_name/diary/:id' => 'diary_entry#view', :via => :get, :id => /\d+/
+ match '/user/:display_name/diary/:id/newcomment' => 'diary_entry#comment', :via => :post, :id => /\d+/
+ match '/user/:display_name/diary/:id/edit' => 'diary_entry#edit', :via => [:get, :post], :id => /\d+/
+ match '/user/:display_name/diary/:id/hide' => 'diary_entry#hide', :via => :post, :id => /\d+/, :as => :hide_diary_entry
+ match '/user/:display_name/diary/:id/hidecomment/:comment' => 'diary_entry#hidecomment', :via => :post, :id => /\d+/, :comment => /\d+/, :as => :hide_diary_comment