routes.rb 3.7 KB
Newer Older
G
gitlabhq 已提交
1
Gitlab::Application.routes.draw do
2 3 4
  #
  # Search
  #
5
  get 'search' => "search#show"
V
Valery Sizov 已提交
6

A
Ariejan de Vroom 已提交
7
  # Optionally, enable Resque here
D
Dmitriy Zaporozhets 已提交
8 9
  require 'resque/server'
  mount Resque::Server.new, at: '/info/resque'
A
Ariejan de Vroom 已提交
10

11 12 13
  #
  # Help
  #
14
  get 'help' => 'help#index'
15 16
  get 'help/permissions' => 'help#permissions'
  get 'help/workflow' => 'help#workflow'
17
  get 'help/web_hooks' => 'help#web_hooks'
18

19 20 21
  #
  # Admin Area
  #
N
Nihad Abbasov 已提交
22
  namespace :admin do
D
Dmitriy Zaporozhets 已提交
23 24 25
    resources :users do 
      member do 
        put :team_update
26 27
        put :block
        put :unblock
D
Dmitriy Zaporozhets 已提交
28 29
      end
    end
30 31 32 33 34 35
    resources :projects, :constraints => { :id => /[^\/]+/ } do 
      member do 
        get :team
        put :team_update
      end
    end
D
Dmitriy Zaporozhets 已提交
36
    resources :team_members, :only => [:edit, :update, :destroy]
G
gitlabhq 已提交
37 38 39 40
    get 'emails', :to => 'mailer#preview'
    get 'mailer/preview_note'
    get 'mailer/preview_user_new'
    get 'mailer/preview_issue_new'
R
randx 已提交
41
    root :to => "dashboard#index"
G
gitlabhq 已提交
42 43
  end

44
  get "errors/githost"
R
randx 已提交
45 46 47 48

  #
  # Profile Area
  #
G
gitlabhq 已提交
49 50
  get "profile/password", :to => "profile#password"
  put "profile/password", :to => "profile#password_update"
51
  get "profile/token", :to => "profile#token"
52
  put "profile/reset_private_token", :to => "profile#reset_private_token"
G
gitlabhq 已提交
53
  get "profile", :to => "profile#show"
54 55
  get "profile/design", :to => "profile#design"
  put "profile/update", :to => "profile#update"
56
  resources :keys
D
Dmitriy Zaporozhets 已提交
57

R
randx 已提交
58 59 60 61
  #
  # Dashboard Area
  #
  get "dashboard", :to => "dashboard#index"
D
Dmitriy Zaporozhets 已提交
62 63
  get "dashboard/issues", :to => "dashboard#issues"
  get "dashboard/merge_requests", :to => "dashboard#merge_requests"
G
gitlabhq 已提交
64

R
randx 已提交
65
  resources :projects, :constraints => { :id => /[^\/]+/ }, :only => [:new, :create]
66

V
vsizov 已提交
67
  devise_for :users, :controllers => { :omniauth_callbacks => :omniauth_callbacks }
G
gitlabhq 已提交
68

69 70 71
  #
  # Project Area
  #
72
  resources :projects, :constraints => { :id => /[^\/]+/ }, :except => [:new, :create, :index], :path => "/" do
N
Nihad Abbasov 已提交
73
    member do
G
gitlabhq 已提交
74 75
      get "team"
      get "wall"
V
Valery Sizov 已提交
76
      get "graph"
77
      get "files"
G
gitlabhq 已提交
78
    end
G
gitlabhq 已提交
79

V
Valery Sizov 已提交
80 81
    resources :wikis, :only => [:show, :edit, :destroy, :create] do
      member do
V
vsizov 已提交
82
        get "history"        
V
Valery Sizov 已提交
83 84
      end
    end
V
Valery Sizov 已提交
85

D
Dmitriy Zaporozhets 已提交
86 87 88 89
    resource :repository do 
      member do 
        get "branches"
        get "tags"
90
        get "archive"
D
Dmitriy Zaporozhets 已提交
91 92
      end
    end
93

M
miks 已提交
94
    resources :deploy_keys
95
    resources :protected_branches, :only => [:index, :create, :destroy]
M
miks 已提交
96

G
gitlabhq 已提交
97
    resources :refs, :only => [], :path => "/" do 
G
gitlabhq 已提交
98 99 100 101
      collection do 
        get "switch"
      end

G
gitlabhq 已提交
102
      member do 
G
gitlabhq 已提交
103 104 105 106 107 108 109
        get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ }
        get "blob", 
          :constraints => {
            :id => /[a-zA-Z.0-9\/_\-]+/,
            :path => /.*/
          }

G
gitlabhq 已提交
110

G
gitlabhq 已提交
111 112 113 114
        # tree viewer
        get "tree/:path" => "refs#tree",
          :as => :tree_file,
          :constraints => {
G
gitlabhq 已提交
115
            :id => /[a-zA-Z.0-9\/_\-]+/,
G
gitlabhq 已提交
116 117
            :path => /.*/
          }
118 119 120 121 122 123 124 125

        # blame
        get "blame/:path" => "refs#blame",
          :as => :blame_file,
          :constraints => {
            :id => /[a-zA-Z.0-9\/_\-]+/,
            :path => /.*/
          }
G
gitlabhq 已提交
126
      end
G
gitlabhq 已提交
127
    end
G
gitlabhq 已提交
128

129 130 131
    resources :merge_requests do 
      member do 
        get :diffs
R
randx 已提交
132
        get :automerge
V
Valery Sizov 已提交
133
        get :automerge_check
134
      end
135 136 137 138 139

      collection do 
        get :branch_from
        get :branch_to
      end
140
    end
D
Dmitriy Zaporozhets 已提交
141
    
R
randx 已提交
142 143 144 145 146 147
    resources :snippets do 
      member do 
        get "raw"
      end
    end

148
    resources :hooks, :only => [:index, :create, :destroy] do 
149 150 151 152
      member do 
        get :test
      end
    end
D
Dmitriy Zaporozhets 已提交
153 154 155 156 157
    resources :commits do 
      collection do 
        get :compare
      end
    end
G
gitlabhq 已提交
158
    resources :team_members
D
Dmitriy Zaporozhets 已提交
159
    resources :milestones
V
VSizov 已提交
160 161
    resources :issues do
      collection do
162 163
        post  :sort
        get   :search
A
Adam Leonard 已提交
164
      end
V
VSizov 已提交
165
    end
166
    resources :notes, :only => [:index, :create, :destroy]
G
gitlabhq 已提交
167
  end
R
randx 已提交
168
  root :to => "dashboard#index"
G
gitlabhq 已提交
169
end