routes.rb 3.1 KB
Newer Older
G
gitlabhq 已提交
1
Gitlab::Application.routes.draw do
2

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

N
Nihad Abbasov 已提交
12
  namespace :admin do
D
Dmitriy Zaporozhets 已提交
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
D
Dmitriy Zaporozhets 已提交
24
    resources :team_members, :only => [:edit, :update, :destroy]
G
gitlabhq 已提交
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"
G
gitlabhq 已提交
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"
G
gitlabhq 已提交
36
  get "profile", :to => "profile#show"
37 38
  get "profile/design", :to => "profile#design"
  put "profile/update", :to => "profile#update"
D
Dmitriy Zaporozhets 已提交
39

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

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

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

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

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

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

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

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

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

G
gitlabhq 已提交
81
      member do 
G
gitlabhq 已提交
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 => /.*/
          }

G
gitlabhq 已提交
89

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

100 101 102 103 104
    resources :merge_requests do 
      member do 
        get :diffs
      end
    end
D
Dmitriy Zaporozhets 已提交
105
    
G
gitlabhq 已提交
106
    resources :snippets
107 108 109 110 111
    resources :hooks, :only => [:index, :new, :create, :destroy, :show] do 
      member do 
        get :test
      end
    end
D
Dmitriy Zaporozhets 已提交
112 113 114 115 116
    resources :commits do 
      collection do 
        get :compare
      end
    end
G
gitlabhq 已提交
117
    resources :team_members
V
VSizov 已提交
118 119
    resources :issues do
      collection do
120 121
        post  :sort
        get   :search
A
Adam Leonard 已提交
122
      end
V
VSizov 已提交
123
    end
124
    resources :notes, :only => [:index, :create, :destroy]
G
gitlabhq 已提交
125
  end
D
Dmitriy Zaporozhets 已提交
126
  root :to => "projects#index"
G
gitlabhq 已提交
127
end