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/subjects/show.json.jbuilder

23 lines
924 B

json.(@subject, :id, :name, :description, :learning_notes, :stages_count, :stage_shixuns_count, :shixuns_count)
6 years ago
json.challenge_choose_count @subject.subject_challenge_choose_count
json.challenges_count @subject.subject_challenge_count
json.subject_score @subject.all_score
json.member_count @subject.member_count
json.allow_delete (@subject.status != 2 && @is_creator) || @user.admin?
6 years ago
json.publish_status publish_status(@subject, @is_manager, @user, @shixuns)
json.allow_statistics @is_manager
6 years ago
json.allow_send @user.logged?
json.allow_visit @subject.status > 1 || @is_manager
json.allow_add_member @is_manager
6 years ago
if @subject.excellent
6 years ago
@courses.each do |course|
json.start_date course.start_date.beginning_of_day
json.end_date course.end_date.end_of_day
json.student_count course.students.count
json.course_identity @user.course_identity(course)
json.course_status course
end
6 years ago
end