2013-01-07 09:04:09 +01:00
|
|
|
Osem::Application.routes.draw do
|
2021-04-11 13:53:41 +03:00
|
|
|
mount LetterOpenerWeb::Engine, at: '/letter_opener' if Rails.env.development?
|
2013-01-07 09:04:09 +01:00
|
|
|
|
2017-07-22 12:34:48 +05:30
|
|
|
constraints DomainConstraint do
|
|
|
|
|
get '/', to: 'conferences#show'
|
|
|
|
|
end
|
|
|
|
|
|
2016-03-22 18:14:40 +01:00
|
|
|
if ENV['OSEM_ICHAIN_ENABLED'] == 'true'
|
2014-11-04 17:42:47 +01:00
|
|
|
devise_for :users, controllers: { registrations: :registrations }
|
|
|
|
|
else
|
|
|
|
|
devise_for :users,
|
|
|
|
|
controllers: {
|
2014-11-30 20:06:12 +02:00
|
|
|
registrations: :registrations, confirmations: :confirmations,
|
2014-11-04 17:42:47 +01:00
|
|
|
omniauth_callbacks: 'users/omniauth_callbacks' },
|
2018-11-13 18:01:49 -08:00
|
|
|
path: 'accounts'
|
2014-11-04 17:42:47 +01:00
|
|
|
end
|
|
|
|
|
|
2017-06-10 19:36:12 +03:00
|
|
|
resources :users, except: [:new, :index, :create, :destroy] do
|
2022-02-16 14:07:23 +01:00
|
|
|
collection do
|
|
|
|
|
get :search
|
|
|
|
|
end
|
2017-06-10 19:36:12 +03:00
|
|
|
resources :openids, only: :destroy
|
|
|
|
|
end
|
2013-01-07 09:04:09 +01:00
|
|
|
|
|
|
|
|
namespace :admin do
|
2017-08-22 17:25:34 +05:30
|
|
|
resources :organizations do
|
|
|
|
|
member do
|
|
|
|
|
get :admins
|
|
|
|
|
post :assign_org_admins
|
|
|
|
|
delete :unassign_org_admins
|
|
|
|
|
end
|
|
|
|
|
end
|
2016-07-11 04:41:25 -04:00
|
|
|
resources :users do
|
|
|
|
|
member do
|
|
|
|
|
patch :toggle_confirmation
|
|
|
|
|
end
|
|
|
|
|
end
|
2017-07-18 02:57:46 +05:30
|
|
|
resource :ticket_scanning, only: [:create]
|
2015-08-24 17:17:29 +02:00
|
|
|
resources :comments, only: [:index]
|
2016-09-14 22:42:04 -04:00
|
|
|
resources :conferences do
|
2016-06-28 18:16:06 +03:00
|
|
|
resources :surveys do
|
|
|
|
|
resources :survey_questions, except: :index
|
|
|
|
|
end
|
2014-08-13 14:37:15 +03:00
|
|
|
resource :contact, except: [:index, :new, :create, :show, :destroy]
|
2017-08-09 18:12:20 +03:00
|
|
|
resources :schedules, except: [:edit, :update]
|
2016-08-04 12:19:32 +02:00
|
|
|
resources :event_schedules, only: [:create, :update, :destroy]
|
2015-04-22 21:30:32 +02:00
|
|
|
get 'commercials/render_commercial' => 'commercials#render_commercial'
|
|
|
|
|
resources :commercials, only: [:index, :create, :update, :destroy]
|
2014-06-12 19:49:54 +03:00
|
|
|
get '/volunteers_list' => 'volunteers#show'
|
|
|
|
|
get '/volunteers' => 'volunteers#index', as: 'volunteers_info'
|
|
|
|
|
patch '/volunteers' => 'volunteers#update', as: 'volunteers_update'
|
2014-05-15 20:55:27 +03:00
|
|
|
|
2017-05-17 13:31:27 +03:00
|
|
|
resources :booths do
|
|
|
|
|
member do
|
|
|
|
|
patch :accept
|
|
|
|
|
patch :restart
|
|
|
|
|
patch :to_accept
|
|
|
|
|
patch :reject
|
|
|
|
|
patch :reset
|
|
|
|
|
patch :to_reject
|
|
|
|
|
patch :cancel
|
2017-08-11 15:14:22 +03:00
|
|
|
patch :confirm
|
2017-05-17 13:31:27 +03:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2014-11-25 10:47:18 +01:00
|
|
|
resources :registrations, except: [:create, :new] do
|
|
|
|
|
member do
|
2015-07-10 15:40:11 +02:00
|
|
|
patch :toggle_attendance
|
|
|
|
|
|
2014-11-25 10:47:18 +01:00
|
|
|
end
|
|
|
|
|
end
|
2014-08-18 14:33:02 +02:00
|
|
|
|
2014-11-25 10:47:18 +01:00
|
|
|
# Singletons
|
2014-08-30 12:08:24 +02:00
|
|
|
resource :splashpage
|
2015-11-07 11:43:36 +02:00
|
|
|
resource :venue do
|
2016-04-03 22:08:46 +05:30
|
|
|
get 'venue_commercial/render_commercial' => 'venue_commercials#render_commercial'
|
2016-04-03 19:25:41 +05:30
|
|
|
resource :venue_commercial, only: [:create, :update, :destroy]
|
2015-11-07 11:43:36 +02:00
|
|
|
resources :rooms, except: [:show]
|
|
|
|
|
end
|
2014-11-25 10:47:18 +01:00
|
|
|
resource :registration_period
|
2015-10-25 13:29:02 +02:00
|
|
|
resource :program do
|
2017-05-31 21:03:15 +03:00
|
|
|
resources :cfps
|
2017-06-08 12:25:33 +03:00
|
|
|
resources :tracks do
|
|
|
|
|
member do
|
|
|
|
|
patch :toggle_cfp_inclusion
|
2017-07-14 15:57:34 +03:00
|
|
|
patch :restart
|
|
|
|
|
patch :to_accept
|
|
|
|
|
patch :accept
|
|
|
|
|
patch :confirm
|
|
|
|
|
patch :to_reject
|
|
|
|
|
patch :reject
|
|
|
|
|
patch :cancel
|
2017-08-09 18:12:20 +03:00
|
|
|
patch :update_selected_schedule
|
2017-06-08 12:25:33 +03:00
|
|
|
end
|
2017-08-17 13:36:46 +03:00
|
|
|
resources :roles, only: [:show, :edit, :update] do
|
|
|
|
|
member do
|
|
|
|
|
post :toggle_user
|
|
|
|
|
end
|
|
|
|
|
end
|
2017-06-08 12:25:33 +03:00
|
|
|
end
|
2015-10-25 13:29:02 +02:00
|
|
|
resources :event_types
|
|
|
|
|
resources :difficulty_levels
|
2017-01-11 16:45:58 +02:00
|
|
|
post 'mass_upload_commercials' => 'commercials#mass_upload'
|
2015-10-25 13:29:02 +02:00
|
|
|
resources :events do
|
|
|
|
|
member do
|
2016-04-22 18:18:46 +03:00
|
|
|
patch :toggle_attendance
|
|
|
|
|
get :registrations
|
2015-10-25 13:29:02 +02:00
|
|
|
post :comment
|
|
|
|
|
patch :accept
|
|
|
|
|
patch :confirm
|
|
|
|
|
patch :cancel
|
|
|
|
|
patch :reject
|
|
|
|
|
patch :unconfirm
|
|
|
|
|
patch :restart
|
|
|
|
|
get :vote
|
|
|
|
|
end
|
|
|
|
|
end
|
2017-03-03 15:45:06 +02:00
|
|
|
resources :reports, only: :index
|
2015-10-25 13:29:02 +02:00
|
|
|
end
|
2014-11-12 12:12:57 +01:00
|
|
|
|
2017-02-06 16:11:22 +05:30
|
|
|
resources :resources
|
2014-11-25 10:47:18 +01:00
|
|
|
resources :tickets
|
|
|
|
|
resources :sponsors, except: [:show]
|
|
|
|
|
resources :lodgings, except: [:show]
|
|
|
|
|
resources :emails, only: [:show, :update, :index]
|
2017-09-26 21:43:18 +05:30
|
|
|
resources :physical_tickets, only: [:index]
|
2017-08-17 13:36:46 +03:00
|
|
|
resources :roles, except: [:new, :create] do
|
2015-01-12 23:13:10 +02:00
|
|
|
member do
|
|
|
|
|
post :toggle_user
|
|
|
|
|
end
|
|
|
|
|
end
|
2014-05-13 14:17:39 +02:00
|
|
|
|
2014-11-14 11:58:36 +01:00
|
|
|
resources :sponsorship_levels, except: [:show] do
|
2014-12-09 15:19:01 +01:00
|
|
|
member do
|
|
|
|
|
patch :up
|
|
|
|
|
patch :down
|
|
|
|
|
end
|
2014-11-14 11:58:36 +01:00
|
|
|
end
|
2014-06-05 14:52:44 +05:30
|
|
|
|
2014-11-25 10:47:18 +01:00
|
|
|
resources :questions do
|
2014-05-13 14:17:39 +02:00
|
|
|
collection do
|
2014-11-25 10:47:18 +01:00
|
|
|
patch :update_conference
|
2014-05-13 14:17:39 +02:00
|
|
|
end
|
|
|
|
|
end
|
2016-08-06 17:22:53 +05:30
|
|
|
|
|
|
|
|
get '/revision_history' => 'versions#index'
|
2013-01-07 09:04:09 +01:00
|
|
|
end
|
2016-05-24 23:54:46 +05:30
|
|
|
|
|
|
|
|
get '/revision_history' => 'versions#index'
|
|
|
|
|
get '/revision_history/:id/revert_object' => 'versions#revert_object', as: 'revision_history_revert_object'
|
|
|
|
|
get '/revision_history/:id/revert_attribute' => 'versions#revert_attribute', as: 'revision_history_revert_attribute'
|
2013-01-07 09:04:09 +01:00
|
|
|
end
|
2017-10-11 20:22:32 -07:00
|
|
|
resources :organizations, only: [:index] do
|
|
|
|
|
member do
|
2018-03-16 12:18:09 -07:00
|
|
|
get :conferences, 'code-of-conduct'
|
2017-10-11 20:22:32 -07:00
|
|
|
end
|
|
|
|
|
end
|
2016-09-14 22:42:04 -04:00
|
|
|
resources :conferences, only: [:index, :show] do
|
2017-07-20 14:20:46 +03:00
|
|
|
resources :booths do
|
|
|
|
|
member do
|
|
|
|
|
patch :withdraw
|
|
|
|
|
patch :confirm
|
|
|
|
|
patch :restart
|
|
|
|
|
end
|
|
|
|
|
end
|
2016-06-28 18:16:06 +03:00
|
|
|
resources :surveys, only: [:index, :show] do
|
|
|
|
|
member do
|
|
|
|
|
post :reply
|
|
|
|
|
end
|
|
|
|
|
end
|
2016-05-23 15:18:25 +02:00
|
|
|
resource :program, only: [] do
|
2019-02-21 15:57:20 +01:00
|
|
|
get 'proposal/:id', to: 'proposals#show' # For backward compatibility
|
2016-09-14 22:42:04 -04:00
|
|
|
resources :proposals, except: :destroy do
|
2015-10-25 13:29:02 +02:00
|
|
|
get 'commercials/render_commercial' => 'commercials#render_commercial'
|
|
|
|
|
resources :commercials, only: [:create, :update, :destroy]
|
|
|
|
|
member do
|
2016-04-22 18:18:46 +03:00
|
|
|
get :registrations
|
2016-09-14 22:42:04 -04:00
|
|
|
patch '/withdraw' => 'proposals#withdraw'
|
|
|
|
|
patch '/confirm' => 'proposals#confirm'
|
|
|
|
|
patch '/restart' => 'proposals#restart'
|
2015-10-25 13:29:02 +02:00
|
|
|
end
|
2014-07-23 16:24:05 +02:00
|
|
|
end
|
2017-07-14 15:57:34 +03:00
|
|
|
resources :tracks, except: :destroy do
|
|
|
|
|
member do
|
|
|
|
|
patch :restart
|
|
|
|
|
patch :confirm
|
|
|
|
|
patch :withdraw
|
|
|
|
|
end
|
|
|
|
|
end
|
2013-01-07 09:04:09 +01:00
|
|
|
end
|
2014-08-22 15:08:54 +02:00
|
|
|
|
2016-03-23 11:42:40 +05:30
|
|
|
# TODO: change conference_registrations to singular resource
|
2016-07-05 00:10:18 +05:30
|
|
|
resource :conference_registration, path: 'register'
|
2014-08-28 15:21:05 +02:00
|
|
|
resources :tickets, only: [:index]
|
2017-06-26 06:07:52 +05:30
|
|
|
resources :ticket_purchases, only: [:create, :destroy, :index]
|
2016-07-27 19:37:02 +05:30
|
|
|
resources :payments, only: [:index, :new, :create]
|
2017-09-26 21:43:18 +05:30
|
|
|
resources :physical_tickets, only: [:index, :show]
|
2014-10-31 22:45:15 +02:00
|
|
|
resource :subscriptions, only: [:create, :destroy]
|
2016-07-29 22:02:01 +02:00
|
|
|
resource :schedule, only: [:show] do
|
2019-05-24 15:11:53 +02:00
|
|
|
collection do
|
|
|
|
|
get 'app'
|
|
|
|
|
end
|
2016-07-29 22:02:01 +02:00
|
|
|
member do
|
|
|
|
|
get :events
|
|
|
|
|
end
|
2013-01-07 09:04:09 +01:00
|
|
|
end
|
|
|
|
|
end
|
2013-07-04 14:02:50 +02:00
|
|
|
|
|
|
|
|
namespace :api, defaults: {format: 'json'} do
|
|
|
|
|
namespace :v1 do
|
2015-10-25 00:36:23 +03:00
|
|
|
resources :conferences, only: [ :index, :show ] do
|
2014-07-21 14:49:05 +02:00
|
|
|
resources :rooms, only: :index
|
|
|
|
|
resources :tracks, only: :index
|
|
|
|
|
resources :speakers, only: :index
|
|
|
|
|
resources :events, only: :index
|
2013-07-08 10:07:12 +02:00
|
|
|
end
|
2014-07-21 14:49:05 +02:00
|
|
|
resources :rooms, only: :index
|
|
|
|
|
resources :tracks, only: :index
|
|
|
|
|
resources :speakers, only: :index
|
|
|
|
|
resources :events, only: :index
|
2013-07-04 14:02:50 +02:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2016-09-14 22:42:04 -04:00
|
|
|
get '/admin' => redirect('/admin/conferences')
|
2013-01-07 09:04:09 +01:00
|
|
|
|
2021-02-14 22:56:45 +01:00
|
|
|
get '/calendar' => 'conferences#calendar'
|
|
|
|
|
|
2018-03-03 21:36:20 -08:00
|
|
|
unless ENV['OSEM_ROOT_CONFERENCE'].blank?
|
|
|
|
|
root to: redirect("/conferences/#{ENV['OSEM_ROOT_CONFERENCE']}")
|
|
|
|
|
else
|
|
|
|
|
root to: 'conferences#index', via: [:get, :options]
|
|
|
|
|
end
|
2013-01-07 09:04:09 +01:00
|
|
|
end
|