From f7635370d7a739f30e657acbe417493172e653a1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 11 Aug 2014 14:49:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=BE=E7=A8=8B=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E6=95=88=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/welcome_helper.rb | 6 +++--- app/views/welcome/_course_list.html.erb | 6 +++--- app/views/welcome/_no_course_title.html.erb | 2 +- app/views/welcome/course.html.erb | 8 +++++--- config/locales/zh.yml | 3 +++ 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 8ee7f42d8..c60d18537 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -231,12 +231,12 @@ module WelcomeHelper # modif by nwb def find_all_new_hot_course limit = 9 ,school_id = 0 #sort_project_by_hot_rails 1, 'course_ac_para DESC', limit - time_now = Time.new.strftime("%Y"); + time_now = Time.new.strftime("%Y") if school_id - courses = Course.visible.joins(:course_status).where("#{Course.table_name}.created_at like '%#{time_now}%' and #{Course.table_name}.school_id <> + courses = Course.includes(:school).visible.joins(:course_status).where("#{Course.table_name}.created_at like '%#{time_now}%' and #{Course.table_name}.school_id <> ?", school_id).order("course_ac_para DESC").limit(limit).all else - courses = Course.visible.joins(:course_status).where("#{Course.table_name}.created_at like '%#{time_now}%' and #{Course.table_name}.school_id is not NULL + courses = Course.includes(:school).visible.joins(:course_status).where("#{Course.table_name}.created_at like '%#{time_now}%' and #{Course.table_name}.school_id is not NULL ").order("course_ac_para DESC").limit(limit).all end courses diff --git a/app/views/welcome/_course_list.html.erb b/app/views/welcome/_course_list.html.erb index a72ed1764..f590cf868 100644 --- a/app/views/welcome/_course_list.html.erb +++ b/app/views/welcome/_course_list.html.erb @@ -20,9 +20,9 @@
[<%= get_course_term course %>] <%= link_to(course.name.truncate(30, omission: '...'), course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %> - (<%= "#{memberCount(course)}人" %>) - <% files_count = course.attachments.count.to_s %> - (<%= link_to "#{files_count}份", course_files_path(course) %>资料) + (<%= course.members.count %>人) + <%# files_count = course.attachments.count.to_s %> + (<%= link_to "#{course.attachments.count.to_s}份", course_files_path(course) %>资料)
<% end %> diff --git a/app/views/welcome/_no_course_title.html.erb b/app/views/welcome/_no_course_title.html.erb index 7e6e09520..f16b91dba 100644 --- a/app/views/welcome/_no_course_title.html.erb +++ b/app/views/welcome/_no_course_title.html.erb @@ -1,5 +1,5 @@

- 该学校未开设任何课程,您可以查看其他学校课程 + <%= course_title%>

\ No newline at end of file diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index 5fa76174c..c979807b9 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -91,7 +91,9 @@ diff --git a/config/locales/zh.yml b/config/locales/zh.yml index cdd0ee9b7..62a5649a3 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2101,4 +2101,7 @@ zh: # ajax异步验证 modal_valid_passing: 可以使用 label_bug: 漏洞 + + lable_school_no_course: 该学校未开设任何课程,您可以查看其他学校课程 + lable_school_less_course: 该学校开设课程较少,您可以查看其他学校课程 \ No newline at end of file