routes.rb revision 5f75d904465f5f8e5f29c7d852ec2f16af57b03e
60e51fd2764291df2332f36ff478777627d92b57Sumit Boserequire 'sidekiq/web' if defined? Sidekiq
60e51fd2764291df2332f36ff478777627d92b57Sumit Boserequire Rails.root.join('lib', 'router_constraints.rb')
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose
60e51fd2764291df2332f36ff478777627d92b57Sumit BoseOntohub::Application.routes.draw do
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose # IRI Routing #
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose ###############
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose #
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose get ':repository_id(/*path)/:file',
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose controller: :ontologies,
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose action: :show,
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose as: :ontology_iri,
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose constraints: GroupedConstraint.new(
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose IRIRouterConstraint.new,
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose MIMERouterConstraint.new('text/plain', 'text/html'))
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose get 'ref/:version_number/:repository_id(/*path)/:file',
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose controller: :ontologies,
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose action: :show,
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose as: :versioned_ontology_iri,
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose constraints: GroupedConstraint.new(
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose RefIRIRouterConstraint.new,
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose MIMERouterConstraint.new('text/plain', 'text/html'))
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose #
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose ###############
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :ontology_types, only: :show
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose get '/after_signup', to: 'home#show' , as: 'after_sign_up'
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose devise_for :users, controllers: {
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose confirmations: 'users/confirmations',
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose registrations: 'users/registrations'
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose }
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :users, only: :show
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :keys, except: [:show, :edit, :update]
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :logics, only: [:index, :show] do
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :supports, :only => [:create, :update, :destroy, :index]
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :graphs, :only => [:index]
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose end
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :languages do
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :supports, :only => [:create, :update, :destroy, :index]
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose end
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :language_mappings
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :logic_mappings
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :links, :only => :index
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :categories, :only => [:index, :show]
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :projects
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :tasks
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :license_models
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :formality_levels
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :language_adjoints
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :logic_adjoints
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :serializations
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose namespace :admin do
60e51fd2764291df2332f36ff478777627d92b57Sumit Bose resources :teams, :only => :index
resources :users
resources :jobs, :only => :index
resources :status, only: :index
end
authenticate :user, lambda { |u| u.admin? } do
mount Sidekiq::Web => 'admin/sidekiq'
end
namespace :api, defaults: { format: 'json' } do
namespace :v1 do
resources :categories, only: [:index]
resources :repositories, only: [:index, :update]
resources :ontologies, only: [:index, :update]
end
end
resources :ontologies, only: [:index] do
collection do
get 'search' => 'ontology_search#search'
end
end
resources :links do
get 'update_version', :on => :member
end
resources :teams do
resources :permissions, :only => [:index], :controller => 'teams/permissions'
resources :team_users, :only => [:index, :create, :update, :destroy], :path => 'users'
end
get 'autocomplete' => 'autocomplete#index'
get 'entities_search' => 'entities_search#index'
resources :repositories do
resources :s_s_h_access, :only => :index, path: 'ssh_access'
resources :permissions, :only => [:index, :create, :update, :destroy]
resources :url_maps, except: :show
resources :errors, :only => :index
resources :repository_settings, :only => :index
resources :ontologies, only: [:index, :show, :edit, :update, :destroy] do
collection do
post 'retry_failed' => 'ontologies#retry_failed'
get 'search' => 'ontology_search#search'
end
member do
post 'retry_failed' => 'ontologies#retry_failed'
end
resources :children, :only => :index
resources :entities, :only => :index
resources :sentences, :only => :index
resources :theorems, only: :index
resources :links do
get 'update_version', :on => :member
end
resources :ontology_versions, :only => [:index, :show, :new, :create], :path => 'versions' do
resource :oops_request, :only => [:show, :create]
end
resources :categories
resources :tasks
resources :license_models
resources :tools
resources :projects
resources :metadata, :only => [:index, :create, :destroy]
resources :comments, :only => [:index, :create, :destroy]
resources :graphs, :only => [:index]
resources :formality_levels
end
resources :files, only: [:new, :create]
get ':ref/files(/*path)',
controller: :files,
action: :show,
as: :ref,
constraints: FilesRouterConstraint.new
get ':ref/history(/:path)',
controller: :history,
action: :show,
as: :history,
constraints: { path: /.*/ }
get ':ref/diff',
controller: :diffs,
action: :show,
as: :diffs
# action: entries_info
get ':ref/:action(/:path)',
controller: :files,
as: :ref,
constraints: { path: /.*/ }
end
post ':repository_id/:path',
controller: :files,
action: :update,
as: :repository_tree,
constraints: { path: /.*/ }
get ':repository_id(/*path)',
controller: :files,
action: :show,
as: :repository_tree,
constraints: FilesRouterConstraint.new
get '*path',
controller: :ontologies,
action: :show,
as: :iri,
constraints: IRIRouterConstraint.new
root :to => 'home#index'
end