2012-01-30 20:39:34 +00:00
|
|
|
# -*- encoding : utf-8 -*-
|
2011-03-09 13:13:36 +00:00
|
|
|
Rosa::Application.routes.draw do
|
2012-01-11 18:15:35 +00:00
|
|
|
|
2012-02-08 14:01:00 +00:00
|
|
|
devise_scope :user do
|
2011-10-11 21:56:51 +01:00
|
|
|
get '/users/auth/:provider' => 'users/omniauth_callbacks#passthru'
|
2012-03-20 18:11:28 +00:00
|
|
|
get '/user' => 'users#profile', :as => :edit_profile
|
|
|
|
put '/user' => 'users#update', :as => :update_profile
|
|
|
|
get '/users' => 'admin/users#index', :as => :users
|
|
|
|
get '/users/new' => 'admin/users#new', :as => :new_user
|
|
|
|
get '/users/list' => 'admin/users#list', :as => :users_list
|
2012-03-26 15:49:00 +01:00
|
|
|
post '/users/create' => 'admin/users#create', :as => :create_user
|
2012-03-20 18:11:28 +00:00
|
|
|
get '/users/:id/edit' => 'admin/users#profile', :as => :edit_user
|
|
|
|
put '/users/:id/edit' => 'admin/users#update', :as => :update_user
|
2012-03-20 20:06:51 +00:00
|
|
|
delete '/users/:id/delete' => 'admin/users#destroy', :as => :delete_user
|
2011-10-11 21:56:51 +01:00
|
|
|
end
|
2012-02-08 14:01:00 +00:00
|
|
|
devise_for :users, :controllers => {:omniauth_callbacks => 'users/omniauth_callbacks'}
|
2012-01-11 18:15:35 +00:00
|
|
|
|
2012-03-20 18:11:28 +00:00
|
|
|
resources :users, :only => [:show, :profile, :update] do
|
2011-11-30 15:27:19 +00:00
|
|
|
resources :groups, :only => [:new, :create, :index]
|
2012-02-09 17:46:23 +00:00
|
|
|
collection do
|
|
|
|
resources :register_requests, :only => [:index, :new, :create, :show_message, :approve, :reject] do
|
|
|
|
get :show_message, :on => :collection
|
2012-02-09 22:55:28 +00:00
|
|
|
put :update, :on => :collection
|
2012-02-09 17:46:23 +00:00
|
|
|
get :approve
|
|
|
|
get :reject
|
|
|
|
end
|
|
|
|
get :autocomplete_user_uname
|
|
|
|
end
|
|
|
|
|
2012-01-11 13:58:13 +00:00
|
|
|
namespace :settings do
|
|
|
|
resource :notifier, :only => [:show, :update]
|
|
|
|
end
|
2012-03-20 18:11:28 +00:00
|
|
|
resources :platforms, :only => [:new, :create]
|
2011-11-30 15:27:19 +00:00
|
|
|
end
|
2012-03-03 16:03:23 +00:00
|
|
|
match 'users/:id/settings/private' => 'users#private', :as => :user_private_settings, :via => :get
|
|
|
|
match 'users/:id/settings/private' => 'users#private', :as => :user_private_settings, :via => :put
|
2011-10-21 16:39:32 +01:00
|
|
|
|
2011-10-14 21:45:58 +01:00
|
|
|
resources :event_logs, :only => :index
|
2011-03-09 16:16:48 +00:00
|
|
|
|
2011-10-24 11:27:00 +01:00
|
|
|
#resources :downloads, :only => :index
|
|
|
|
match 'statistics/' => 'downloads#index', :as => :downloads
|
2011-10-31 15:57:44 +00:00
|
|
|
match 'statistics/refresh' => 'downloads#refresh', :as => :downloads_refresh
|
2011-11-03 11:16:17 +00:00
|
|
|
match 'statistics/test_sudo' => 'downloads#test_sudo', :as => :test_sudo_downloads
|
2011-03-09 16:16:48 +00:00
|
|
|
|
2011-10-18 14:47:17 +01:00
|
|
|
match '/private/:platform_name/*file_path' => 'privates#show'
|
2011-10-17 15:24:45 +01:00
|
|
|
|
2011-12-22 00:53:55 +00:00
|
|
|
match 'build_lists/publish_build', :to => "build_lists#publish_build"
|
2011-12-21 21:42:06 +00:00
|
|
|
match 'build_lists/status_build', :to => "build_lists#status_build"
|
|
|
|
match 'build_lists/post_build', :to => "build_lists#post_build"
|
|
|
|
match 'build_lists/pre_build', :to => "build_lists#pre_build"
|
|
|
|
match 'build_lists/circle_build', :to => "build_lists#circle_build"
|
|
|
|
match 'build_lists/new_bbdt', :to => "build_lists#new_bbdt"
|
2011-12-21 01:30:34 +00:00
|
|
|
|
2011-12-21 21:42:06 +00:00
|
|
|
resources :build_lists, :only => [:index, :show] do
|
2011-12-21 01:30:34 +00:00
|
|
|
member do
|
2011-12-21 21:42:06 +00:00
|
|
|
put :cancel
|
|
|
|
put :publish
|
2011-12-21 01:30:34 +00:00
|
|
|
end
|
2012-03-01 17:33:46 +00:00
|
|
|
collection { post :search }
|
2011-12-21 01:30:34 +00:00
|
|
|
end
|
2012-03-30 12:26:28 +01:00
|
|
|
resources :product_build_lists, :only => [:index] do
|
|
|
|
collection { post :search }
|
|
|
|
end
|
2011-12-09 23:40:13 +00:00
|
|
|
|
2011-10-27 14:04:03 +01:00
|
|
|
resources :personal_repositories, :only => [:show] do
|
|
|
|
member do
|
|
|
|
get :settings
|
|
|
|
get :change_visibility
|
|
|
|
get :add_project
|
|
|
|
get :remove_project
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-03-10 11:35:46 +00:00
|
|
|
resources :platforms do
|
2011-11-02 10:42:08 +00:00
|
|
|
resources :private_users, :except => [:show, :destroy, :update]
|
2011-10-18 14:47:17 +01:00
|
|
|
|
2011-03-17 14:47:16 +00:00
|
|
|
member do
|
2012-03-20 16:24:18 +00:00
|
|
|
get :clone
|
|
|
|
get :members
|
|
|
|
post :remove_members
|
|
|
|
delete :remove_member
|
|
|
|
post :add_member
|
|
|
|
post :make_clone
|
|
|
|
post :build_all
|
2011-03-17 14:47:16 +00:00
|
|
|
end
|
|
|
|
|
2011-10-27 12:02:25 +01:00
|
|
|
collection do
|
2011-12-01 09:29:04 +00:00
|
|
|
get :autocomplete_user_uname
|
2011-10-27 12:02:25 +01:00
|
|
|
end
|
|
|
|
|
2011-04-14 18:04:32 +01:00
|
|
|
resources :products do
|
2011-11-11 17:13:09 +00:00
|
|
|
# member do
|
|
|
|
# get :clone
|
|
|
|
# get :build
|
|
|
|
# end
|
2012-02-27 20:00:33 +00:00
|
|
|
resources :product_build_lists, :only => [:create, :destroy]
|
2011-04-14 18:04:32 +01:00
|
|
|
end
|
2011-04-11 09:35:08 +01:00
|
|
|
|
2011-11-02 21:37:00 +00:00
|
|
|
resources :repositories
|
2011-10-17 15:24:45 +01:00
|
|
|
end
|
2011-04-11 17:37:09 +01:00
|
|
|
|
2012-03-01 17:37:24 +00:00
|
|
|
resources :projects, :except => [:show] do
|
2011-12-26 17:07:16 +00:00
|
|
|
resources :wiki do
|
|
|
|
collection do
|
2012-01-24 20:47:55 +00:00
|
|
|
match '_history' => 'wiki#wiki_history', :as => :history, :via => :get
|
2012-01-19 23:04:11 +00:00
|
|
|
match '_access' => 'wiki#git', :as => :git, :via => :get
|
2012-01-28 12:10:43 +00:00
|
|
|
match '_revert/:sha1/:sha2' => 'wiki#revert_wiki', :as => :revert, :via => [:get, :post]
|
2012-01-23 12:45:38 +00:00
|
|
|
match '_compare' => 'wiki#compare_wiki', :as => :compare, :via => :post
|
2012-02-20 09:56:09 +00:00
|
|
|
#match '_compare/:versions' => 'wiki#compare_wiki', :versions => /.*/, :as => :compare_versions, :via => :get
|
|
|
|
match '_compare/:versions' => 'wiki#compare_wiki', :versions => /([a-f0-9\^]{6,40})(\.\.\.[a-f0-9\^]{6,40})/, :as => :compare_versions, :via => :get
|
2011-12-26 17:07:16 +00:00
|
|
|
post :preview
|
|
|
|
get :search
|
|
|
|
get :pages
|
|
|
|
end
|
|
|
|
member do
|
2012-01-17 22:28:59 +00:00
|
|
|
get :history
|
2012-01-16 21:48:38 +00:00
|
|
|
get :edit
|
2012-01-19 13:49:32 +00:00
|
|
|
match 'revert/:sha1/:sha2' => 'wiki#revert', :as => :revert_page, :via => [:get, :post]
|
2012-01-16 21:48:38 +00:00
|
|
|
match ':ref' => 'wiki#show', :as => :versioned, :via => :get
|
2011-12-26 17:07:16 +00:00
|
|
|
|
|
|
|
post :compare
|
2012-03-05 16:48:59 +00:00
|
|
|
#match 'compare/*versions' => 'wiki#compare', :as => :compare_versions, :via => :get
|
|
|
|
match 'compare/:versions' => 'wiki#compare', :versions => /([a-f0-9\^]{6,40})(\.\.\.[a-f0-9\^]{6,40})/, :as => :compare_versions, :via => :get
|
2011-12-26 17:07:16 +00:00
|
|
|
end
|
|
|
|
end
|
2012-02-28 14:05:18 +00:00
|
|
|
resources :issues, :except => :edit do
|
2011-12-19 15:30:14 +00:00
|
|
|
resources :comments, :only => [:edit, :create, :update, :destroy]
|
2011-12-28 13:54:45 +00:00
|
|
|
resources :subscribes, :only => [:create, :destroy]
|
2012-02-27 16:10:12 +00:00
|
|
|
collection do
|
|
|
|
post :create_label
|
|
|
|
get :search_collaborators
|
|
|
|
end
|
2011-03-10 14:20:09 +00:00
|
|
|
end
|
2012-02-23 14:48:31 +00:00
|
|
|
post "labels/:label_id" => "issues#destroy_label", :as => :issues_delete_label
|
|
|
|
post "labels/:label_id/update" => "issues#update_label", :as => :issues_update_label
|
|
|
|
|
2012-03-01 17:33:46 +00:00
|
|
|
resources :build_lists, :only => [:index, :new, :create] do
|
|
|
|
collection { post :search }
|
|
|
|
end
|
2011-10-30 21:52:25 +00:00
|
|
|
|
2011-12-11 23:42:13 +00:00
|
|
|
resources :collaborators, :only => [:index, :edit, :update, :add] do
|
2011-10-30 21:52:25 +00:00
|
|
|
collection do
|
|
|
|
get :edit
|
|
|
|
post :update
|
2011-12-11 23:42:13 +00:00
|
|
|
post :add
|
2012-02-28 21:01:25 +00:00
|
|
|
delete :remove
|
2011-10-30 21:52:25 +00:00
|
|
|
end
|
2011-10-30 22:59:03 +00:00
|
|
|
member do
|
|
|
|
post :update
|
|
|
|
end
|
2011-10-30 21:52:25 +00:00
|
|
|
end
|
|
|
|
|
2011-10-22 16:28:41 +01:00
|
|
|
member do
|
2011-11-23 15:52:33 +00:00
|
|
|
post :fork
|
2012-02-28 07:59:38 +00:00
|
|
|
get :sections
|
|
|
|
post :sections
|
2012-03-07 21:34:49 +00:00
|
|
|
delete :remove_user
|
2011-10-22 16:28:41 +01:00
|
|
|
end
|
2011-03-10 11:35:46 +00:00
|
|
|
end
|
|
|
|
|
2011-10-19 14:16:29 +01:00
|
|
|
resources :repositories do
|
|
|
|
member do
|
|
|
|
get :add_project
|
2012-03-14 17:22:47 +00:00
|
|
|
delete :remove_project
|
2011-12-30 22:42:58 +00:00
|
|
|
get :projects_list
|
2011-03-10 14:20:09 +00:00
|
|
|
end
|
2011-03-10 11:35:46 +00:00
|
|
|
end
|
2011-10-16 21:48:31 +01:00
|
|
|
|
2011-12-05 12:32:18 +00:00
|
|
|
resources :groups do
|
2011-12-11 23:42:13 +00:00
|
|
|
get :autocomplete_group_uname, :on => :collection
|
2011-12-09 23:40:13 +00:00
|
|
|
resources :members, :only => [:index, :edit, :update, :add] do
|
2011-12-05 12:32:18 +00:00
|
|
|
collection do
|
2011-12-09 23:40:13 +00:00
|
|
|
get :edit
|
|
|
|
post :add
|
2011-12-05 12:32:18 +00:00
|
|
|
post :update
|
2012-03-01 14:23:26 +00:00
|
|
|
delete :remove
|
2011-12-05 12:32:18 +00:00
|
|
|
end
|
|
|
|
member do
|
|
|
|
post :update
|
2012-03-01 15:41:40 +00:00
|
|
|
delete :remove
|
2011-12-05 12:32:18 +00:00
|
|
|
end
|
|
|
|
end
|
2011-10-16 21:48:31 +01:00
|
|
|
resources :platforms, :only => [:new, :create]
|
2012-03-20 18:11:28 +00:00
|
|
|
end
|
2011-10-16 21:48:31 +01:00
|
|
|
|
2012-03-20 18:11:28 +00:00
|
|
|
# resources :users, :groups do
|
|
|
|
# resources :platforms, :only => [:new, :create]
|
2011-12-08 14:47:18 +00:00
|
|
|
# resources :repositories, :only => [:new, :create]
|
2012-03-20 18:11:28 +00:00
|
|
|
# end
|
2011-10-16 21:48:31 +01:00
|
|
|
|
2012-03-06 15:53:04 +00:00
|
|
|
resources :activity_feeds, :only => [:index]
|
|
|
|
|
|
|
|
resources :search, :only => [:index]
|
|
|
|
|
2011-11-11 17:13:09 +00:00
|
|
|
match 'product_status', :to => 'product_build_lists#status_build'
|
2011-04-11 09:35:08 +01:00
|
|
|
|
2011-03-10 12:39:24 +00:00
|
|
|
# Tree
|
2012-03-21 21:52:40 +00:00
|
|
|
get '/projects/:project_id' => "git/trees#show", :as => :project
|
2012-03-21 19:55:14 +00:00
|
|
|
get '/projects/:project_id/tree/:treeish(/*path)' => "git/trees#show", :defaults => {:treeish => :master}, :as => :tree
|
2011-03-10 12:39:24 +00:00
|
|
|
# Commits
|
2012-03-21 19:55:14 +00:00
|
|
|
get '/projects/:project_id/commits/:treeish(/*path)' => "git/commits#index", :defaults => {:treeish => :master}, :as => :commits, :format => false
|
|
|
|
get '/projects/:project_id/commit/:id(.:format)' => "git/commits#show", :as => :commit
|
|
|
|
# Commit comments
|
|
|
|
post '/projects/:project_id/commit/:commit_id/comments(.:format)' => "comments#create", :as => :project_commit_comments
|
|
|
|
get '/projects/:project_id/commit/:commit_id/comments/:id(.:format)' => "comments#edit", :as => :edit_project_commit_comment
|
|
|
|
put '/projects/:project_id/commit/:commit_id/comments/:id(.:format)' => "comments#update", :as => :project_commit_comment
|
|
|
|
delete '/projects/:project_id/commit/:commit_id/comments/:id(.:format)' => "comments#destroy"
|
|
|
|
# Commit subscribes
|
|
|
|
post '/projects/:project_id/commit/:commit_id/subscribe' => "commit_subscribes#create", :as => :subscribe_commit
|
|
|
|
delete '/projects/:project_id/commit/:commit_id/unsubscribe' => "commit_subscribes#destroy", :as => :unsubscribe_commit
|
2012-02-08 17:51:30 +00:00
|
|
|
# Editing files
|
2012-03-21 19:55:14 +00:00
|
|
|
get '/projects/:project_id/blob/:treeish/*path/edit' => "git/blobs#edit", :defaults => {:treeish => :master}, :as => :edit_blob
|
|
|
|
put '/projects/:project_id/blob/:treeish/*path' => "git/blobs#update", :defaults => {:treeish => :master}, :format => false
|
2011-03-10 12:39:24 +00:00
|
|
|
# Blobs
|
2012-03-21 19:55:14 +00:00
|
|
|
get '/projects/:project_id/blob/:treeish/*path' => "git/blobs#show", :defaults => {:treeish => :master}, :as => :blob, :format => false
|
2011-03-10 12:39:24 +00:00
|
|
|
# Blame
|
2012-03-21 19:55:14 +00:00
|
|
|
get '/projects/:project_id/blame/:treeish/*path' => "git/blobs#blame", :defaults => {:treeish => :master}, :as => :blame, :format => false
|
2012-01-11 18:15:35 +00:00
|
|
|
# Raw
|
2012-03-21 19:55:14 +00:00
|
|
|
get '/projects/:project_id/raw/:treeish/*path' => "git/blobs#raw", :defaults => {:treeish => :master}, :as => :raw, :format => false
|
2011-03-10 12:39:24 +00:00
|
|
|
|
2012-01-25 13:05:39 +00:00
|
|
|
root :to => "activity_feeds#index"
|
2011-11-16 18:45:01 +00:00
|
|
|
match '/forbidden', :to => 'platforms#forbidden', :as => 'forbidden'
|
2011-03-09 13:13:36 +00:00
|
|
|
end
|