2014-01-16 10:34:39 +08:00
|
|
|
<!-- added by bai -->
|
|
|
|
<% messages_count = @user.messages.count %>
|
|
|
|
<% messages_score = messages_count * 0.05%>
|
|
|
|
<% finall_messages_score = messages_score %>
|
|
|
|
|
|
|
|
<% journals_count = @user.journals.count %>
|
|
|
|
<% journals_score = journals_count * 0.1 %>
|
|
|
|
<% user_changesets_count = @user.changesets.count %>
|
|
|
|
<% user_changesets_score = user_changesets_count * 0.3 %>
|
|
|
|
<% finall_user_project_score = journals_score + user_changesets_score %>
|
|
|
|
|
2014-04-11 10:53:51 +08:00
|
|
|
<% journals_for_messages_count = @user.journals_messages.count %>
|
2014-01-16 10:34:39 +08:00
|
|
|
<% activities_count = @user.activities.count %>
|
|
|
|
<% journals_for_messages_score = journals_for_messages_count * 0.05 %>
|
|
|
|
<% activities_score = activities_count * 0.2 %>
|
|
|
|
<% finall_activity_score = journals_for_messages_score + activities_score %>
|
|
|
|
|
|
|
|
<% news_count = @user.news.count %>
|
|
|
|
<% news_score = news_count * 0.1 %>
|
|
|
|
<% wiki_contents_count = @user.wiki_contents.count %>
|
|
|
|
<% wiki_contents_score = wiki_contents_count * 0.1 %>
|
|
|
|
<% comments_count = @user.comments.count %>
|
|
|
|
<% comments_score = comments_count * 0.1 %>
|
|
|
|
<% finall_influence_score = news_score + wiki_contents_score + comments_score %>
|
|
|
|
<% finall_user_score = finall_messages_score + finall_user_project_score + finall_activity_score + finall_influence_score %>
|
|
|
|
|
|
|
|
<div><%= l(:label_user_score) %></div>
|
|
|
|
<div> = <%= l(:label_user_score_of_topic) %> + <%= l(:label_user_score_of_project) %> +
|
2014-03-06 15:42:19 +08:00
|
|
|
<%= l(:label_user_score_of_activity)%> + <%= l(:label_user_score_of_influence) %></div>
|
|
|
|
<!-- <div> + <%= l(:label_user_score_of_influence) %></div> -->
|
2014-01-16 10:34:39 +08:00
|
|
|
<div> = <%= format("%.2f" , finall_messages_score).to_f %> + <%= format("%.2f" , finall_user_project_score).to_f %> +
|
|
|
|
<%= format("%.2f" , finall_activity_score).to_f %> + <%= format("%.2f" , finall_influence_score).to_f %></div>
|
|
|
|
<div> = <%= format("%.2f" , finall_user_score).to_f %></div>
|
|
|
|
<!-- end -->
|