This commit is contained in:
Wen 2014-05-05 10:03:13 +08:00
parent c6576c71bf
commit 501b491363
2 changed files with 11 additions and 1 deletions

View File

@ -297,6 +297,14 @@ module UserScoreHelper
return (commit_count + issue_details_count)
end
def calculate_attachments(user)
attachments = Attachment.where("container_type IS NOT NULL AND container_type <> 'Issue' AND author_id = ?", user.id).count
return attachments
end
def calculate_user_score(user)
collaboration = calculate_collaboration_count(user)

View File

@ -4,13 +4,14 @@
<% users = User.all%>
<table>
<tr>
<th>name</th><th>C</th><th>I</th><th>S</th><th>filecount</th><th>issuecount</th><th>level</th>
<th>id</th><th>name</th><th>C</th><th>I</th><th>S</th><th>filecount</th><th>issuecount</th><th>level</th><th>attachconut</th>
</tr>
<% users.each do |user| %>
<tr>
<td><%= user.id %></td>
<td><%= user.lastname %><%= user.firstname %></td>
<td><%= calculate_collaboration_count(user) %></td>
<td><%= calculate_influence_count(user) %></td>
@ -18,6 +19,7 @@
<td><%= calculate_file(user) %></td>
<td><%= calculate_issue(user) %></td>
<td><%= calculate_level(user) %></td>
<td><%= calculate_attachments(user) %></td>
</tr>
<% end %>