From ec023fb048d768ea2afbff4f71e2f64674cff991 Mon Sep 17 00:00:00 2001 From: Bohung Date: Sun, 4 Apr 2021 20:43:24 +0800 Subject: [PATCH] Fix bug. --- app/models/seminar_review.rb | 9 ++++++--- .../admin/seminars/_seminar_signup_dashboard.html.erb | 10 +++++----- .../_seminar_signup_session_dashboard.html.erb | 10 +++++----- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/app/models/seminar_review.rb b/app/models/seminar_review.rb index d2106fe..1f98da5 100644 --- a/app/models/seminar_review.rb +++ b/app/models/seminar_review.rb @@ -74,13 +74,16 @@ class SeminarReview def get_all_seminar_signup_ids(mode = nil) if (self.default_topics.include?("seminar_signup_contributes.description") && self.seminar_main.assign_mode == 1) || mode == 1 final_assign_signup_ids = SeminarSession.where(:id.in=>self.seminar_session_ids).pluck(:seminar_signup_ids).flatten.map{|id| id.to_s} rescue [] - final_assign_signup_ids + self.seminar_signup_ids - self.remove_seminar_signup_ids + result = final_assign_signup_ids + self.seminar_signup_ids - self.remove_seminar_signup_ids + result = result.uniq else - all_seminar_signup_ids + result = all_seminar_signup_ids end + result end def all_seminar_signup_ids - self.seminar_signup_ids - self.remove_seminar_signup_ids + self.default_seminar_signup_ids + result = self.seminar_signup_ids - self.remove_seminar_signup_ids + self.default_seminar_signup_ids + result.uniq end def append_default_signup_id(signup_id) sid = signup_id.to_s diff --git a/app/views/admin/seminars/_seminar_signup_dashboard.html.erb b/app/views/admin/seminars/_seminar_signup_dashboard.html.erb index 4e32378..571a652 100644 --- a/app/views/admin/seminars/_seminar_signup_dashboard.html.erb +++ b/app/views/admin/seminars/_seminar_signup_dashboard.html.erb @@ -120,6 +120,11 @@ } function init_func(){ adjust_height(); + $("tbody").each(function(i,v){ + if($(v).find("tr[data-id]").length != 0){ + $(v).find("tr.blank_tr").css("display","none"); + } + }) $(".zoom_out_btn").off("click").on("click",function(){ var parent = $(this).parent(); var id = parent.data("id"); @@ -246,11 +251,6 @@ }); } $(document).ready(function(){ - $("tbody").each(function(i,v){ - if($(v).find("tr[data-id]").length != 0){ - $(v).find("tr.blank_tr").css("display","none"); - } - }) init_func(); }) $(window).resize(function(){ diff --git a/app/views/admin/seminars/_seminar_signup_session_dashboard.html.erb b/app/views/admin/seminars/_seminar_signup_session_dashboard.html.erb index 1327ba4..ea7428c 100644 --- a/app/views/admin/seminars/_seminar_signup_session_dashboard.html.erb +++ b/app/views/admin/seminars/_seminar_signup_session_dashboard.html.erb @@ -129,6 +129,11 @@ } function init_func(){ adjust_height(); + $("tbody").each(function(i,v){ + if($(v).find("tr[data-id]").length != 0){ + $(v).find("tr.blank_tr").css("display","none"); + } + }) $(".zoom_out_btn").off("click").on("click",function(){ var parent = $(this).parent(); var session_id = parent.data("id"); @@ -233,11 +238,6 @@ }); } $(document).ready(function(){ - $("tbody").each(function(i,v){ - if($(v).find("tr[data-id]").length != 0){ - $(v).find("tr.blank_tr").css("display","none"); - } - }) init_func(); }) $(window).resize(function(){