osem-fcy/config/routes.rb

202 lines
6.2 KiB
Ruby
Raw Normal View History

2013-01-07 09:04:09 +01:00
Osem::Application.routes.draw do
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' },
path: 'accounts'
end
# Use letter_opener_web to open mails in browser (e.g. necessary for Vagrant)
if Rails.env.development?
mount LetterOpenerWeb::Engine, at: "/letter_opener"
end
2017-06-10 19:36:12 +03:00
resources :users, except: [:new, :index, :create, :destroy] do
resources :openids, only: :destroy
end
2013-01-07 09:04:09 +01:00
namespace :admin do
2017-05-31 18:42:52 +05:30
resources :organizations
resources :users do
member do
patch :toggle_confirmation
end
end
resource :ticket_scanning, only: [:create]
2015-08-24 17:17:29 +02:00
resources :comments, only: [:index]
resources :conferences do
2014-08-13 14:37:15 +03:00
resource :contact, except: [:index, :new, :create, :show, :destroy]
resources :schedules, only: [:index, :create, :show, :update, :destroy]
2016-08-04 12:19:32 +02:00
resources :event_schedules, only: [:create, :update, :destroy]
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
end
end
resources :registrations, except: [:create, :new] do
member do
2015-07-10 15:40:11 +02:00
patch :toggle_attendance
end
end
# Singletons
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'
resource :venue_commercial, only: [:create, :update, :destroy]
2015-11-07 11:43:36 +02:00
resources :rooms, except: [:show]
end
resource :registration_period
resource :program do
resources :cfps
resources :tracks do
member do
patch :toggle_cfp_inclusion
patch :restart
patch :to_accept
patch :accept
patch :confirm
patch :to_reject
patch :reject
patch :cancel
end
end
resources :event_types
resources :difficulty_levels
resources :events do
member do
2016-04-22 18:18:46 +03:00
patch :toggle_attendance
get :registrations
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
end
2014-11-12 12:12:57 +01:00
resources :resources
resources :tickets
resources :sponsors, except: [:show]
resources :lodgings, except: [:show]
resources :targets, except: [:show]
resources :campaigns, except: [:show]
resources :emails, only: [:show, :update, :index]
resources :physical_ticket, only: [:index]
resources :roles, only: [:edit]
resources :roles, except: [ :new, :create, :edit ] do
member do
post :toggle_user
get ':track_name' => 'roles#show', as: 'track'
get ':track_name/edit' => 'roles#edit', as: 'track_edit'
patch ':track_name' => 'roles#update'
put ':track_name' => 'roles#update'
post ':track_name/toggle_user' => 'roles#toggle_user', as: 'toggle_user_track'
end
end
resources :sponsorship_levels, except: [:show] do
2014-12-09 15:19:01 +01:00
member do
patch :up
patch :down
end
end
resources :questions do
collection do
patch :update_conference
end
end
2013-01-07 09:04:09 +01:00
end
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-06-06 20:04:39 +05:30
resources :organizations, only: [:index]
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
resource :program, only: [] do
resources :proposals, except: :destroy do
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
patch '/withdraw' => 'proposals#withdraw'
2016-04-22 18:18:46 +03:00
get :registrations
patch '/confirm' => 'proposals#confirm'
patch '/restart' => 'proposals#restart'
end
2014-07-23 16:24:05 +02:00
end
resources :tracks, except: :destroy do
member do
patch :restart
patch :confirm
patch :withdraw
end
end
2013-01-07 09:04:09 +01:00
end
# TODO: change conference_registrations to singular resource
resource :conference_registration, path: 'register'
resources :tickets, only: [:index]
resources :ticket_purchases, only: [:create, :destroy, :index]
resources :payments, only: [:index, :new, :create]
resources :physical_ticket, only: [:index, :show]
resource :subscriptions, only: [:create, :destroy]
resource :schedule, only: [:show] do
member do
get :events
end
2013-01-07 09:04:09 +01:00
end
end
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
end
end
get '/admin' => redirect('/admin/conferences')
2013-01-07 09:04:09 +01:00
root to: 'conferences#index', via: [:get, :options]
2013-01-07 09:04:09 +01:00
end