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

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

8
  get 'help' => 'help#index'
9 10
  get 'help/permissions' => 'help#permissions'
  get 'help/workflow' => 'help#workflow'
11
  get 'help/web_hooks' => 'help#web_hooks'
12

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

35
  get "errors/githost"
G
gitlabhq 已提交
36 37
  get "profile/password", :to => "profile#password"
  put "profile/password", :to => "profile#password_update"
38
  get "profile/token", :to => "profile#token"
39
  put "profile/reset_private_token", :to => "profile#reset_private_token"
G
gitlabhq 已提交
40
  get "profile", :to => "profile#show"
41 42
  get "profile/design", :to => "profile#design"
  put "profile/update", :to => "profile#update"
D
Dmitriy Zaporozhets 已提交
43 44 45

  get "dashboard/issues", :to => "dashboard#issues"
  get "dashboard/merge_requests", :to => "dashboard#merge_requests"
G
gitlabhq 已提交
46

47
  resources :projects, :constraints => { :id => /[^\/]+/ }, :only => [:new, :create, :index]
G
gitlabhq 已提交
48
  resources :keys
49

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

52
  resources :projects, :constraints => { :id => /[^\/]+/ }, :except => [:new, :create, :index], :path => "/" do
N
Nihad Abbasov 已提交
53
    member do
G
gitlabhq 已提交
54 55
      get "team"
      get "wall"
V
Valery Sizov 已提交
56
      get "graph"
57
      get "files"
G
gitlabhq 已提交
58
    end
G
gitlabhq 已提交
59

V
Valery Sizov 已提交
60 61
    resources :wikis, :only => [:show, :edit, :destroy, :create] do
      member do
V
vsizov 已提交
62
        get "history"        
V
Valery Sizov 已提交
63 64
      end
    end
V
Valery Sizov 已提交
65

D
Dmitriy Zaporozhets 已提交
66 67 68 69
    resource :repository do 
      member do 
        get "branches"
        get "tags"
70
        get "archive"
D
Dmitriy Zaporozhets 已提交
71 72
      end
    end
73

M
miks 已提交
74
    resources :deploy_keys
75
    resources :protected_branches, :only => [:index, :create, :destroy]
M
miks 已提交
76

G
gitlabhq 已提交
77
    resources :refs, :only => [], :path => "/" do 
G
gitlabhq 已提交
78 79 80 81
      collection do 
        get "switch"
      end

G
gitlabhq 已提交
82
      member do 
G
gitlabhq 已提交
83 84 85 86 87 88 89
        get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ }
        get "blob", 
          :constraints => {
            :id => /[a-zA-Z.0-9\/_\-]+/,
            :path => /.*/
          }

G
gitlabhq 已提交
90

G
gitlabhq 已提交
91 92 93 94
        # tree viewer
        get "tree/:path" => "refs#tree",
          :as => :tree_file,
          :constraints => {
G
gitlabhq 已提交
95
            :id => /[a-zA-Z.0-9\/_\-]+/,
G
gitlabhq 已提交
96 97
            :path => /.*/
          }
98 99 100 101 102 103 104 105

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

109 110 111
    resources :merge_requests do 
      member do 
        get :diffs
R
randx 已提交
112
        get :automerge
V
Valery Sizov 已提交
113
        get :automerge_check
114
      end
115 116 117 118 119

      collection do 
        get :branch_from
        get :branch_to
      end
120
    end
D
Dmitriy Zaporozhets 已提交
121
    
R
randx 已提交
122 123 124 125 126 127
    resources :snippets do 
      member do 
        get "raw"
      end
    end

128
    resources :hooks, :only => [:index, :create, :destroy] do 
129 130 131 132
      member do 
        get :test
      end
    end
D
Dmitriy Zaporozhets 已提交
133 134 135 136 137
    resources :commits do 
      collection do 
        get :compare
      end
    end
G
gitlabhq 已提交
138
    resources :team_members
D
Dmitriy Zaporozhets 已提交
139
    resources :milestones
V
VSizov 已提交
140 141
    resources :issues do
      collection do
142 143
        post  :sort
        get   :search
A
Adam Leonard 已提交
144
      end
V
VSizov 已提交
145
    end
146
    resources :notes, :only => [:index, :create, :destroy]
G
gitlabhq 已提交
147
  end
148
  root :to => "projects#index"
G
gitlabhq 已提交
149
end