From 6835fb29cd6e636011befb04966ad070aeb90be2 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 29 May 2015 10:34:04 +0800 Subject: [PATCH] Signed-off-by: alan <547533434@qq.com> --- app/views/welcome/course.html.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index cbceec2c7..9e29dc1ef 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -129,6 +129,7 @@ <%# User.current.logged? ? course_count = 9 : course_count = 10 %> <% course_count = 9 %> <% all_new_hot_course = find_all_new_hot_course(course_count, @school_id, year_now, course_term)%> + <% while all_new_hot_course.count < course_count%> <% if course_term == "春季学期" year_now -= 1 @@ -140,9 +141,11 @@ <% all_new_hot_course += find_all_new_hot_course(course_count-all_new_hot_course.count, @school_id, year_now, course_term)%> <% end%> <%= render :partial => 'course_list', :locals => {:course_list => all_new_hot_course} %> + <% else %> + <% if cur_school_course.count < 9 %> <%= render :partial => 'more_course', :locals => {:school_id => nil}%> @@ -160,6 +163,7 @@ <%= render :partial => 'no_course_title', :locals => {:course_title => l(:label_school_less_course)} %> <% all_new_hot_course = find_all_new_hot_course(9-cur_school_course.count, @school_id, year_now, course_term)%> + <% while (all_new_hot_course.count + cur_school_course.count) < 9%> <% if course_term == "春季学期" year_now -= 1 @@ -171,9 +175,11 @@ <% all_new_hot_course += find_all_new_hot_course(9-(all_new_hot_course.count + cur_school_course.count), @school_id, year_now, course_term)%> <% end%> <%= render :partial => 'course_list', :locals => {:course_list => all_new_hot_course} %> + <% end %> + <% end %>