put "relation/:id" => "relations#update", :id => /\d+/
delete "relation/:id" => "relations#delete", :id => /\d+/
get "relations" => "relations#index"
-
- get "map" => "map#index"
-
- get "trackpoints" => "tracepoints#index"
end
namespace :api, :path => "api/0.6" do
+ resource :map, :only => :show
+
+ resources :tracepoints, :path => "trackpoints", :only => :index
+
resources :users, :only => :index
resources :users, :path => "user", :id => /\d+/, :only => :show
resources :user_traces, :path => "user/gpx_files", :module => :users, :controller => :traces, :only => :index
get "/relation/:id" => "relations#show", :id => /\d+/, :as => :relation
get "/relation/:id/history" => "old_relations#index", :id => /\d+/, :as => :relation_history
resources :old_relations, :path => "/relation/:id/history", :id => /\d+/, :version => /\d+/, :param => :version, :only => :show
- resources :changesets, :path => "changeset", :id => /\d+/, :only => :show do
- match :subscribe, :on => :member, :via => [:get, :post]
- match :unsubscribe, :on => :member, :via => [:get, :post]
+ resources :changesets, :path => "changeset", :id => /\d+/, :only => :show do
+ resource :subscription, :controller => :changeset_subscriptions, :only => [:show, :create, :destroy]
namespace :changeset_comments, :as => :comments, :path => :comments do
resource :feed, :only => :show, :defaults => { :format => "rss" }
end
end
+ get "/changeset/:id/subscribe", :id => /\d+/, :to => redirect(:path => "/changeset/%{id}/subscription")
+ get "/changeset/:id/unsubscribe", :id => /\d+/, :to => redirect(:path => "/changeset/%{id}/subscription")
+
resources :notes, :path => "note", :id => /\d+/, :only => [:show, :new]
get "/user/:display_name/history" => "changesets#index"
post "/preview/:type" => "site#preview", :as => :preview
# traces
- resources :traces, :except => [:show]
+ resources :traces, :id => /\d+/, :except => [:show] do
+ resource :data, :module => :traces, :only => :show
+ end
get "/user/:display_name/traces/tag/:tag/page/:page", :page => /[1-9][0-9]*/, :to => redirect(:path => "/user/%{display_name}/traces/tag/%{tag}")
get "/user/:display_name/traces/tag/:tag" => "traces#index"
get "/user/:display_name/traces/page/:page", :page => /[1-9][0-9]*/, :to => redirect(:path => "/user/%{display_name}/traces")
get "/user/:display_name/traces" => "traces#index"
- get "/user/:display_name/traces/tag/:tag/rss" => "traces#georss", :defaults => { :format => :rss }
- get "/user/:display_name/traces/rss" => "traces#georss", :defaults => { :format => :rss }
- get "/user/:display_name/traces/:id" => "traces#show", :as => "show_trace"
- scope "/user/:display_name/traces/:trace_id", :module => :traces do
+ get "/user/:display_name/traces/:id" => "traces#show", :id => /\d+/, :as => "show_trace"
+ scope "/user/:display_name/traces/:trace_id", :module => :traces, :trace_id => /\d+/ do
get "picture" => "pictures#show", :as => "trace_picture"
get "icon" => "icons#show", :as => "trace_icon"
end
get "/traces/tag/:tag/page/:page", :page => /[1-9][0-9]*/, :to => redirect(:path => "/traces/tag/%{tag}")
get "/traces/tag/:tag" => "traces#index"
get "/traces/page/:page", :page => /[1-9][0-9]*/, :to => redirect(:path => "/traces")
- get "/traces/tag/:tag/rss" => "traces#georss", :defaults => { :format => :rss }
- get "/traces/rss" => "traces#georss", :defaults => { :format => :rss }
get "/traces/mine/tag/:tag/page/:page", :page => /[1-9][0-9]*/, :to => redirect(:path => "/traces/mine/tag/%{tag}")
get "/traces/mine/tag/:tag" => "traces#mine"
get "/traces/mine/page/:page", :page => /[1-9][0-9]*/, :to => redirect(:path => "/traces/mine")
get "/traces/mine" => "traces#mine"
get "/trace/create", :to => redirect(:path => "/traces/new")
- get "/trace/:id/data" => "traces#data", :id => /\d+/, :as => "trace_data"
- get "/trace/:id/edit", :to => redirect(:path => "/traces/%{id}/edit")
+ get "/trace/:id/data", :format => false, :id => /\d+/, :to => redirect(:path => "/traces/%{id}/data")
+ get "/trace/:id/data.:format", :id => /\d+/, :to => redirect(:path => "/traces/%{id}/data.%{format}")
+ get "/trace/:id/edit", :id => /\d+/, :to => redirect(:path => "/traces/%{id}/edit")
+
+ namespace :traces, :path => "" do
+ resource :feed, :path => "(/user/:display_name)/traces(/tag/:tag)/rss", :only => :show, :defaults => { :format => :rss }
+ end
# diary pages
resources :diary_entries, :path => "diary", :only => [:new, :create, :index] do
get "/user/:display_name/diary/rss" => "diary_entries#rss", :defaults => { :format => :rss }
get "/diary/:language/rss" => "diary_entries#rss", :defaults => { :format => :rss }
get "/diary/rss" => "diary_entries#rss", :defaults => { :format => :rss }
- get "/user/:display_name/diary/comments/:page", :page => /[1-9][0-9]*/, :to => redirect(:path => "/user/%{display_name}/diary/comments")
- get "/user/:display_name/diary/comments" => "diary_comments#index", :as => :diary_comments
get "/user/:display_name/diary" => "diary_entries#index"
get "/diary/:language" => "diary_entries#index"
scope "/user/:display_name" do
resources :users, :path => "user", :param => :display_name, :only => [:new, :create, :show] do
resource :role, :controller => "user_roles", :path => "roles/:role", :only => [:create, :destroy]
scope :module => :users do
+ resources :diary_comments, :only => :index
+ resources :changeset_comments, :only => :index
resource :issued_blocks, :path => "blocks_by", :only => :show
resource :received_blocks, :path => "blocks", :only => [:show, :edit, :destroy]
resource :status, :only => :update
end
end
get "/user/:display_name/account", :to => redirect(:path => "/account/edit")
+ get "/user/:display_name/diary/comments(/:page)", :page => /[1-9][0-9]*/, :to => redirect(:path => "/user/%{display_name}/diary_comments")
resource :account, :only => [:edit, :update, :destroy] do
scope :module => :accounts do
# messages
resources :messages, :path_names => { :new => "new/:display_name" }, :id => /\d+/, :only => [:new, :create, :show, :destroy] do
- post :mark
- patch :unmute
-
- resource :reply, :module => :messages, :path_names => { :new => "new" }, :only => :new
+ scope :module => :messages do
+ resource :reply, :path_names => { :new => "new" }, :only => :new
+ resource :read_mark, :only => [:create, :destroy]
+ resource :mute, :only => :destroy
+ end
end
namespace :messages, :path => "/messages" do
resource :inbox, :only => :show