OSDN Git Service

Merge branch 'grit_ext'
[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     resources :refs, :only => [], :path => "/" do 
50       collection do 
51         get "switch"
52       end
53
54       member do 
55         get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ }
56         get "blob", 
57           :constraints => {
58             :id => /[a-zA-Z.0-9\/_\-]+/,
59             :path => /.*/
60           }
61
62
63         # tree viewer
64         get "tree/:path" => "refs#tree",
65           :as => :tree_file,
66           :constraints => {
67             :id => /[a-zA-Z.0-9\/_\-]+/,
68             :path => /.*/
69           }
70       end
71     end
72
73     resources :merge_requests do 
74       member do 
75         get :diffs
76         get :commits
77       end
78     end
79     resources :snippets
80     resources :commits
81     resources :team_members
82     resources :issues do
83       collection do
84         post  :sort
85         get   :search
86       end
87     end
88     resources :notes, :only => [:create, :destroy]
89   end
90   root :to => "dashboard#index"
91 end