routes.rb 3.3 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 17 18
    resources :users do 
      member do 
        put :team_update
      end
    end
19 20 21 22 23 24
    resources :projects, :constraints => { :id => /[^\/]+/ } do 
      member do 
        get :team
        put :team_update
      end
    end
D
Dmitriy Zaporozhets 已提交
25
    resources :team_members, :only => [:edit, :update, :destroy]
G
gitlabhq 已提交
26 27 28 29 30 31 32
    get 'emails', :to => 'mailer#preview'
    get 'mailer/preview_note'
    get 'mailer/preview_user_new'
    get 'mailer/preview_issue_new'
    root :to => "users#index"
  end

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

G
gitlabhq 已提交
41
  get "dashboard", :to => "dashboard#index"
D
Dmitriy Zaporozhets 已提交
42 43
  get "dashboard/issues", :to => "dashboard#issues"
  get "dashboard/merge_requests", :to => "dashboard#merge_requests"
44
  get "dashboard/activities", :to => "dashboard#activities"
A
Ariejan de Vroom 已提交
45

G
gitlabhq 已提交
46 47
  #get "profile/:id", :to => "profile#show"

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

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

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

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

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

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

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

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

G
gitlabhq 已提交
91

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

102 103 104
    resources :merge_requests do 
      member do 
        get :diffs
R
randx 已提交
105
        get :automerge
106
      end
107 108 109 110 111

      collection do 
        get :branch_from
        get :branch_to
      end
112
    end
D
Dmitriy Zaporozhets 已提交
113
    
G
gitlabhq 已提交
114
    resources :snippets
115 116 117 118 119
    resources :hooks, :only => [:index, :new, :create, :destroy, :show] do 
      member do 
        get :test
      end
    end
D
Dmitriy Zaporozhets 已提交
120 121 122 123 124
    resources :commits do 
      collection do 
        get :compare
      end
    end
G
gitlabhq 已提交
125
    resources :team_members
V
VSizov 已提交
126 127
    resources :issues do
      collection do
128 129
        post  :sort
        get   :search
A
Adam Leonard 已提交
130
      end
V
VSizov 已提交
131
    end
132
    resources :notes, :only => [:index, :create, :destroy]
G
gitlabhq 已提交
133
  end
134
  root :to => "dashboard#index"
G
gitlabhq 已提交
135
end