change contribution
This commit is contained in:
parent
66a6e0482b
commit
cde3df54aa
|
@ -8,9 +8,15 @@ class ContributionsController < ApplicationController
|
|||
@project_menu_type = 12
|
||||
|
||||
# 计算每个分支每个人的贡献占比
|
||||
commits_by_author = Changeset.count(:all, :group => :committer, :conditions => ["repository_id = ?", @repository.id])
|
||||
Rails.logger.info(commits_by_author)
|
||||
|
||||
project_id = @project.gpid
|
||||
rev = "master"
|
||||
g = Gitlab.client
|
||||
begin
|
||||
@static_total_per_user = g.rep_stats(project_id, :rev => rev)
|
||||
rescue
|
||||
render_404
|
||||
return
|
||||
end
|
||||
|
||||
render :layout => 'base_projects'
|
||||
end
|
||||
|
|
|
@ -5,4 +5,25 @@
|
|||
|
||||
|
||||
<% html_title(l(:label_calendar)) -%>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<table>
|
||||
<tr>
|
||||
<td>用户名</td>
|
||||
<td>代码总量</td>
|
||||
<td>增加代码</td>
|
||||
<td>删除代码</td>
|
||||
<td>变更代码</td>
|
||||
</tr>
|
||||
<% @static_total_per_user.each do |static| %>
|
||||
<tr>
|
||||
<td><%=static.uname %></td>
|
||||
<td><%=static.commits_num %></td>
|
||||
<td><%=static.add %></td>
|
||||
<td><%=static.del %></td>
|
||||
<td><%=static.changes %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
Loading…
Reference in New Issue