forked from spen/seminar
Fix bug.
This commit is contained in:
parent
ee91898333
commit
f432b1a16a
|
@ -345,7 +345,7 @@ class SeminarsController < ApplicationController
|
||||||
sign_up = link_to(sign_up_text, seminar.get_frontend_url(seminar_url), :target=>'_blank', :title=>sign_up_text)
|
sign_up = link_to(sign_up_text, seminar.get_frontend_url(seminar_url), :target=>'_blank', :title=>sign_up_text)
|
||||||
end
|
end
|
||||||
|
|
||||||
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 !seminar.registration_status.blank? && seminar.registration_status.include?('C') && (seminar.contribute_start_date.nil? || seminar.contribute_start_date <= time_now) && ( seminar.contribute_end_date.nil? || seminar.contribute_end_date+1 >= time_now )
|
||||||
if @@session[:seminar_signup_id].present? && @@session[:seminar_main_id] == seminar.id
|
if @@session[:seminar_signup_id].present? && @@session[:seminar_main_id] == seminar.id
|
||||||
button_text = t('seminar_signup.uploads')
|
button_text = t('seminar_signup.uploads')
|
||||||
contribute_action = link_to(button_text, seminar.get_frontend_url(seminar_url, :con_upload), :title=>button_text)
|
contribute_action = link_to(button_text, seminar.get_frontend_url(seminar_url, :con_upload), :title=>button_text)
|
||||||
|
@ -616,20 +616,24 @@ class SeminarsController < ApplicationController
|
||||||
|
|
||||||
def add_file_proc
|
def add_file_proc
|
||||||
|
|
||||||
update_params = seminar_signup_contribute_params.merge('seminar_submission_values'=>params['seminar_submission_values'])
|
update_params = seminar_signup_contribute_params.merge('seminar_submission_values'=>params['seminar_submission_values'].to_h)
|
||||||
flag = true
|
flag = true
|
||||||
update_params.permit!
|
update_params.permit!
|
||||||
if !update_params['seminar_submission_values'].nil?
|
if update_params['seminar_submission_values'].present?
|
||||||
if update_params['seminar_submission_values']['0']['value'].class==String
|
if update_params['seminar_submission_values']['0']['value'].nil?
|
||||||
value = update_params['seminar_submission_values']['0']['value']
|
flag = false
|
||||||
if !value.to_s.blank?
|
|
||||||
flag = false
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
update_params['seminar_submission_values']['0']['value'].each do |key,value|
|
if update_params['seminar_submission_values']['0']['value'].class==String
|
||||||
if !value.to_s.blank?
|
value = update_params['seminar_submission_values']['0']['value']
|
||||||
|
if !value.to_s.blank?
|
||||||
flag = false
|
flag = false
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
update_params['seminar_submission_values']['0']['value'].each do |key,value|
|
||||||
|
if !value.to_s.blank?
|
||||||
|
flag = false
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -668,20 +672,24 @@ class SeminarsController < ApplicationController
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@con = SeminarSignupContribute.find(params[:seminar_signup_contribute][:id])
|
@con = SeminarSignupContribute.find(params[:seminar_signup_contribute][:id])
|
||||||
update_params = seminar_signup_contribute_params.merge('seminar_submission_values'=>params['seminar_submission_values'])
|
update_params = seminar_signup_contribute_params.merge('seminar_submission_values'=>params['seminar_submission_values'].to_h)
|
||||||
update_params.permit!
|
update_params.permit!
|
||||||
unless update_params['seminar_submission_values'].nil?
|
if update_params['seminar_submission_values'].present?
|
||||||
flag = true
|
if update_params['seminar_submission_values']['0']['value'].nil?
|
||||||
if update_params['seminar_submission_values']['0']['value'].class==String
|
flag = false
|
||||||
value = update_params['seminar_submission_values']['0']['value']
|
|
||||||
if !value.to_s.blank?
|
|
||||||
flag = false
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
update_params['seminar_submission_values']['0']['value'].each do |key,value|
|
flag = true
|
||||||
if !value.to_s.blank?
|
if update_params['seminar_submission_values']['0']['value'].class==String
|
||||||
|
value = update_params['seminar_submission_values']['0']['value']
|
||||||
|
if !value.to_s.blank?
|
||||||
flag = false
|
flag = false
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
update_params['seminar_submission_values']['0']['value'].each do |key,value|
|
||||||
|
if !value.to_s.blank?
|
||||||
|
flag = false
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if flag
|
if flag
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<% if (@seminar.contribute_start_date <= @time_now && (@seminar.contribute_end_date.nil? or @seminar.contribute_end_date+1 >= @time_now ) rescue false) %>
|
<% if (@seminar.contribute_start_date.nil? || @seminar.contribute_start_date <= @time_now) && (@seminar.contribute_end_date.nil? or @seminar.contribute_end_date+1 >= @time_now ) %>
|
||||||
|
|
||||||
<section id="main-wrap">
|
<section id="main-wrap">
|
||||||
<div class="sign-in have-other-sign-in">
|
<div class="sign-in have-other-sign-in">
|
||||||
|
|
|
@ -9,9 +9,9 @@
|
||||||
data1 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='title'}[0]
|
data1 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='title'}[0]
|
||||||
data2 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='description'}[0]
|
data2 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='description'}[0]
|
||||||
data3 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='file'}[0]
|
data3 = @seminar.seminar_submission_field_sets.select{|v| v.field_name=='file'}[0]
|
||||||
show1 = !(data1.disabled) rescue false
|
show1 = data1 ? !(data1.disabled) : false
|
||||||
show2 = !(data2.disabled) rescue false
|
show2 = data2 ? !(data2.disabled) : false
|
||||||
show3 = !(data3.disabled) rescue false
|
show3 = data3 ? !(data3.disabled) : false
|
||||||
name1 = data1['name'][I18n.locale]
|
name1 = data1['name'][I18n.locale]
|
||||||
name2 = data2['name'][I18n.locale]
|
name2 = data2['name'][I18n.locale]
|
||||||
name3 = data3['name'][I18n.locale]
|
name3 = data3['name'][I18n.locale]
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
%>
|
%>
|
||||||
<h3 style="display:block;"><%= @seminar.title %></h3>
|
<h3 style="display:block;"><%= @seminar.title %></h3>
|
||||||
<% if @seminar.contribute_start_date <= @time_now and ( @seminar.contribute_end_date.nil? or @seminar.contribute_end_date+1 >= @time_now ) %>
|
<% if (@seminar.contribute_start_date.nil? || @seminar.contribute_start_date <= @time_now) && ( @seminar.contribute_end_date.nil? || @seminar.contribute_end_date+1 >= @time_now ) %>
|
||||||
<% begin %>
|
<% begin %>
|
||||||
<% if !session[:seminar_signup_id].blank? %>
|
<% if !session[:seminar_signup_id].blank? %>
|
||||||
<%= t('seminar_signup.serial_number') %>: <%=@seminar_signup.display_serial_number rescue ""%>
|
<%= t('seminar_signup.serial_number') %>: <%=@seminar_signup.display_serial_number rescue ""%>
|
||||||
|
|
Loading…
Reference in New Issue