json.normal_count @normal_count json.leave_count @leave_count json.absence_count @absence_count json.all_count @all_count json.code @attendance.attendance_code json.edit_auth @user_course_identity < Course::PROFESSOR || @attendance.user_id == User.current.id json.course_groups @groups do |group| json.(group, :id, :name, :course_members_count) json.attendance_count group_attendance_count(@all_attendances, group) if @_is_current_attendance end