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

A
Ariejan de Vroom 已提交
3 4
  get "user_issues/index"

5 6 7
  get 'tags'=> 'tags#index'
  get 'tags/:tag' => 'projects#index'

N
Nihad Abbasov 已提交
8
  namespace :admin do
G
gitlabhq 已提交
9 10 11 12 13 14 15 16 17 18
    resources :users
    resources :projects
    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

19
  get "errors/githost"
G
gitlabhq 已提交
20 21
  get "profile/password", :to => "profile#password"
  put "profile/password", :to => "profile#password_update"
22
  put "profile/reset_private_token", :to => "profile#reset_private_token"
23
  put "profile/edit", :to => "profile#social_update"
G
gitlabhq 已提交
24
  get "profile", :to => "profile#show"
G
gitlabhq 已提交
25
  get "dashboard", :to => "dashboard#index"
A
Ariejan de Vroom 已提交
26
  get "issues", :to => "user_issues#index", :as => "issues"
27
  get "merge_requests", :to => "user_merge_requests#index", :as => "merge_requests"
A
Ariejan de Vroom 已提交
28

G
gitlabhq 已提交
29 30 31 32
  #get "profile/:id", :to => "profile#show"

  resources :projects, :only => [:new, :create, :index]
  resources :keys
33

G
gitlabhq 已提交
34 35
  devise_for :users

N
Nihad Abbasov 已提交
36 37
  resources :projects, :except => [:new, :create, :index], :path => "/" do
    member do
G
gitlabhq 已提交
38 39
      get "team"
      get "wall"
V
Valery Sizov 已提交
40
      get "graph"
G
gitlabhq 已提交
41
    end
G
gitlabhq 已提交
42

G
gitlabhq 已提交
43
    resources :refs, :only => [], :path => "/" do 
G
gitlabhq 已提交
44 45 46 47
      collection do 
        get "switch"
      end

G
gitlabhq 已提交
48
      member do 
G
gitlabhq 已提交
49 50 51 52 53 54 55
        get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ }
        get "blob", 
          :constraints => {
            :id => /[a-zA-Z.0-9\/_\-]+/,
            :path => /.*/
          }

G
gitlabhq 已提交
56

G
gitlabhq 已提交
57 58 59 60
        # tree viewer
        get "tree/:path" => "refs#tree",
          :as => :tree_file,
          :constraints => {
G
gitlabhq 已提交
61
            :id => /[a-zA-Z.0-9\/_\-]+/,
G
gitlabhq 已提交
62 63 64
            :path => /.*/
          }
      end
G
gitlabhq 已提交
65
    end
G
gitlabhq 已提交
66

67 68 69 70 71 72
    resources :merge_requests do 
      member do 
        get :diffs
        get :commits
      end
    end
G
gitlabhq 已提交
73
    resources :snippets
G
gitlabhq 已提交
74 75
    resources :commits
    resources :team_members
V
VSizov 已提交
76 77
    resources :issues do
      collection do
78 79
        post  :sort
        get   :search
A
Adam Leonard 已提交
80
      end
V
VSizov 已提交
81
    end
G
gitlabhq 已提交
82 83
    resources :notes, :only => [:create, :destroy]
  end
G
gitlabhq 已提交
84
  root :to => "dashboard#index"
G
gitlabhq 已提交
85
end