-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathroutes.rb
90 lines (67 loc) · 3 KB
/
routes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Rails.application.routes.draw do
concern :range_searchable, BlacklightRangeLimit::Routes::RangeSearchable.new
mount Bulkrax::Engine, at: '/'
mount Riiif::Engine => 'images', as: :riiif if Hyrax.config.iiif_image_server?
get '/browse', to: redirect('/catalog')
get '/etd/:id', to: redirect('/concern/gw_etds/%{id}')
get '/etds/:id', to: redirect('/concern/gw_etds/%{id}')
get '/files/:id', to: redirect('concern/gw_works/%{id}')
get '/works/:id', to: redirect('concern/gw_works/%{id}')
get '/work/:id', to: redirect('concern/gw_works/%{id}')
mount Blacklight::Engine => '/'
mount BlacklightAdvancedSearch::Engine => '/'
get 'advanced' => 'advanced#index'
get 'advanced/range_limit' => 'advanced#range_limit'
concern :exportable, Blacklight::Routes::Exportable.new
concern :searchable, Blacklight::Routes::Searchable.new
concern :oai_provider, BlacklightOaiProvider::Routes.new
concern :range_searchable, BlacklightRangeLimit::Routes::RangeSearchable.new
resource :catalog, only: [:index], as: 'catalog', path: '/catalog', controller: 'catalog' do
concerns :oai_provider
concerns :searchable
concerns :range_searchable
end
devise_for :users, controllers: { omniauth_callbacks: 'users/omniauth_callbacks',
sessions: 'users/sessions' }
mount Hydra::RoleManagement::Engine => '/'
mount Qa::Engine => '/authorities'
mount Hyrax::Engine, at: '/'
resources :welcome, only: 'index'
root 'hyrax/homepage#index'
curation_concerns_basic_routes
resources :solr_documents, only: [:show], path: '/catalog', controller: 'catalog' do
concerns :exportable
end
resources :bookmarks do
concerns :exportable
collection do
delete 'clear'
end
end
require 'sidekiq/web'
authenticate :user, lambda { |u| u.admin? } do
mount Sidekiq::Web => '/sidekiq'
end
match '*path', to: 'errors#not_found', via: :all, format: false, defaults: { format: 'html' }
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
Hyrax::Engine.routes.draw do
concern :range_searchable, BlacklightRangeLimit::Routes::RangeSearchable.new
get 'share' =>'pages#show', key: 'share'
resources :collections, only: [:index], controller: "collections_page"
redirect_all_proc = Proc.new { match '(*any)', to: redirect('/'), via: [:get, :post] }
# Redirects non-privileged users to the application homepage
authenticate :user, lambda { |u| !u.admin? && !u.contentadmin? } do
namespace :dashboard, &redirect_all_proc
namespace :notifications, &redirect_all_proc
end
end
Bulkrax::Engine.routes.draw do
concern :range_searchable, BlacklightRangeLimit::Routes::RangeSearchable.new
# Redirects non-privileged users to the application homepage
redirect_all_proc = Proc.new { match '(*any)', to: redirect('/'), via: [:get, :post] }
authenticate :user, lambda { |u| !u.admin? && !u.contentadmin? } do
namespace :importers, &redirect_all_proc
namespace :exporters, &redirect_all_proc
end
end