This commit is contained in:
BoHung Chiu 2021-03-31 16:15:12 +08:00
parent 2b81e298cd
commit ed1ebc8ec3
4 changed files with 11 additions and 8 deletions

View File

@ -6,4 +6,4 @@
<% else %>
<%= t('seminar.email_signup_content') %>
<% end %>
<%= (@data['extra_text'] rescue "").html_safe %>
<%= (@data['extra_text'] rescue "").to_s.html_safe %>

View File

@ -6,4 +6,4 @@
<% else %>
<%= t('seminar.email_submission_content') %>
<% end %>
<%= (@data['extra_text'] rescue "").html_safe %>
<%= (@data['extra_text'] rescue "").to_s.html_safe %>

View File

@ -5,7 +5,7 @@
@total_pages = data["total_pages"]
@time_now = data["time_now"]
%>
<% begin %>
<table class="table table-hover table-striped seminar-index">
<caption>
<h3><%= t('seminar.seminar') %></h3>
@ -23,11 +23,11 @@
<%
@seminars.each do |seminar|
if !seminar.registration_status.blank? and seminar.signup_start_date <= @time_now and ( seminar.signup_end_date.nil? or seminar.signup_end_date+1 >= @time_now )
if !seminar.registration_status.blank? and (seminar.signup_start_date <= @time_now rescue false) and ( seminar.signup_end_date.nil? or seminar.signup_end_date+1 >= @time_now )
sign_up = ('<a href="'+ OrbitHelper.url_to_show(seminar.to_param) + '" 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
elsif (seminar.signup_start_date > @time_now rescue false)
sign_up = t('seminar.sign_up_not_yet')
else
sign_up = t('seminar.sign_up_overdue')
@ -42,7 +42,7 @@
<%= sign_up %> <br />
<%=
if !seminar.registration_status.blank? and seminar.registration_status.include?('C') and seminar.contribute_start_date <= @time_now and ( seminar.contribute_end_date.nil? or seminar.contribute_end_date+1 >= @time_now )
if !seminar.registration_status.blank? and seminar.registration_status.include?('C') and (seminar.contribute_start_date <= @time_now rescue false) and ( seminar.contribute_end_date.nil? or (seminar.contribute_end_date+1 >= @time_now rescue false) )
if !session[:seminar_signup_id].blank?
if session[:seminar_main_id] == seminar.id
('<a href="'+ OrbitHelper.url_to_show(seminar.to_param) + '?method=con_upload">' + t('seminar_signup.uploads') + '</a>').html_safe
@ -59,5 +59,8 @@
<% end %>
</tbody>
</table>
<% rescue => e
puts [e,e.backtrace]
end
%>
<%= create_pagination(@total_pages).html_safe if @total_pages > 1 %>

View File

@ -212,7 +212,7 @@
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="hidden" name="referer_url" value="<%= request.original_url.split(request.env["HTTP_HOST"]).last %>">
<input type="hidden" name="referer_url" value="<%= request.original_url.split(request.env["HTTP_HOST"]).last rescue "/" %>">
<input type="hidden" name="seminar_signup[seminar_main_id]" value="<%= @seminar.id %>">
<%= f.submit "Submit", class: 'btn btn-primary', :id => 'button-mail' %>
<%= f.button "Delete", type: 'reset', class: 'btn' %>