课程添加或者删除成员时,实时更新课程成员数量。
This commit is contained in:
parent
fb692fad4c
commit
583b92a842
|
@ -36,7 +36,7 @@ module CoursesHelper
|
|||
#生成课程老师成员链接
|
||||
def course_teacher_link teacher_num
|
||||
if User.current.member_of_course?(@course) || User.current.admin?
|
||||
link_to "#{teacher_num}", course_member_path(@course, :role => 1), :class => 'info_foot_num c_blue'
|
||||
link_to "#{teacher_num}", course_member_path(@course, :role => 1), :class => 'info_foot_num c_blue', :id => 'teacher_number'
|
||||
else
|
||||
content_tag 'span',teacher_num, :class => 'info_foot_num c_blue'
|
||||
end
|
||||
|
@ -45,7 +45,7 @@ module CoursesHelper
|
|||
#生成课程学生列表连接
|
||||
def course_student_link student_num
|
||||
if (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) || User.current.admin?
|
||||
link_to "#{student_num}", course_member_path(@course, :role => 2), :class => 'info_foot_num c_blue'
|
||||
link_to "#{student_num}", course_member_path(@course, :role => 2), :class => 'info_foot_num c_blue', :id => "student_number"
|
||||
else
|
||||
content_tag 'span',student_num, :class => 'info_foot_num c_blue'
|
||||
end
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
alert("<%= @create_member_error_messages%>");
|
||||
<% else%>
|
||||
$('#course_members_setting').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
|
||||
$("#teacher_number").html("<%= searchTeacherAndAssistant(@course).count %>");
|
||||
$("#student_number").html("<%= studentCount(@course) %>");
|
||||
alert("添加成功");
|
||||
<% end%>
|
||||
hideOnLoad();
|
||||
|
|
|
@ -4,5 +4,7 @@
|
|||
// $('#tab-content-members').html('<%#= escape_javascript(render :partial => 'projects/settings/members') %>');
|
||||
<%elsif @course%>
|
||||
$('#course_members_setting').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
|
||||
$("#teacher_number").html("<%= searchTeacherAndAssistant(@course).count %>")
|
||||
$("#student_number").html("<%= studentCount(@course) %>");
|
||||
<%end%>
|
||||
hideOnLoad();
|
||||
|
|
Loading…
Reference in New Issue