You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/views/graduation_topics/show.json.jbuilder

39 lines
1.3 KiB

6 years ago
# 公共数据
json.partial! "show_navigation", locals: {course: @course, graduation: @graduation_topic}
json.graduation_topic_name @graduation_topic.name
json.status_name @graduation_topic.status_name
json.back_url course_graduation_topics_path(@course)
json.edit_url edit_course_graduation_topic_path(@course, graduation_topic_id: @graduation_topic)
json.users_count @users_count
json.course_identity @current_user.course_identity(@course)
json.user_selected_topic @graduation_topic.user_status(current_user.id)
json.group_list do
json.array! @group_list do |group|
json.course_group_id group.id
json.group_name group.name
end
end
# 列表数据
json.users_list do
json.array! @student_graduation_topics do |student|
json.id student.id
json.student_name student.name
json.student_id student.student_id
json.class_group_name student.class_group_name
json.selected_time student.selected_time
json.result student.status_name
if @user_course_identity < Course::STUDENT
if student.status == 0 || student.status == 1
json.refuse_operate_api refuse_student_topic_course_graduation_topic_path(@course)
end
if student.status == 0
json.accept_operate_api accept_student_topic_course_graduation_topic_path(@course)
end
end
end
end