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

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

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

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

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"
25
  put "profile/edit", :to => "profile#social_update"
G
gitlabhq 已提交
26
  get "profile", :to => "profile#show"
G
gitlabhq 已提交
27
  get "dashboard", :to => "dashboard#index"
G
gitlabhq 已提交
28 29 30 31
  #get "profile/:id", :to => "profile#show"

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

G
gitlabhq 已提交
33 34
  devise_for :users

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

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

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

G
gitlabhq 已提交
55

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

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