routes.rb 3.21 KB
Newer Older
gitlabhq's avatar
gitlabhq committed
1
Gitlab::Application.routes.draw do
2
  get 'search' => "search#show"
Valery Sizov's avatar
Valery Sizov committed
3

4
  # Optionally, enable Resque here
5
6
  require 'resque/server'
  mount Resque::Server.new, at: '/info/resque'
Ariejan de Vroom's avatar
Ariejan de Vroom committed
7

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

Nihad Abbasov's avatar
Nihad Abbasov committed
12
  namespace :admin do
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
13
14
15
16
17
    resources :users do 
      member do 
        put :team_update
      end
    end
18
19
20
21
22
23
    resources :projects, :constraints => { :id => /[^\/]+/ } do 
      member do 
        get :team
        put :team_update
      end
    end
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
24
    resources :team_members, :only => [:edit, :update, :destroy]
gitlabhq's avatar
gitlabhq committed
25
26
27
28
29
30
31
    get 'emails', :to => 'mailer#preview'
    get 'mailer/preview_note'
    get 'mailer/preview_user_new'
    get 'mailer/preview_issue_new'
    root :to => "users#index"
  end

32
  get "errors/githost"
gitlabhq's avatar
gitlabhq committed
33
34
  get "profile/password", :to => "profile#password"
  put "profile/password", :to => "profile#password_update"
35
  put "profile/reset_private_token", :to => "profile#reset_private_token"
gitlabhq's avatar
gitlabhq committed
36
  get "profile", :to => "profile#show"
37
38
  get "profile/design", :to => "profile#design"
  put "profile/update", :to => "profile#update"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
39

gitlabhq's avatar
gitlabhq committed
40
  get "dashboard", :to => "dashboard#index"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
41
42
  get "dashboard/issues", :to => "dashboard#issues"
  get "dashboard/merge_requests", :to => "dashboard#merge_requests"
Ariejan de Vroom's avatar
Ariejan de Vroom committed
43

gitlabhq's avatar
gitlabhq committed
44
45
  #get "profile/:id", :to => "profile#show"

46
  resources :projects, :constraints => { :id => /[^\/]+/ }, :only => [:new, :create, :index]
gitlabhq's avatar
gitlabhq committed
47
  resources :keys
48

vsizov's avatar
vsizov committed
49
  devise_for :users, :controllers => { :omniauth_callbacks => :omniauth_callbacks }
gitlabhq's avatar
gitlabhq committed
50

51
  resources :projects, :constraints => { :id => /[^\/]+/ }, :except => [:new, :create, :index], :path => "/" do
Nihad Abbasov's avatar
Nihad Abbasov committed
52
    member do
gitlabhq's avatar
gitlabhq committed
53
54
      get "team"
      get "wall"
Valery Sizov's avatar
Valery Sizov committed
55
      get "graph"
56
      get "files"
gitlabhq's avatar
gitlabhq committed
57
    end
gitlabhq's avatar
gitlabhq committed
58

Valery Sizov's avatar
Valery Sizov committed
59
60
    resources :wikis, :only => [:show, :edit, :destroy, :create] do
      member do
vsizov's avatar
vsizov committed
61
        get "history"        
Valery Sizov's avatar
Valery Sizov committed
62
63
      end
    end
Valery Sizov's avatar
Valery Sizov committed
64

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
65
66
67
68
    resource :repository do 
      member do 
        get "branches"
        get "tags"
69
        get "archive"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
70
71
      end
    end
72

miks's avatar
miks committed
73
    resources :deploy_keys
74
    resources :protected_branches, :only => [:index, :create, :destroy]
miks's avatar
miks committed
75

gitlabhq's avatar
gitlabhq committed
76
    resources :refs, :only => [], :path => "/" do 
gitlabhq's avatar
gitlabhq committed
77
78
79
80
      collection do 
        get "switch"
      end

gitlabhq's avatar
gitlabhq committed
81
      member do 
gitlabhq's avatar
gitlabhq committed
82
83
84
85
86
87
88
        get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ }
        get "blob", 
          :constraints => {
            :id => /[a-zA-Z.0-9\/_\-]+/,
            :path => /.*/
          }

gitlabhq's avatar
gitlabhq committed
89

gitlabhq's avatar
gitlabhq committed
90
91
92
93
        # tree viewer
        get "tree/:path" => "refs#tree",
          :as => :tree_file,
          :constraints => {
gitlabhq's avatar
gitlabhq committed
94
            :id => /[a-zA-Z.0-9\/_\-]+/,
gitlabhq's avatar
gitlabhq committed
95
96
97
            :path => /.*/
          }
      end
gitlabhq's avatar
gitlabhq committed
98
    end
gitlabhq's avatar
gitlabhq committed
99

100
101
102
103
    resources :merge_requests do 
      member do 
        get :diffs
      end
104
105
106
107
108

      collection do 
        get :branch_from
        get :branch_to
      end
109
    end
110
    
gitlabhq's avatar
gitlabhq committed
111
    resources :snippets
112
113
114
115
116
    resources :hooks, :only => [:index, :new, :create, :destroy, :show] do 
      member do 
        get :test
      end
    end
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
117
118
119
120
121
    resources :commits do 
      collection do 
        get :compare
      end
    end
gitlabhq's avatar
gitlabhq committed
122
    resources :team_members
VSizov's avatar
VSizov committed
123
124
    resources :issues do
      collection do
125
126
        post  :sort
        get   :search
Adam Leonard's avatar
Adam Leonard committed
127
      end
VSizov's avatar
VSizov committed
128
    end
129
    resources :notes, :only => [:index, :create, :destroy]
gitlabhq's avatar
gitlabhq committed
130
  end
131
  root :to => "dashboard#index"
gitlabhq's avatar
gitlabhq committed
132
end