% #==== Common Util Libraries ==== def get_comment_list_from_data(data) comment_list=Array.new; data[:registry_settings].each do |d| if (nil==d[:comments]) then next end comment_list.push({ #Here a little odd, when the setting is from USER, the comments of the setting is from admin :who => d[:from] == "USER" ? 'admin' : 'applicant', :text => d[:comments], :date => d[:updated_at], :highlight => false }); end if(data[:registry_settings][1] && data[:registry_settings][1][:comments]) then #if the latest comment does exist, highlight it comment_list[0][:highlight]=true end return comment_list end %>