2016-06-29 06:57:45 +00:00
|
|
|
Rails.application.routes.draw do
|
2023-01-11 09:46:06 +00:00
|
|
|
OrbitHelper::SharedMutex.synchronize do
|
|
|
|
OrbitHelper::SharedHash['seminar'][:counter] = SeminarMain.where(:signup_limit.ne => nil).map{|v| [v.id, v.seminar_signups.count]}.to_h
|
|
|
|
OrbitHelper::SharedHash['seminar'][:limit] = SeminarMain.where(:signup_limit.ne => nil).map{|v| [v.id, v.signup_limit]}.to_h
|
|
|
|
end
|
2022-04-25 14:37:11 +00:00
|
|
|
Thread.new do
|
|
|
|
if Page.fields.include?('all_pageids')
|
|
|
|
s = Site.first
|
2023-01-16 09:31:46 +00:00
|
|
|
update_flag = s.respond_to?(:tmp_flags)
|
|
|
|
need_update1 = update_flag && !(s.tmp_flags.include?('fix_sr'))
|
2023-01-16 09:36:45 +00:00
|
|
|
need_update2 = !update_flag || !(s.tmp_flags.include?('smer1'))
|
2023-02-07 03:30:38 +00:00
|
|
|
need_update3 = !update_flag || !(s.tmp_flags.include?('smer2'))
|
2023-04-12 04:35:21 +00:00
|
|
|
need_update4 = !update_flag || !(s.tmp_flags.include?('smer3'))
|
2023-01-16 09:31:46 +00:00
|
|
|
if need_update1
|
2022-04-25 14:37:11 +00:00
|
|
|
Page.where(:bind_model=>"SeminarMain",:all_pageids=>nil).each do |p|
|
|
|
|
p.save
|
|
|
|
end
|
2023-02-07 03:30:38 +00:00
|
|
|
Site.update_all("$push"=>{"tmp_flags"=>'fix_sr'})
|
2022-04-25 14:37:11 +00:00
|
|
|
end
|
2023-01-16 09:31:46 +00:00
|
|
|
if need_update2
|
|
|
|
SeminarMain.where(:enable_recaptcha=>nil).each do |seminar_main|
|
|
|
|
seminar_main.update_enable_recaptcha
|
|
|
|
end
|
|
|
|
if update_flag
|
2023-02-07 03:30:38 +00:00
|
|
|
Site.update_all("$push"=>{"tmp_flags"=>'smer1'})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if need_update3
|
|
|
|
SeminarMain.all.to_a.each do |seminar_main|
|
|
|
|
seminar_main.migrate_old
|
|
|
|
end
|
|
|
|
if update_flag
|
|
|
|
Site.update_all("$push"=>{"tmp_flags"=>'smer2'})
|
2023-01-16 09:31:46 +00:00
|
|
|
end
|
|
|
|
end
|
2023-04-12 04:35:21 +00:00
|
|
|
if need_update4
|
|
|
|
in_use_locales = s.in_use_locales.map(&:to_s)
|
|
|
|
Page.where(:parent_page_id.in=>SeminarMain.pluck(:id)).update_all(:enabled_for_mobile=>true, :menu_enabled_for=>in_use_locales, :enabled_for=>in_use_locales)
|
|
|
|
Page.where(:parent_page_id.in=>SeminarMain.pluck(:id)).each do |p|
|
|
|
|
p.find_page.each do |pp|
|
|
|
|
if pp[:enabled_for_mobile].class == Array
|
|
|
|
pp.enabled_for_mobile = pp[:enabled_for_mobile].present?
|
|
|
|
pp.save
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if update_flag
|
|
|
|
Site.update_all("$push"=>{"tmp_flags"=>'smer3'})
|
|
|
|
end
|
|
|
|
end
|
2022-04-25 14:37:11 +00:00
|
|
|
end
|
2023-04-12 03:33:32 +00:00
|
|
|
SeminarSignupField.create_indexes
|
|
|
|
SeminarSubmissionField.create_indexes
|
2022-04-25 14:37:11 +00:00
|
|
|
end
|
2016-06-29 06:57:45 +00:00
|
|
|
locales = Site.first.in_use_locales rescue I18n.available_locales
|
2023-10-04 16:38:24 +00:00
|
|
|
|
2016-06-29 06:57:45 +00:00
|
|
|
scope "(:locale)", locale: Regexp.new(locales.join("|")) do
|
|
|
|
namespace :admin do
|
|
|
|
resources :seminars do
|
|
|
|
member do
|
2021-04-03 16:23:52 +00:00
|
|
|
get 'copy'
|
2016-06-29 06:57:45 +00:00
|
|
|
get 'export'
|
|
|
|
get 'set_write_off'
|
|
|
|
get 'seminar_signup'
|
|
|
|
get 'seminar_item_content'
|
|
|
|
get 'seminar_signup_field'
|
2023-10-05 11:40:03 +00:00
|
|
|
get 'seminar_signup_success'
|
|
|
|
patch 'seminar_signup_success_save'
|
2019-11-26 15:52:52 +00:00
|
|
|
get 'seminar_submission_field'
|
2021-03-17 07:33:31 +00:00
|
|
|
get 'seminar_signup_admin_setting'
|
|
|
|
post 'update_seminar_signup_admin_setting'
|
|
|
|
patch 'update_seminar_signup_admin_setting'
|
|
|
|
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'
|
2021-04-03 16:23:52 +00:00
|
|
|
post 'update_seminar_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
|
2023-10-10 14:49:16 +00:00
|
|
|
collection do
|
|
|
|
post "send_notifying_email"
|
|
|
|
get "get_predefined_text"
|
|
|
|
end
|
2016-06-29 06:57:45 +00:00
|
|
|
end
|
2021-03-17 07:33:31 +00:00
|
|
|
get 'seminar/enquiry_for_applicants' => "seminars#enquiry_for_applicants"
|
|
|
|
post 'seminar/update_seminar_review' => "seminars#update_seminar_review"
|
2016-06-29 06:57:45 +00:00
|
|
|
resources :seminar_items do
|
|
|
|
collection do
|
|
|
|
post 'delete_items'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
resources :seminar_agreements
|
|
|
|
resources :seminar_signups
|
2021-04-24 10:41:50 +00:00
|
|
|
resources :seminar_submission_values
|
|
|
|
resources :seminar_review_results
|
2016-06-29 06:57:45 +00:00
|
|
|
resources :seminar_item_contents
|
|
|
|
end
|
|
|
|
|
|
|
|
resources :seminars do
|
|
|
|
collection do
|
|
|
|
get ':slug_title-:uid', to: 'seminars#show'
|
|
|
|
post 'con_login_proc', to: 'seminars#con_login_proc'
|
|
|
|
post 'con_logout_proc', to: 'seminars#con_logout_proc'
|
2023-10-04 16:38:24 +00:00
|
|
|
post 'reset_password_proc', to: 'seminars#reset_password_proc'
|
|
|
|
post 'reset_confirm_password_proc', to: 'seminars#reset_confirm_password_proc'
|
2016-06-29 06:57:45 +00:00
|
|
|
post 'add_file_proc', to: 'seminars#add_file_proc'
|
|
|
|
post 'edit_file_proc', to: 'seminars#edit_file_proc'
|
|
|
|
post 'del_file', to: 'seminars#del_file'
|
2023-10-07 14:34:07 +00:00
|
|
|
patch 'update_signup_form', to: 'seminars#update_signup_form'
|
2016-06-29 06:57:45 +00:00
|
|
|
end
|
|
|
|
end
|
2023-10-10 02:14:57 +00:00
|
|
|
get "/xhr/seminars/check_email/:no" => "seminars#check_email"
|
2016-06-29 06:57:45 +00:00
|
|
|
end
|
2023-10-04 16:38:24 +00:00
|
|
|
|
2016-06-29 06:57:45 +00:00
|
|
|
end
|