Fix sign up link.

This commit is contained in:
BoHung Chiu 2022-04-14 13:07:15 +08:00
parent c5d58fb6e0
commit 3fb9d052ac
1 changed files with 3 additions and 1 deletions

View File

@ -160,6 +160,8 @@ class SeminarsController < ApplicationController
"time_now" => time_now
}
@_request = OrbitHelper.request
@custom_slug = "registration"
@registration_postfix = ""
if template_info["main_content"]
main_content = render_other_method("show_data",template_info["main_content"])
else
@ -307,7 +309,7 @@ class SeminarsController < ApplicationController
seminar = SeminarMain.find_by(uid: params[:uid])
if !seminar.registration_status.blank? && seminar.signup_start_date <= time_now && ( seminar.signup_end_date.nil? || seminar.signup_end_date+1 >= time_now )
sign_up = ('<a href="'+ OrbitHelper.url_to_show(seminar.to_param) + @registration_postfix.to_s + '" target="_blank">' + t('seminar.signup') + '</a>').html_safe
sign_up = ('<a href="'+ (@custom_slug ? OrbitHelper.url_to_show(@custom_slug) : OrbitHelper.url_to_show(seminar.to_param)) + @registration_postfix.to_s + '" target="_blank">' + t('seminar.signup') + '</a>').html_safe
elsif seminar.registration_status.blank?
sign_up = t('seminar.sign_up_not_open')
elsif seminar.signup_start_date > time_now