From 7814c23c92aaff7ae204ad22fafa50100307776e Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 29 Oct 2019 22:00:31 +0800 Subject: [PATCH] Update seminars_controller.rb fix error --- app/controllers/seminars_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/seminars_controller.rb b/app/controllers/seminars_controller.rb index 9a6e0e2..5fac0fc 100644 --- a/app/controllers/seminars_controller.rb +++ b/app/controllers/seminars_controller.rb @@ -40,7 +40,7 @@ class SeminarsController < ApplicationController seminar = SeminarMain.find_by(uid: params[:uid]) - 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? && seminar.signup_start_date <= time_now && ( seminar.signup_end_date.nil? || seminar.signup_end_date+1 >= time_now ) sign_up = ('' + t('seminar.signup') + '').html_safe elsif seminar.registration_status.blank? sign_up = t('seminar.sign_up_not_open') @@ -50,9 +50,9 @@ class SeminarsController < ApplicationController sign_up = t('seminar.sign_up_overdue') end - 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 !session[:seminar_signup_id].blank? - if session[:seminar_main_id] == seminar.id + 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 = ('' + t('seminar_signup.uploads') + '').html_safe else contribute_action = ('' + t('seminar_signup.con_login') + '').html_safe