2016-06-29 06:57:45 +00:00
|
|
|
Rails.application.routes.draw do
|
|
|
|
locales = Site.first.in_use_locales rescue I18n.available_locales
|
2023-05-21 09:16:16 +00:00
|
|
|
if ENV['worker_num']=='0' && File.basename($0) != 'rake' && !Rails.const_defined?('Console')
|
|
|
|
Thread.new do
|
|
|
|
begin
|
|
|
|
default_keys = ApplicationFormTicketStatus::DefaultKeys
|
|
|
|
if ApplicationFormTicketStatus.count < default_keys.count
|
|
|
|
default_keys.each do |k|
|
|
|
|
ticket_status = ApplicationFormTicketStatus.where(:is_default=>true,:key=>k).first
|
|
|
|
if ticket_status.nil?
|
|
|
|
ApplicationFormTicketStatus.create(:is_default=>true,:key=>k, :title_translations=>locales.map{|l| [l.to_s, I18n.with_locale(l){I18n.t("ask.#{k}")}]}.to_h )
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
rescue => e
|
|
|
|
puts [e, e.backtrace]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2022-06-14 13:19:52 +00:00
|
|
|
Thread.new do
|
2023-01-16 10:02:44 +00:00
|
|
|
ApplicationFormEmailSet.where(:field_name=>nil).destroy
|
2022-06-14 13:19:52 +00:00
|
|
|
end
|
2016-06-29 06:57:45 +00:00
|
|
|
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
|
|
|
|
namespace :admin do
|
2022-05-21 13:48:39 +00:00
|
|
|
resource :application_forms, only: [] do
|
|
|
|
get 'setting'
|
|
|
|
get ':id/print', to: 'application_forms#print'
|
|
|
|
post 'update_setting' => "application_forms#update_setting"
|
|
|
|
|
|
|
|
get 'print_setting'
|
|
|
|
get ':application_form_id/print_setting' => "application_forms#print_setting"
|
|
|
|
|
|
|
|
post 'print_setting_save'
|
2023-05-21 09:16:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
get 'ticket_status'
|
|
|
|
post 'get_ticket_status'
|
|
|
|
post 'update_ticket_status'
|
|
|
|
delete 'delete_ticket_status'
|
2022-05-21 13:48:39 +00:00
|
|
|
end
|
2022-03-10 02:11:18 +00:00
|
|
|
resources :application_forms do
|
2016-06-29 06:57:45 +00:00
|
|
|
member do
|
2022-05-21 13:48:39 +00:00
|
|
|
get 'print'
|
2021-04-03 16:23:52 +00:00
|
|
|
get 'copy'
|
2016-06-29 06:57:45 +00:00
|
|
|
get 'export'
|
|
|
|
get 'set_write_off'
|
2022-03-10 02:11:18 +00:00
|
|
|
get 'application_form_signup'
|
|
|
|
get 'application_form_item_content'
|
|
|
|
get 'application_form_signup_field'
|
|
|
|
get 'application_form_submission_field'
|
|
|
|
get 'application_form_signup_admin_setting'
|
|
|
|
post 'update_application_form_signup_admin_setting'
|
|
|
|
patch 'update_application_form_signup_admin_setting'
|
2021-03-17 07:33:31 +00:00
|
|
|
get 'get_hide_reviewer'
|
2021-04-03 16:23:52 +00:00
|
|
|
get 'get_hide_session'
|
2021-03-17 07:33:31 +00:00
|
|
|
get 'get_reviewer_block'
|
2021-04-03 16:23:52 +00:00
|
|
|
get 'get_session_block'
|
2021-03-17 07:33:31 +00:00
|
|
|
get 'reviewer_setting'
|
|
|
|
post 'update_reviewer_setting'
|
|
|
|
patch 'update_reviewer_setting'
|
2022-03-10 02:11:18 +00:00
|
|
|
post 'update_application_form_session'
|
2021-06-17 10:07:43 +00:00
|
|
|
get 'template_setting'
|
|
|
|
post 'update_template_setting'
|
|
|
|
patch 'update_template_setting'
|
|
|
|
get 'sub_page_setting'
|
2016-06-29 06:57:45 +00:00
|
|
|
end
|
|
|
|
end
|
2022-03-10 02:11:18 +00:00
|
|
|
get 'application_form/enquiry_for_applicants' => "application_forms#enquiry_for_applicants"
|
|
|
|
post 'application_form/update_application_form_review' => "application_forms#update_application_form_review"
|
|
|
|
resources :application_form_items do
|
2016-06-29 06:57:45 +00:00
|
|
|
collection do
|
|
|
|
post 'delete_items'
|
|
|
|
end
|
|
|
|
end
|
2022-03-10 02:11:18 +00:00
|
|
|
resources :application_form_agreements
|
2023-05-21 09:16:16 +00:00
|
|
|
resources :application_form_signups, except: [:edit] do
|
2022-08-13 03:35:29 +00:00
|
|
|
member do
|
|
|
|
get 'view'
|
|
|
|
end
|
|
|
|
end
|
2022-03-10 02:11:18 +00:00
|
|
|
resources :application_form_submission_values
|
|
|
|
resources :application_form_review_results
|
|
|
|
resources :application_form_item_contents
|
2016-06-29 06:57:45 +00:00
|
|
|
end
|
|
|
|
|
2022-03-10 02:11:18 +00:00
|
|
|
resources :application_forms do
|
2016-06-29 06:57:45 +00:00
|
|
|
collection do
|
2022-03-10 02:11:18 +00:00
|
|
|
get ':slug_title-:uid', to: 'application_forms#show'
|
|
|
|
post 'con_login_proc', to: 'application_forms#con_login_proc'
|
|
|
|
post 'con_logout_proc', to: 'application_forms#con_logout_proc'
|
|
|
|
post 'add_file_proc', to: 'application_forms#add_file_proc'
|
|
|
|
post 'edit_file_proc', to: 'application_forms#edit_file_proc'
|
|
|
|
post 'del_file', to: 'application_forms#del_file'
|
2016-06-29 06:57:45 +00:00
|
|
|
end
|
|
|
|
end
|
2023-01-06 07:30:03 +00:00
|
|
|
get '/xhr/application_forms/check_availability', to: 'application_forms#check_availability'
|
2022-06-14 13:19:52 +00:00
|
|
|
get '/xhr/application_forms/agree_link' , to: 'application_forms#agree_link'
|
2016-06-29 06:57:45 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|