|
|
@ -246,15 +246,17 @@ module CoursesHelper
|
|
|
|
|
|
|
|
|
|
|
|
def left_group_info course
|
|
|
|
def left_group_info course
|
|
|
|
group_info = []
|
|
|
|
group_info = []
|
|
|
|
course.course_groups.each do |course_group|
|
|
|
|
if course.course_groups_count > 0
|
|
|
|
group_info << {category_id: course_group.id, category_name: course_group.name, position: course_group.position,
|
|
|
|
course.course_groups.each do |course_group|
|
|
|
|
category_count: course_group.course_members_count, category_type: false,
|
|
|
|
group_info << {category_id: course_group.id, category_name: course_group.name, position: course_group.position,
|
|
|
|
second_category_url: "/courses/#{@course.id}/course_groups/#{course_group.id}"}
|
|
|
|
category_count: course_group.course_members_count, category_type: false,
|
|
|
|
|
|
|
|
second_category_url: "/courses/#{@course.id}/course_groups/#{course_group.id}"}
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
none_group_count = course.students.where(course_group_id: 0).size
|
|
|
|
|
|
|
|
group_info << {category_id: 0, category_name: "未分班", position: course.course_groups.pluck(:position).max.to_i + 1,
|
|
|
|
|
|
|
|
category_count: none_group_count, category_type: false,
|
|
|
|
|
|
|
|
second_category_url: "/courses/#{@course.id}/course_groups/0"}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
none_group_count = course.students.where(course_group_id: 0).size
|
|
|
|
|
|
|
|
group_info << {category_id: 0, category_name: "未分班", position: course.course_groups.pluck(:position).max.to_i + 1,
|
|
|
|
|
|
|
|
category_count: none_group_count, category_type: false,
|
|
|
|
|
|
|
|
second_category_url: "/courses/#{@course.id}/course_groups/0"}
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|