rosa-build/config/routes.rb

220 lines
8.1 KiB
Ruby
Raw Normal View History

2012-01-30 20:39:34 +00:00
# -*- encoding : utf-8 -*-
2011-03-09 13:13:36 +00:00
Rosa::Application.routes.draw do
2011-10-24 02:55:03 +01:00
# XML RPC
match 'api/xmlrpc' => 'rpc#xe_index'
2012-01-11 18:15:35 +00:00
devise_scope :user do
get '/users/auth/:provider' => 'users/omniauth_callbacks#passthru'
end
devise_for :users, :controllers => {:omniauth_callbacks => 'users/omniauth_callbacks'}
2012-01-11 18:15:35 +00:00
2011-11-30 15:27:19 +00:00
resources :users do
resources :groups, :only => [:new, :create, :index]
collection do
resources :register_requests, :only => [:index, :new, :create, :show_message, :approve, :reject] do
get :show_message, :on => :collection
put :update, :on => :collection
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
2011-11-30 15:27:19 +00:00
end
2011-10-21 16:39:32 +01:00
resources :event_logs, :only => :index
2011-03-09 16:16:48 +00:00
#resources :downloads, :only => :index
match 'statistics/' => 'downloads#index', :as => :downloads
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
resources :categories do
get :platforms, :on => :collection
end
match '/private/:platform_name/*file_path' => 'privates#show'
match 'build_lists/publish_build', :to => "build_lists#publish_build"
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"
resources :build_lists, :only => [:index, :show] do
member do
put :cancel
put :publish
end
end
2012-02-01 18:13:42 +00:00
post 'build_lists' => 'build_lists#index', :as => 'build_lists'
2012-02-01 16:00:19 +00:00
resources :auto_build_lists, :only => [:index, :create, :destroy]
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
resources :private_users, :except => [:show, :destroy, :update]
2011-03-17 14:47:16 +00:00
member do
post 'freeze'
post 'unfreeze'
2011-05-30 10:04:32 +01:00
get 'clone'
post 'clone'
post 'build_all'
2011-03-17 14:47:16 +00:00
end
collection do
get 'easy_urpmi'
2011-12-01 09:29:04 +00:00
get :autocomplete_user_uname
end
resources :products do
# member do
# get :clone
# get :build
# end
resources :product_build_lists, :only => [:create]
end
resources :repositories
resources :categories, :only => [:index, :show]
end
2011-04-11 17:37:09 +01:00
resources :projects do
resources :wiki do
collection do
match '_history' => 'wiki#wiki_history', :as => :history, :via => :get
match '_access' => 'wiki#git', :as => :git, :via => :get
match '_revert/:sha1/:sha2' => 'wiki#revert_wiki', :as => :revert, :via => [:get, :post]
match '_compare' => 'wiki#compare_wiki', :as => :compare, :via => :post
match '_compare/*versions' => 'wiki#compare_wiki', :as => :compare_versions, :via => :get
post :preview
get :search
get :pages
end
member do
get :history
get :edit
match 'revert/:sha1/:sha2' => 'wiki#revert', :as => :revert_page, :via => [:get, :post]
match ':ref' => 'wiki#show', :as => :versioned, :via => :get
post :compare
match 'compare/*versions' => 'wiki#compare', :as => :compare_versions, :via => :get
end
end
resources :issues do
resources :comments, :only => [:edit, :create, :update, :destroy]
resources :subscribes, :only => [:create, :destroy]
2012-02-21 20:28:04 +00:00
collection do
post :create_label
post :delete_label
end
2011-03-10 14:20:09 +00:00
end
resource :repo, :controller => "git/repositories", :only => [:show]
resources :build_lists, :only => [:index, :new, :create]
2011-10-30 21:52:25 +00:00
resources :collaborators, :only => [:index, :edit, :update, :add] do
2011-10-30 21:52:25 +00:00
collection do
get :edit
post :update
post :add
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
# resources :groups, :controller => 'project_groups' do
# end
member do
post :fork
end
collection do
get :auto_build
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
get :remove_project
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
get :autocomplete_group_uname, :on => :collection
resources :members, :only => [:index, :edit, :update, :add] do
2011-12-05 12:32:18 +00:00
collection do
get :edit
post :add
2011-12-05 12:32:18 +00:00
post :update
end
member do
post :update
end
end
end
resources :users, :groups do
2011-10-16 21:48:31 +01:00
resources :platforms, :only => [:new, :create]
2011-11-30 12:58:14 +00:00
resources :projects, :only => [:new, :create, :index]
2011-10-16 21:48:31 +01:00
# resources :repositories, :only => [:new, :create]
2011-10-16 21:48:31 +01:00
end
2011-11-01 20:56:01 +00:00
match '/catalogs', :to => 'categories#platforms', :as => :catalogs
2011-10-30 21:52:25 +00:00
match 'product_status', :to => 'product_build_lists#status_build'
# Tree
match '/projects/:project_id/git/tree/:treeish(/*path)', :controller => "git/trees", :action => :show, :treeish => /[0-9a-zA-Z_.\-]*/, :defaults => { :treeish => :master }, :as => :tree
2012-01-11 18:15:35 +00:00
# Commits
match '/projects/:project_id/git/commits/:treeish(/*path)', :controller => "git/commits", :action => :index, :treeish => /[0-9a-zA-Z_.\-]*/, :defaults => { :treeish => :master }, :as => :commits
match '/projects/:project_id/git/commit/:id(.:format)', :controller => "git/commits", :action => :show, :defaults => { :format => :html }, :as => :commit
2012-01-11 18:15:35 +00:00
# Commit Comments
match '/projects/:project_id/git/commit/:commit_id/comments/:id(.:format)', :controller => "comments", :action => :edit, :as => :edit_project_commit_comment, :via => :get
match '/projects/:project_id/git/commit/:commit_id/comments/:id(.:format)', :controller => "comments", :action => :update, :as => :project_commit_comment, :via => :put
match '/projects/:project_id/git/commit/:commit_id/comments/:id(.:format)', :controller => "comments", :action => :destroy, :via => :delete
match '/projects/:project_id/git/commit/:commit_id/comments(.:format)', :controller => "comments", :action => :create, :as => :project_commit_comments, :via => :post
2012-01-23 19:42:54 +00:00
# Commits subscribe
match '/projects/:project_id/git/commit/:commit_id/subscribe', :controller => "commit_subscribes", :action => :create, :defaults => { :format => :html }, :as => :subscribe_commit, :via => :post
match '/projects/:project_id/git/commit/:commit_id/unsubscribe', :controller => "commit_subscribes", :action => :destroy, :defaults => { :format => :html }, :as => :unsubscribe_commit, :via => :delete
# Editing files
match '/projects/:project_id/git/blob/:treeish/*path/edit', :controller => "git/blobs", :action => :edit, :treeish => /[0-9a-zA-Z_.\-]*/, :defaults => { :treeish => :master }, :as => :edit_blob, :via => :get
match '/projects/:project_id/git/blob/:treeish/*path', :controller => "git/blobs", :action => :update, :treeish => /[0-9a-zA-Z_.\-]*/, :defaults => { :treeish => :master }, :via => :put
# Blobs
match '/projects/:project_id/git/blob/:treeish/*path', :controller => "git/blobs", :action => :show, :treeish => /[0-9a-zA-Z_.\-]*/, :defaults => { :treeish => :master }, :as => :blob, :via => :get
match '/projects/:project_id/git/commit/blob/:commit_hash/*path', :controller => "git/blobs", :action => :show, :project_id => /[0-9a-zA-Z_.\-]*/, :as => :blob_commit, :via => :get
2012-01-11 18:15:35 +00:00
# Blame
match '/projects/:project_id/git/blame/:treeish/*path', :controller => "git/blobs", :action => :blame, :treeish => /[0-9a-zA-Z_.\-]*/, :defaults => { :treeish => :master }, :as => :blame
match '/projects/:project_id/git/commit/blame/:commit_hash/*path', :controller => "git/blobs", :action => :blame, :as => :blame_commit
2012-01-11 18:15:35 +00:00
# Raw
match '/projects/:project_id/git/raw/:treeish/*path', :controller => "git/blobs", :action => :raw, :treeish => /[0-9a-zA-Z_.\-]*/, :defaults => { :treeish => :master }, :as => :raw
match '/projects/:project_id/git/commit/raw/:commit_hash/*path', :controller => "git/blobs", :action => :raw, :as => :raw_commit
2011-03-09 13:13:36 +00:00
root :to => "platforms#index"
match '/forbidden', :to => 'platforms#forbidden', :as => 'forbidden'
2011-03-09 13:13:36 +00:00
end