From 9bbc8d64eb67c64480c5dc8b8c1a9654605d8106 Mon Sep 17 00:00:00 2001
From: alan <547533434@qq.com>
Date: Thu, 8 Jan 2015 17:04:25 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=AF=8D=E7=89=88=E9=A1=B5?=
=?UTF-8?q?=E5=8A=A0=E8=BD=BD=E7=BC=93=E6=85=A2=20Signed-off-by:=20alan=20?=
=?UTF-8?q?<547533434@qq.com>?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/courses_helper.rb | 2 +-
app/views/layouts/base_courses.html.erb | 14 ++++++++------
app/views/layouts/base_newcontest.html.erb | 4 ++--
3 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb
index 8547ef18f..a862753ef 100644
--- a/app/helpers/courses_helper.rb
+++ b/app/helpers/courses_helper.rb
@@ -20,7 +20,7 @@ module CoursesHelper
# 返回教师数量,即roles表中定义的Manager
def teacherCount project
- searchTeacherAndAssistant(project).count
+ project.members.count - studentCount(project).to_i
# or
# searchTeacherAndAssistant(project).count
end
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index 3c174ce84..a79914f61 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -2,6 +2,8 @@
@nav_dispaly_forum_label = 1
@nav_dispaly_course_label = nil
@nav_dispaly_store_all_label = 1 %>
+<% teacher_num = teacherCount(@course) %>
+<% student_num = studentCount(@course) %>
@@ -124,19 +126,19 @@
<% if User.current.member_of_course?(@course) %>
- <%= link_to "#{teacherCount(@course)}", course_member_path(@course, :role => 1), :course => '1' %>
+ <%= link_to "#{teacher_num}", course_member_path(@course, :role => 1), :course => '1' %>
<% else %>
- <%= teacherCount(@course)%>
+ <%= teacher_num %>
<% end%>
|
<% if (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) %>
- <%= link_to "#{studentCount(@course)}", course_member_path(@course, :role => 2), :course => '1' %>
+ <%= link_to "#{student_num}", course_member_path(@course, :role => 2), :course => '1' %>
<% else %>
- <%= studentCount(@course)%>
+ <%= student_num %>
<% end %>
|
@@ -145,10 +147,10 @@
- <%= l(:label_x_base_courses_teacher, :count => teacherCount(@course)) %>
+ <%= l(:label_x_base_courses_teacher, :count => teacher_num) %>
|
- <%= l(:label_x_base_courses_student, :count => studentCount(@course)) %>
+ <%= l(:label_x_base_courses_student, :count => student_num) %>
|
<%= l(:label_x_course_data, :count => files_count) %>
diff --git a/app/views/layouts/base_newcontest.html.erb b/app/views/layouts/base_newcontest.html.erb
index 816f9ce58..6c3721fcf 100644
--- a/app/views/layouts/base_newcontest.html.erb
+++ b/app/views/layouts/base_newcontest.html.erb
@@ -78,8 +78,8 @@
|
<%=link_to l(:field_homepage), home_path %> >
-
- <%=link_to l(:label_contest_innovate), home_path %>
+
+ <%=l(:label_courses_management_platform)%>
>
<%= link_to h(truncate(@contest.name, length: 20, omission: '...')), show_contest_contest_path(@contest) %>
|