routes.rb 1.88 KB
Newer Older
gitlabhq's avatar
gitlabhq committed
1
Gitlab::Application.routes.draw do
2 3 4 5

  get 'tags'=> 'tags#index'
  get 'tags/:tag' => 'projects#index'

Nihad Abbasov's avatar
Nihad Abbasov committed
6
  namespace :admin do
gitlabhq's avatar
gitlabhq committed
7 8 9 10 11 12 13 14 15 16
    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

Nihad Abbasov's avatar
Nihad Abbasov committed
17
  get "errors/gitosis"
gitlabhq's avatar
gitlabhq committed
18 19
  get "profile/password", :to => "profile#password"
  put "profile/password", :to => "profile#password_update"
20
  put "profile/reset_private_token", :to => "profile#reset_private_token"
21
  put "profile/edit", :to => "profile#social_update"
gitlabhq's avatar
gitlabhq committed
22
  get "profile", :to => "profile#show"
gitlabhq's avatar
gitlabhq committed
23
  get "dashboard", :to => "dashboard#index"
gitlabhq's avatar
gitlabhq committed
24 25 26 27
  #get "profile/:id", :to => "profile#show"

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

gitlabhq's avatar
gitlabhq committed
29 30
  devise_for :users

Nihad Abbasov's avatar
Nihad Abbasov committed
31 32
  resources :projects, :except => [:new, :create, :index], :path => "/" do
    member do
gitlabhq's avatar
gitlabhq committed
33 34
      get "team"
      get "wall"
Valery Sizov's avatar
Valery Sizov committed
35
      get "graph"
gitlabhq's avatar
gitlabhq committed
36
    end
gitlabhq's avatar
gitlabhq committed
37

gitlabhq's avatar
gitlabhq committed
38
    resources :refs, :only => [], :path => "/" do 
gitlabhq's avatar
gitlabhq committed
39 40 41 42
      collection do 
        get "switch"
      end

gitlabhq's avatar
gitlabhq committed
43
      member do 
gitlabhq's avatar
gitlabhq committed
44 45 46 47 48 49 50
        get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ }
        get "blob", 
          :constraints => {
            :id => /[a-zA-Z.0-9\/_\-]+/,
            :path => /.*/
          }

gitlabhq's avatar
gitlabhq committed
51

gitlabhq's avatar
gitlabhq committed
52 53 54 55
        # tree viewer
        get "tree/:path" => "refs#tree",
          :as => :tree_file,
          :constraints => {
gitlabhq's avatar
gitlabhq committed
56
            :id => /[a-zA-Z.0-9\/_\-]+/,
gitlabhq's avatar
gitlabhq committed
57 58 59
            :path => /.*/
          }
      end
gitlabhq's avatar
gitlabhq committed
60
    end
gitlabhq's avatar
gitlabhq committed
61

62 63 64 65 66 67
    resources :merge_requests do 
      member do 
        get :diffs
        get :commits
      end
    end
gitlabhq's avatar
gitlabhq committed
68
    resources :snippets
gitlabhq's avatar
gitlabhq committed
69 70
    resources :commits
    resources :team_members
VSizov's avatar
VSizov committed
71 72
    resources :issues do
      collection do
73 74
        post  :sort
        get   :search
Adam Leonard's avatar
Adam Leonard committed
75
      end
VSizov's avatar
VSizov committed
76
    end
gitlabhq's avatar
gitlabhq committed
77 78
    resources :notes, :only => [:create, :destroy]
  end
gitlabhq's avatar
gitlabhq committed
79
  root :to => "dashboard#index"
gitlabhq's avatar
gitlabhq committed
80
end