parent
2262997c31
commit
9bbc8d64eb
|
@ -20,7 +20,7 @@ module CoursesHelper
|
||||||
|
|
||||||
# 返回教师数量,即roles表中定义的Manager
|
# 返回教师数量,即roles表中定义的Manager
|
||||||
def teacherCount project
|
def teacherCount project
|
||||||
searchTeacherAndAssistant(project).count
|
project.members.count - studentCount(project).to_i
|
||||||
# or
|
# or
|
||||||
# searchTeacherAndAssistant(project).count
|
# searchTeacherAndAssistant(project).count
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
@nav_dispaly_forum_label = 1
|
@nav_dispaly_forum_label = 1
|
||||||
@nav_dispaly_course_label = nil
|
@nav_dispaly_course_label = nil
|
||||||
@nav_dispaly_store_all_label = 1 %>
|
@nav_dispaly_store_all_label = 1 %>
|
||||||
|
<% teacher_num = teacherCount(@course) %>
|
||||||
|
<% student_num = studentCount(@course) %>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
@ -124,19 +126,19 @@
|
||||||
<td class="font_index">
|
<td class="font_index">
|
||||||
<!-- 1 教师; 2 学生;0 全部-->
|
<!-- 1 教师; 2 学生;0 全部-->
|
||||||
<% if User.current.member_of_course?(@course) %>
|
<% 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 %>
|
<% else %>
|
||||||
<span>
|
<span>
|
||||||
<%= teacherCount(@course)%>
|
<%= teacher_num %>
|
||||||
</span>
|
</span>
|
||||||
<% end%>
|
<% end%>
|
||||||
</td>
|
</td>
|
||||||
<td class="font_index">
|
<td class="font_index">
|
||||||
<% if (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) %>
|
<% 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 %>
|
<% else %>
|
||||||
<span>
|
<span>
|
||||||
<%= studentCount(@course)%>
|
<%= student_num %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
|
@ -145,10 +147,10 @@
|
||||||
</td>
|
</td>
|
||||||
<tr class="font_aram">
|
<tr class="font_aram">
|
||||||
<td align="center" width="80px" id="teacherCount">
|
<td align="center" width="80px" id="teacherCount">
|
||||||
<%= l(:label_x_base_courses_teacher, :count => teacherCount(@course)) %>
|
<%= l(:label_x_base_courses_teacher, :count => teacher_num) %>
|
||||||
</td>
|
</td>
|
||||||
<td align="center" width="80px" id="studentCount">
|
<td align="center" width="80px" id="studentCount">
|
||||||
<%= l(:label_x_base_courses_student, :count => studentCount(@course)) %>
|
<%= l(:label_x_base_courses_student, :count => student_num) %>
|
||||||
</td>
|
</td>
|
||||||
<td align="center" width="80px">
|
<td align="center" width="80px">
|
||||||
<%= l(:label_x_course_data, :count => files_count) %>
|
<%= l(:label_x_course_data, :count => files_count) %>
|
||||||
|
|
|
@ -78,8 +78,8 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<%=link_to l(:field_homepage), home_path %> >
|
<%=link_to l(:field_homepage), home_path %> >
|
||||||
<a>
|
<a href="http://<%= Setting.host_contest %>" class="link_other_item">
|
||||||
<%=link_to l(:label_contest_innovate), home_path %>
|
<%=l(:label_courses_management_platform)%>
|
||||||
</a> >
|
</a> >
|
||||||
<span title="<%= @contest.name%>">
|
<span title="<%= @contest.name%>">
|
||||||
<%= link_to h(truncate(@contest.name, length: 20, omission: '...')), show_contest_contest_path(@contest) %>
|
<%= link_to h(truncate(@contest.name, length: 20, omission: '...')), show_contest_contest_path(@contest) %>
|
||||||
|
|
Loading…
Reference in New Issue