This commit is contained in:
BoHung Chiu 2022-06-08 22:22:24 +08:00
parent 50824d7932
commit 2cd08c4731
2 changed files with 10 additions and 9 deletions

View File

@ -172,8 +172,10 @@ class SeminarsController < ApplicationController
time_now = Time.now
params = OrbitHelper.params
seminar = SeminarMain.find_by(uid: params[:uid])
registration_url = prefix_url + @registration_postfix
submission_url = prefix_url + '/home/submission'
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="'+ prefix_url + @registration_postfix + '" target="_blank">' + t('seminar.signup') + '</a>').html_safe
sign_up = ('<a href="'+ registration_url + '" 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
@ -184,12 +186,12 @@ class SeminarsController < ApplicationController
if !seminar.registration_status.blank? && seminar.registration_status.include?('C') && seminar.contribute_start_date <= time_now && ( seminar.contribute_end_date.nil? || seminar.contribute_end_date+1 >= time_now )
if !@@session[:seminar_signup_id].blank?
if @@session[:seminar_main_id] == seminar.id
contribute_action = ('<a href="'+ prefix_url + '?method=con_upload">' + t('seminar_signup.uploads') + '</a>').html_safe
contribute_action = ('<a href="'+ submission_url + '?method=con_upload">' + t('seminar_signup.uploads') + '</a>').html_safe
else
contribute_action = ('<a href="'+ prefix_url + '?method=con_login">' + t('seminar_signup.con_login') + '</a>').html_safe
contribute_action = ('<a href="'+ submission_url + '?method=con_login">' + t('seminar_signup.con_login') + '</a>').html_safe
end
else
contribute_action = ('<a href="'+ prefix_url + '?method=con_login">' + t('seminar_signup.con_login') + '</a>').html_safe
contribute_action = ('<a href="'+ submission_url + '?method=con_login">' + t('seminar_signup.con_login') + '</a>').html_safe
end
end
data = {

View File

@ -70,12 +70,11 @@
<% end %>
<td>
<%= link_to t(:edit), prefix_url + '?method=edit_file&con_no=' + seminar_signup_contribute.id, :class => 'btn btn-primary' %>
<%= form_with url: del_file_seminars_path, method: "post" do |f| %>
<%= f.submit_tag t(:delete_), class: "btn btn-primary" %>
<%= f.hidden_field_tag "referer_url", request.original_url.split(request.env["HTTP_HOST"]).last.split('?').first %>
<%= f.hidden_field_tag "con_no", seminar_signup_contribute.id %>
<%= form_tag(del_file_seminars_path, {method: "post"}) do |f| %>
<%= submit_tag t(:delete_), class: "btn btn-primary" %>
<%= hidden_field_tag "referer_url", request.original_url.split(request.env["HTTP_HOST"]).last.split('?').first %>
<%= hidden_field_tag "con_no", seminar_signup_contribute.id %>
<% end %>
</td>
</tr>
<% end %>