This commit is contained in:
BoHung Chiu 2022-06-14 22:21:43 +08:00
parent 22c37e3cb8
commit 350127fdf1
4 changed files with 14 additions and 9 deletions

View File

@ -395,8 +395,9 @@ class ApplicationFormsController < ApplicationController
def agree_link def agree_link
signup = ApplicationFormSignup.find(params[:id]) rescue nil signup = ApplicationFormSignup.find(params[:id]) rescue nil
stage_num = signup ? signup.get_stage_num(params[:cipher]) : nil stage_num = signup ? signup.get_stage_num(params[:cipher]) : nil
@error_message = nil
if stage_num.nil? if stage_num.nil?
render_404 @error_message = I18n.t('application_form.this_link_has_expired')
else else
@type = params[:type] @type = params[:type]
application_form = signup.application_form_main application_form = signup.application_form_main
@ -444,7 +445,7 @@ class ApplicationFormsController < ApplicationController
form_params = params[:application_form_signup] form_params = params[:application_form_signup]
form_params_email = form_params[:email] form_params_email = form_params[:email]
form_params_main_id = form_params[:application_form_main_id] form_params_main_id = form_params[:application_form_main_id]
@signup = ApplicationFormSignup.where(email: form_params_email, application_form_main_id: form_params_main_id ).first @signup = nil #ApplicationFormSignup.where(email: form_params_email, application_form_main_id: form_params_main_id ).first
@application_form = ApplicationFormMain.where(id: form_params_main_id).first @application_form = ApplicationFormMain.where(id: form_params_main_id).first
@application_form_signup = ApplicationFormSignup.new(application_form_signup_params) @application_form_signup = ApplicationFormSignup.new(application_form_signup_params)
@ -453,10 +454,6 @@ class ApplicationFormsController < ApplicationController
else else
flag = false flag = false
end end
if @signup.present?
@signup.destroy
@signup = nil
end
begin begin
if gotcha_valid? || flag if gotcha_valid? || flag
if @signup.blank? && @application_form_signup.save if @signup.blank? && @application_form_signup.save

View File

@ -3,7 +3,7 @@
background: #00ff7f; background: #00ff7f;
color: #000000; color: #000000;
} }
.disagree_text{ .disagree_text, .error_text{
background: #ff004a; background: #ff004a;
color: #ffffff; color: #ffffff;
} }
@ -16,11 +16,17 @@
position: absolute; position: absolute;
} }
</style> </style>
<h3 style="text-align: center;"><span class="<%=@type%>_text"><% if @type == 'agree' %> <% @type = 'error' if @error_message %>
<h3 style="text-align: center;">
<span class="<%=@type%>_text">
<% if @error_message %>
<%= @error_message.html_safe %>
<%elsif @type == 'agree' %>
<%=t('application_form.send_email_to_next_stage_reviewer')%> <%=t('application_form.send_email_to_next_stage_reviewer')%>
<% elsif @type == 'disagree' %> <% elsif @type == 'disagree' %>
<%=t('application_form.email_add_file_success')%> <%=t('application_form.email_add_file_success')%>
<% elsif @type == 'finish' %> <% elsif @type == 'finish' %>
<%=t('application_form.email_edit_file_success')%> <%=t('application_form.email_edit_file_success')%>
<% end %></span></h3> <% end %>
</span></h3>
<button class="close_btn" onclick="window.close()"><%=t('application_form.close')%></button> <button class="close_btn" onclick="window.close()"><%=t('application_form.close')%></button>

View File

@ -27,6 +27,7 @@ en:
abstract_number: Abstract number abstract_number: Abstract number
presentation_type: Presentation presentation_type: Presentation
application_form: application_form:
this_link_has_expired: "This link has expired!"
close: "Close" close: "Close"
send_email_to_next_stage_reviewer: "Email has been sent to reviewer of next stage!" send_email_to_next_stage_reviewer: "Email has been sent to reviewer of next stage!"
denied_stage: "Denied Stage" denied_stage: "Denied Stage"

View File

@ -28,6 +28,7 @@ zh_tw:
abstract_number: 摘要編號 abstract_number: 摘要編號
presentation_type: 發表方式 presentation_type: 發表方式
application_form: application_form:
this_link_has_expired: "此連結已失效!"
close: "關閉" close: "關閉"
send_email_to_next_stage_reviewer: "已寄送email給下個階段審核者!" send_email_to_next_stage_reviewer: "已寄送email給下個階段審核者!"
denied_stage: "未通過階段" denied_stage: "未通過階段"