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

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

7 8 9
  get 'tags'=> 'tags#index'
  get 'tags/:tag' => 'projects#index'

N
Nihad Abbasov 已提交
10
  namespace :admin do
G
gitlabhq 已提交
11
    resources :users
12
    resources :projects, :constraints => { :id => /[^\/]+/ }
G
gitlabhq 已提交
13 14 15 16 17 18 19 20
    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

21
  get "errors/githost"
G
gitlabhq 已提交
22 23
  get "profile/password", :to => "profile#password"
  put "profile/password", :to => "profile#password_update"
24
  put "profile/reset_private_token", :to => "profile#reset_private_token"
G
gitlabhq 已提交
25
  get "profile", :to => "profile#show"
26 27
  get "profile/design", :to => "profile#design"
  put "profile/update", :to => "profile#update"
D
Dmitriy Zaporozhets 已提交
28

G
gitlabhq 已提交
29
  get "dashboard", :to => "dashboard#index"
D
Dmitriy Zaporozhets 已提交
30 31
  get "dashboard/issues", :to => "dashboard#issues"
  get "dashboard/merge_requests", :to => "dashboard#merge_requests"
A
Ariejan de Vroom 已提交
32

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

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

G
gitlabhq 已提交
38 39
  devise_for :users

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

G
gitlabhq 已提交
49
    resources :refs, :only => [], :path => "/" do 
G
gitlabhq 已提交
50 51 52 53
      collection do 
        get "switch"
      end

G
gitlabhq 已提交
54
      member do 
G
gitlabhq 已提交
55 56 57 58 59 60 61
        get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ }
        get "blob", 
          :constraints => {
            :id => /[a-zA-Z.0-9\/_\-]+/,
            :path => /.*/
          }

G
gitlabhq 已提交
62

G
gitlabhq 已提交
63 64 65 66
        # tree viewer
        get "tree/:path" => "refs#tree",
          :as => :tree_file,
          :constraints => {
G
gitlabhq 已提交
67
            :id => /[a-zA-Z.0-9\/_\-]+/,
G
gitlabhq 已提交
68 69 70
            :path => /.*/
          }
      end
G
gitlabhq 已提交
71
    end
G
gitlabhq 已提交
72

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