diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index d33d211ae..a6fd46cfd 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -989,6 +989,7 @@ class CoursesController < ApplicationController @curr_page = '成员管理' respond_to do |format| + format.js format.html { render :layout => 'base_edu_course' } format.api { render_validation_errors(@course) } end diff --git a/app/views/courses/all_student_list.js.erb b/app/views/courses/all_student_list.js.erb index a439657cb..4292ee39f 100644 --- a/app/views/courses/all_student_list.js.erb +++ b/app/views/courses/all_student_list.js.erb @@ -2,6 +2,5 @@ <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> $("#student_table_div").html("<%= j(render :partial => "courses/settings/student_table", :locals => {:is_teacher => is_teacher}) %>"); <% else %> -$("#setting_teacher_list").hide(); -$("#setting_student_list").html("<%= j(render :partial => 'courses/settings/all_student_list') %>").show(); +$("#setting_teacher_list").html("<%= j(render :partial => 'courses/settings/all_student_list') %>").show(); <% end %> \ No newline at end of file diff --git a/app/views/courses/has_group_student_list.js.erb b/app/views/courses/has_group_student_list.js.erb index 4896db9dd..ad521adf5 100644 --- a/app/views/courses/has_group_student_list.js.erb +++ b/app/views/courses/has_group_student_list.js.erb @@ -2,6 +2,5 @@ <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> $("#student_table_div").html("<%= j(render :partial => "courses/settings/student_table", :locals => {:is_teacher => is_teacher}) %>"); <% else %> -$("#setting_teacher_list").hide(); -$("#setting_student_list").html("<%= j(render :partial => 'courses/settings/has_group_student_list') %>").show(); +$("#setting_teacher_list").html("<%= j(render :partial => 'courses/settings/has_group_student_list') %>").show(); <% end %> \ No newline at end of file diff --git a/app/views/courses/members.html.erb b/app/views/courses/members.html.erb index 190e9083e..f2b609e68 100644 --- a/app/views/courses/members.html.erb +++ b/app/views/courses/members.html.erb @@ -10,8 +10,6 @@
<%= render :partial => 'courses/settings/members' %>
-
-
diff --git a/app/views/courses/members.js.erb b/app/views/courses/members.js.erb new file mode 100644 index 000000000..f2a4a7648 --- /dev/null +++ b/app/views/courses/members.js.erb @@ -0,0 +1 @@ +$("#setting_teacher_list").html("<%= j(render :partial => 'courses/settings/members') %>"); \ No newline at end of file diff --git a/app/views/courses/no_group_student_list.js.erb b/app/views/courses/no_group_student_list.js.erb index 662e8380b..0590baec6 100644 --- a/app/views/courses/no_group_student_list.js.erb +++ b/app/views/courses/no_group_student_list.js.erb @@ -2,6 +2,5 @@ <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> $("#student_table_div").html("<%= j(render :partial => "courses/settings/student_table", :locals => {:is_teacher => is_teacher}) %>"); <% else %> -$("#setting_teacher_list").hide(); -$("#setting_student_list").html("<%= j(render :partial => 'courses/settings/no_group_student_list') %>").show(); +$("#setting_teacher_list").html("<%= j(render :partial => 'courses/settings/no_group_student_list') %>").show(); <% end %> \ No newline at end of file diff --git a/app/views/courses/settings/_all_teacher_list_ul.erb b/app/views/courses/settings/_all_teacher_list_ul.erb index 164359a92..6a41f6460 100644 --- a/app/views/courses/settings/_all_teacher_list_ul.erb +++ b/app/views/courses/settings/_all_teacher_list_ul.erb @@ -17,11 +17,6 @@ <%= group.members.count %>

- -

- 重命名 - 删除 -

<% end %> <% end %> \ No newline at end of file diff --git a/app/views/courses/sync_students.js.erb b/app/views/courses/sync_students.js.erb index c49456425..1e5f43280 100644 --- a/app/views/courses/sync_students.js.erb +++ b/app/views/courses/sync_students.js.erb @@ -1,2 +1 @@ -$("#setting_teacher_list").hide(); -$("#setting_student_list").html("<%= j(render :partial => 'courses/settings/all_student_list') %>").show(); \ No newline at end of file +$("#setting_teacher_list").html("<%= j(render :partial => 'courses/settings/all_student_list') %>").show(); \ No newline at end of file diff --git a/public/javascripts/edu/course.js b/public/javascripts/edu/course.js index 2bbdceb5d..f54d85e06 100644 --- a/public/javascripts/edu/course.js +++ b/public/javascripts/edu/course.js @@ -43,25 +43,24 @@ $(function() { $(".stud-class-set .news .container .member .people .left ul li").live('click', function(e) { //$(".stud-class-set .news .container .member .people .left ul li").removeClass("sheet"); //$(this).addClass("sheet"); + var $course_id = $(this).attr("data-course-id"); if($(this).attr("data-option") == "teacher") { - $("#setting_teacher_list").show(); - $("#setting_student_list").html(""); + $.get( + '/courses/'+$course_id+'/members' + ) } if($(this).attr("data-option") == "allstudent") { - var $course_id = $(this).attr("data-course-id"); $.get( '/courses/'+$course_id+'/all_student_list' ) } if($(this).attr("data-option") == "noclass") { - var $course_id = $(this).attr("data-course-id"); $.get( '/courses/'+$course_id+'/no_group_student_list' ) } if($(this).attr("data-option") == "hasclass") { - var $course_id = $(this).attr("data-course-id"); var $group_id = $(this).attr("data-group-id"); $.get( '/courses/'+$course_id+'/has_group_student_list?group_id='+$group_id @@ -280,7 +279,7 @@ function submit_delete_group_form(course_id, group_id){ if($("#sy_08").length > 0){ window.location.href = "/courses/"+course_id+"/all_student_list"; } else{ - $(".stud-class-set .news .container .member .people .left ul li[data-option='teacher']").click(); + $(".stud-class-set .news .container .member .people .left ul li[data-option='allstudent']").click(); } } });