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

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

7
  get 'help' => 'help#index'
8

N
Nihad Abbasov 已提交
9
  namespace :admin do
G
gitlabhq 已提交
10
    resources :users
11 12 13 14 15 16
    resources :projects, :constraints => { :id => /[^\/]+/ } do 
      member do 
        get :team
        put :team_update
      end
    end
G
gitlabhq 已提交
17 18 19 20 21 22 23 24
    resources :team_members
    get 'emails', :to => 'mailer#preview'
    get 'mailer/preview_note'
    get 'mailer/preview_user_new'
    get 'mailer/preview_issue_new'
    root :to => "users#index"
  end

25
  get "errors/githost"
G
gitlabhq 已提交
26 27
  get "profile/password", :to => "profile#password"
  put "profile/password", :to => "profile#password_update"
28
  put "profile/reset_private_token", :to => "profile#reset_private_token"
G
gitlabhq 已提交
29
  get "profile", :to => "profile#show"
30 31
  get "profile/design", :to => "profile#design"
  put "profile/update", :to => "profile#update"
D
Dmitriy Zaporozhets 已提交
32

G
gitlabhq 已提交
33
  get "dashboard", :to => "dashboard#index"
D
Dmitriy Zaporozhets 已提交
34 35
  get "dashboard/issues", :to => "dashboard#issues"
  get "dashboard/merge_requests", :to => "dashboard#merge_requests"
A
Ariejan de Vroom 已提交
36

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

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

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

44
  resources :projects, :constraints => { :id => /[^\/]+/ }, :except => [:new, :create, :index], :path => "/" do
N
Nihad Abbasov 已提交
45
    member do
G
gitlabhq 已提交
46 47
      get "team"
      get "wall"
V
Valery Sizov 已提交
48
      get "graph"
D
Dmitriy Zaporozhets 已提交
49
      get "info"
50
      get "files"
G
gitlabhq 已提交
51
    end
G
gitlabhq 已提交
52

D
Dmitriy Zaporozhets 已提交
53 54 55 56 57 58
    resource :repository do 
      member do 
        get "branches"
        get "tags"
      end
    end
59

M
miks 已提交
60 61
    resources :deploy_keys

G
gitlabhq 已提交
62
    resources :refs, :only => [], :path => "/" do 
G
gitlabhq 已提交
63 64 65 66
      collection do 
        get "switch"
      end

G
gitlabhq 已提交
67
      member do 
G
gitlabhq 已提交
68 69 70 71 72 73 74
        get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ }
        get "blob", 
          :constraints => {
            :id => /[a-zA-Z.0-9\/_\-]+/,
            :path => /.*/
          }

G
gitlabhq 已提交
75

G
gitlabhq 已提交
76 77 78 79
        # tree viewer
        get "tree/:path" => "refs#tree",
          :as => :tree_file,
          :constraints => {
G
gitlabhq 已提交
80
            :id => /[a-zA-Z.0-9\/_\-]+/,
G
gitlabhq 已提交
81 82 83
            :path => /.*/
          }
      end
G
gitlabhq 已提交
84
    end
G
gitlabhq 已提交
85

86 87 88 89 90 91
    resources :merge_requests do 
      member do 
        get :diffs
        get :commits
      end
    end
D
Dmitriy Zaporozhets 已提交
92
    
G
gitlabhq 已提交
93
    resources :snippets
94 95 96 97 98
    resources :hooks, :only => [:index, :new, :create, :destroy, :show] do 
      member do 
        get :test
      end
    end
G
gitlabhq 已提交
99 100
    resources :commits
    resources :team_members
V
VSizov 已提交
101 102
    resources :issues do
      collection do
103 104
        post  :sort
        get   :search
A
Adam Leonard 已提交
105
      end
V
VSizov 已提交
106
    end
G
gitlabhq 已提交
107 108
    resources :notes, :only => [:create, :destroy]
  end
D
Dmitriy Zaporozhets 已提交
109
  root :to => "projects#index"
G
gitlabhq 已提交
110
end