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_works/comment_list.json.jbuilder

22 lines
802 B

json.ultimate @work.ultimate_score
json.last_comment do
json.last_content @last_comment.try(:comment)
json.last_score @last_comment.try(:score)
end
json.comment_scores @comment_scores do |score|
json.user_login score.user.login
json.user_image_url url_to_avatar(score.user)
json.user_name score.user.real_name
json.comment_id score.id
json.comment_role score.reviewer_role == 1 ? "教师" : "交叉评阅"
json.comment_time score.created_at
json.score score.score
json.content score.comment
json.is_invalid score.is_invalid
json.delete @current_user == score.user && (score.is_invalid || score.score.nil?)
json.attachments score.attachments do |atta|
json.partial! "attachments/attachment_simple", locals: {attachment: atta, delete: false}
end
end