json.subjects @subjects do |subject|
  json.(subject, :id, :excellent, :name, :stages_count, :shixuns_count)
  json.myshixuns_count subject.myshixuns_count
  json.challenges_count subject.subject_challenge_count
  json.image_url url_to_avatar(subject)
  json.allow_visit subject.status > 1 || User.current.manager_of_subject?(subject) || User.current.admin?
end

json.total_count @subject_count