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'
|
|
|
|
|
2018-12-14 01:26:42 -05:00
|
|
|
get :application, to: 'membership_apps#show'
|
|
|
|
get :join, to: 'membership_apps#new'
|
|
|
|
post :join, to: 'membership_apps#create'
|
2018-12-12 23:50:07 -05:00
|
|
|
|
|
|
|
###############
|
|
|
|
# User routes #
|
|
|
|
###############
|
|
|
|
|
2018-11-29 16:28:20 -05:00
|
|
|
devise_for :users, controllers: {
|
2018-12-03 21:40:12 -05:00
|
|
|
sessions: 'users/sessions',
|
|
|
|
registrations: 'users/registrations',
|
|
|
|
confirmations: 'users/confirmations',
|
|
|
|
passwords: 'users/passwords',
|
|
|
|
unlocks: 'users/unlocks',
|
|
|
|
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
|
|
|
|
resources :telegram_contacts, only: :index
|
|
|
|
end
|
|
|
|
|
2018-12-12 23:54:55 -05:00
|
|
|
######################################
|
|
|
|
# Callbacks for third-party services #
|
|
|
|
######################################
|
|
|
|
|
|
|
|
resources :telegram_bots, only: [] do
|
|
|
|
resources :updates,
|
|
|
|
controller: 'telegram_bots/updates',
|
|
|
|
only: :create
|
|
|
|
end
|
|
|
|
|
2018-12-12 23:50:07 -05:00
|
|
|
#########################
|
|
|
|
# Routes for staff only #
|
|
|
|
#########################
|
|
|
|
|
2018-12-11 21:31:38 -05:00
|
|
|
namespace :staff do
|
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
|
|
|
|
|
2018-12-12 21:40:04 -05:00
|
|
|
resources :passports, only: %i[index show new create] do
|
|
|
|
resources :passport_confirmations,
|
|
|
|
controller: 'passports/passport_confirmations',
|
|
|
|
only: %i[index create]
|
|
|
|
end
|
2018-12-12 21:21:12 -05:00
|
|
|
|
2018-12-13 00:02:35 -05:00
|
|
|
resources :membership_apps, only: %i[index show]
|
2018-12-12 21:45:22 -05:00
|
|
|
resources :telegram_bots, only: %i[index show]
|
2018-12-11 21:31:38 -05:00
|
|
|
resources :telegram_chats, only: %i[index show]
|
|
|
|
end
|
2018-11-22 14:33:08 -05:00
|
|
|
end
|