OSDN Git Service

Merge branch 'web_hooks_scaffold'
[wvm/gitlab.git] / config / routes.rb
1 Gitlab::Application.routes.draw do
2
3   # Optionally, enable Resque here
4   require 'resque/server'
5   mount Resque::Server.new, at: '/info/resque'
6
7   get 'tags'=> 'tags#index'
8   get 'tags/:tag' => 'projects#index'
9
10   namespace :admin do
11     resources :users
12     resources :projects, :constraints => { :id => /[^\/]+/ }
13     resources :team_members
14     get 'emails', :to => 'mailer#preview'
15     get 'mailer/preview_note'
16     get 'mailer/preview_user_new'
17     get 'mailer/preview_issue_new'
18     root :to => "users#index"
19   end
20
21   get "errors/githost"
22   get "profile/password", :to => "profile#password"
23   put "profile/password", :to => "profile#password_update"
24   put "profile/reset_private_token", :to => "profile#reset_private_token"
25   get "profile", :to => "profile#show"
26   get "profile/design", :to => "profile#design"
27   put "profile/update", :to => "profile#update"
28
29   get "dashboard", :to => "dashboard#index"
30   get "dashboard/issues", :to => "dashboard#issues"
31   get "dashboard/merge_requests", :to => "dashboard#merge_requests"
32
33   #get "profile/:id", :to => "profile#show"
34
35   resources :projects, :constraints => { :id => /[^\/]+/ }, :only => [:new, :create, :index]
36   resources :keys
37
38   devise_for :users
39
40   resources :projects, :constraints => { :id => /[^\/]+/ }, :except => [:new, :create, :index], :path => "/" do
41     member do
42       get "team"
43       get "wall"
44       get "graph"
45       get "info"
46       get "files"
47     end
48
49     resource :repository do 
50       member do 
51         get "branches"
52         get "tags"
53       end
54     end
55
56     resources :refs, :only => [], :path => "/" do 
57       collection do 
58         get "switch"
59       end
60
61       member do 
62         get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ }
63         get "blob", 
64           :constraints => {
65             :id => /[a-zA-Z.0-9\/_\-]+/,
66             :path => /.*/
67           }
68
69
70         # tree viewer
71         get "tree/:path" => "refs#tree",
72           :as => :tree_file,
73           :constraints => {
74             :id => /[a-zA-Z.0-9\/_\-]+/,
75             :path => /.*/
76           }
77       end
78     end
79
80     resources :merge_requests do 
81       member do 
82         get :diffs
83         get :commits
84       end
85     end
86     
87     resources :snippets
88     resources :hooks, :only => [:index, :new, :create, :destroy, :show] do 
89       member do 
90         get :test
91       end
92     end
93     resources :commits
94     resources :team_members
95     resources :issues do
96       collection do
97         post  :sort
98         get   :search
99       end
100     end
101     resources :notes, :only => [:create, :destroy]
102   end
103   root :to => "dashboard#index"
104 end