Skip to content
Snippets Groups Projects
routes.rb 3.57 KiB
Newer Older
  • Learn to ignore specific revisions
  • gitlabhq's avatar
    gitlabhq committed
    Gitlab::Application.routes.draw do
    
      get 'search' => "search#show"
    
    Valery Sizov's avatar
    Valery Sizov committed
    
    
      # Optionally, enable Resque here
    
      require 'resque/server'
      mount Resque::Server.new, at: '/info/resque'
    
      get 'help' => 'help#index'
    
      get 'help/permissions' => 'help#permissions'
      get 'help/workflow' => 'help#workflow'
    
      get 'help/web_hooks' => 'help#web_hooks'
    
    Nihad Abbasov's avatar
    Nihad Abbasov committed
      namespace :admin do
    
    Dmitriy Zaporozhets's avatar
    Dmitriy Zaporozhets committed
        resources :users do 
          member do 
            put :team_update
    
            put :block
            put :unblock
    
    Dmitriy Zaporozhets's avatar
    Dmitriy Zaporozhets committed
          end
        end
    
        resources :projects, :constraints => { :id => /[^\/]+/ } do 
          member do 
            get :team
            put :team_update
          end
        end
    
    Dmitriy Zaporozhets's avatar
    Dmitriy Zaporozhets committed
        resources :team_members, :only => [:edit, :update, :destroy]
    
    gitlabhq's avatar
    gitlabhq committed
        get 'emails', :to => 'mailer#preview'
        get 'mailer/preview_note'
        get 'mailer/preview_user_new'
        get 'mailer/preview_issue_new'
    
    randx's avatar
    randx committed
        root :to => "dashboard#index"
    
    gitlabhq's avatar
    gitlabhq committed
      end
    
    
      get "errors/githost"
    
    gitlabhq's avatar
    gitlabhq committed
      get "profile/password", :to => "profile#password"
      put "profile/password", :to => "profile#password_update"
    
      get "profile/token", :to => "profile#token"
    
      put "profile/reset_private_token", :to => "profile#reset_private_token"
    
    gitlabhq's avatar
    gitlabhq committed
      get "profile", :to => "profile#show"
    
      get "profile/design", :to => "profile#design"
      put "profile/update", :to => "profile#update"
    
    Dmitriy Zaporozhets's avatar
    Dmitriy Zaporozhets committed
    
      get "dashboard/issues", :to => "dashboard#issues"
      get "dashboard/merge_requests", :to => "dashboard#merge_requests"
    
    gitlabhq's avatar
    gitlabhq committed
    
    
      resources :projects, :constraints => { :id => /[^\/]+/ }, :only => [:new, :create, :index]
    
    gitlabhq's avatar
    gitlabhq committed
      resources :keys
    
    vsizov's avatar
    vsizov committed
      devise_for :users, :controllers => { :omniauth_callbacks => :omniauth_callbacks }
    
    gitlabhq's avatar
    gitlabhq committed
    
    
      resources :projects, :constraints => { :id => /[^\/]+/ }, :except => [:new, :create, :index], :path => "/" do
    
    Nihad Abbasov's avatar
    Nihad Abbasov committed
        member do
    
    gitlabhq's avatar
    gitlabhq committed
          get "team"
          get "wall"
    
    Valery Sizov's avatar
    Valery Sizov committed
          get "graph"
    
    gitlabhq's avatar
    gitlabhq committed
        end
    
    gitlabhq's avatar
    gitlabhq committed
    
    
    Valery Sizov's avatar
    Valery Sizov committed
        resources :wikis, :only => [:show, :edit, :destroy, :create] do
          member do
    
    vsizov's avatar
    vsizov committed
            get "history"        
    
    Valery Sizov's avatar
    Valery Sizov committed
          end
        end
    
        resource :repository do 
          member do 
            get "branches"
            get "tags"
    
            get "archive"
    
    miks's avatar
    miks committed
        resources :deploy_keys
    
        resources :protected_branches, :only => [:index, :create, :destroy]
    
    gitlabhq's avatar
    gitlabhq committed
        resources :refs, :only => [], :path => "/" do 
    
    gitlabhq's avatar
    gitlabhq committed
          collection do 
            get "switch"
          end
    
    
    gitlabhq's avatar
    gitlabhq committed
          member do 
    
    gitlabhq's avatar
    gitlabhq committed
            get "tree", :constraints => { :id => /[a-zA-Z.\/0-9_\-]+/ }
            get "blob", 
              :constraints => {
                :id => /[a-zA-Z.0-9\/_\-]+/,
                :path => /.*/
              }
    
    
    gitlabhq's avatar
    gitlabhq committed
    
    
    gitlabhq's avatar
    gitlabhq committed
            # tree viewer
            get "tree/:path" => "refs#tree",
              :as => :tree_file,
              :constraints => {
    
    gitlabhq's avatar
    gitlabhq committed
                :id => /[a-zA-Z.0-9\/_\-]+/,
    
    gitlabhq's avatar
    gitlabhq committed
                :path => /.*/
              }
    
    
            # blame
            get "blame/:path" => "refs#blame",
              :as => :blame_file,
              :constraints => {
                :id => /[a-zA-Z.0-9\/_\-]+/,
                :path => /.*/
              }
    
    gitlabhq's avatar
    gitlabhq committed
          end
    
    gitlabhq's avatar
    gitlabhq committed
        end
    
    gitlabhq's avatar
    gitlabhq committed
    
    
        resources :merge_requests do 
          member do 
            get :diffs
    
    randx's avatar
    randx committed
            get :automerge
    
            get :automerge_check
    
    
          collection do 
            get :branch_from
            get :branch_to
          end
    
        resources :snippets do 
          member do 
            get "raw"
          end
        end
    
    
        resources :hooks, :only => [:index, :create, :destroy] do 
    
        resources :commits do 
          collection do 
            get :compare
          end
        end
    
    gitlabhq's avatar
    gitlabhq committed
        resources :team_members
    
        resources :milestones
    
    VSizov's avatar
    VSizov committed
        resources :issues do
          collection do
    
            post  :sort
            get   :search
    
    VSizov's avatar
    VSizov committed
        end
    
        resources :notes, :only => [:index, :create, :destroy]
    
    gitlabhq's avatar
    gitlabhq committed
      end
    
      root :to => "projects#index"
    
    gitlabhq's avatar
    gitlabhq committed
    end