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

29 lines
956 B

json.images do
json.array! @images do |image|
json.path image.link
json.image_url Util::FileManage.source_disk_file_url(image)
end
end
json.shixuns do
json.array! @shixuns do |shixun|
json.id shixun.id
json.identifier shixun.identifier
json.name shixun.name
json.status shixun.status
json.power (current_user.shixun_permission(shixun)) # 现在首页只显示已发布的实训
# REDO: 局部缓存
json.tag_name @tag_name_map&.fetch(shixun.id, nil) || shixun.tag_repertoires.first.try(:name)
json.myshixuns_count shixun.myshixuns_count
json.stu_num shixun.myshixuns_count
json.score_info shixun.averge_star
json.challenges_count shixun.challenges_count
#json.exp shixun.all_score
json.level level_to_s(shixun.trainee)
json.pic Util::FileManage.source_disk_file_url(shixun, '_weapp')
end
end
json.subjects do
json.partial! 'subjects/subject', locals: { subjects: @subjects }
end