2018-11-22 14:58:12 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-12-11 22:08:42 -05:00
|
|
|
require 'sidekiq/web'
|
|
|
|
|
2018-11-22 14:33:08 -05:00
|
|
|
Rails.application.routes.draw do
|
2018-12-12 23:50:07 -05:00
|
|
|
#################
|
|
|
|
# Common routes #
|
|
|
|
#################
|
|
|
|
|
2018-11-29 15:57:57 -05:00
|
|
|
root to: 'home#show'
|
|
|
|
|
2019-03-24 15:27:06 -04:00
|
|
|
resources :accounts, param: :nickname, only: :show
|
2019-02-01 16:36:10 -05:00
|
|
|
|
2019-07-22 06:39:32 -04:00
|
|
|
resources :federal_subjects, param: :number, only: %i[index show]
|
2019-01-31 17:38:06 -05:00
|
|
|
|
2019-09-13 15:05:02 -04:00
|
|
|
resources :private_keys, only: :show
|
|
|
|
|
2018-12-12 23:50:07 -05:00
|
|
|
###############
|
|
|
|
# User routes #
|
|
|
|
###############
|
|
|
|
|
2018-11-29 16:28:20 -05:00
|
|
|
devise_for :users, controllers: {
|
2019-04-28 09:34:46 -04:00
|
|
|
sessions: 'users/sessions',
|
|
|
|
registrations: 'users/registrations',
|
|
|
|
confirmations: 'users/confirmations',
|
|
|
|
passwords: 'users/passwords',
|
|
|
|
unlocks: 'users/unlocks',
|
2018-12-03 21:40:12 -05:00
|
|
|
omniauth_callbacks: 'users/omniauth_callbacks',
|
2018-11-29 16:28:20 -05:00
|
|
|
}
|
2018-11-29 15:57:57 -05:00
|
|
|
|
2018-12-12 23:50:07 -05:00
|
|
|
##################
|
|
|
|
# Account routes #
|
|
|
|
##################
|
2018-11-29 08:07:20 -05:00
|
|
|
|
2018-12-11 20:46:29 -05:00
|
|
|
namespace :settings do
|
2019-01-31 22:06:20 -05:00
|
|
|
resource :profile, only: %i[edit update]
|
2019-09-03 19:11:55 -04:00
|
|
|
resource :appearance, only: %i[edit update]
|
2019-09-02 09:33:27 -04:00
|
|
|
resource :person, only: %i[show new]
|
2019-09-03 10:26:08 -04:00
|
|
|
resources :sessions, only: :index
|
2019-09-04 14:51:23 -04:00
|
|
|
|
|
|
|
resources :contacts, only: %i[index create destroy] do
|
|
|
|
resource :security_notification_switch,
|
|
|
|
controller: 'contacts/security_notification_switches',
|
|
|
|
only: :create
|
|
|
|
end
|
2018-12-11 20:46:29 -05:00
|
|
|
end
|
|
|
|
|
2018-12-12 23:50:07 -05:00
|
|
|
#########################
|
|
|
|
# Routes for staff only #
|
|
|
|
#########################
|
|
|
|
|
2019-04-27 09:21:43 -04:00
|
|
|
namespace :staff, module: 'staffs' do
|
2019-03-26 23:02:51 -04:00
|
|
|
root to: 'home#show'
|
|
|
|
|
2018-12-11 22:15:03 -05:00
|
|
|
authenticate :user,
|
|
|
|
->(user) { user.account.can_access_sidekiq_web_interface? } do
|
2018-12-11 22:08:42 -05:00
|
|
|
mount Sidekiq::Web, at: '/sidekiq', as: :sidekiq
|
|
|
|
end
|
|
|
|
|
|
|
|
get '/sidekiq', to: redirect('/', status: 307), as: :forbidden_sidekiq
|
|
|
|
|
2019-08-17 19:44:32 -04:00
|
|
|
resources :contact_networks, only: :index
|
|
|
|
|
2019-08-11 17:13:00 -04:00
|
|
|
resources :accounts, param: :nickname, only: %i[index show]
|
2019-08-11 16:48:50 -04:00
|
|
|
|
2019-09-13 15:05:02 -04:00
|
|
|
resources :x509_certificates, only: %i[index show new create]
|
2019-09-11 04:56:59 -04:00
|
|
|
|
2019-08-28 14:04:50 -04:00
|
|
|
resources :people, only: %i[index show new create] do
|
2019-07-15 17:56:27 -04:00
|
|
|
resources :person_comments,
|
|
|
|
path: 'comments',
|
|
|
|
controller: 'people/person_comments',
|
2019-07-15 19:04:49 -04:00
|
|
|
only: %i[index create]
|
2019-07-15 17:56:27 -04:00
|
|
|
|
2019-08-14 17:26:43 -04:00
|
|
|
resources :relationships,
|
|
|
|
controller: 'people/relationships',
|
|
|
|
only: :index
|
|
|
|
|
2019-03-26 21:24:31 -04:00
|
|
|
resources :passports,
|
|
|
|
controller: 'people/passports',
|
2019-04-28 09:34:46 -04:00
|
|
|
only: :index
|
2019-09-01 09:20:42 -04:00
|
|
|
|
|
|
|
resource :account_connection_link,
|
|
|
|
controller: 'people/account_connection_links',
|
2019-09-01 11:06:38 -04:00
|
|
|
only: %i[show create]
|
2019-03-26 21:24:31 -04:00
|
|
|
end
|
2018-12-11 21:31:38 -05:00
|
|
|
end
|
2018-11-22 14:33:08 -05:00
|
|
|
end
|