|
|
|
@ -626,14 +626,14 @@ update
|
|
|
|
|
graph.burn
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 用户每月提交次数
|
|
|
|
|
# 用户最近一年的提交次数
|
|
|
|
|
def graph_author_commits_per_month(repository)
|
|
|
|
|
@date_to = Date.today
|
|
|
|
|
@date_from = @date_to << 1
|
|
|
|
|
@date_from = @date_to << 12
|
|
|
|
|
@date_from = Date.civil(@date_from.year, @date_from.month, @date_from.day)
|
|
|
|
|
commits_by_author = Changeset.count(:all, :group => :committer,
|
|
|
|
|
:conditions => ["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to])
|
|
|
|
|
commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(40)
|
|
|
|
|
commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(25)
|
|
|
|
|
|
|
|
|
|
fields = commits_by_author.collect {|r| r.first}
|
|
|
|
|
commits_data = commits_by_author.collect {|r| r.last}
|
|
|
|
@ -652,8 +652,9 @@ update
|
|
|
|
|
:scale_integers => true,
|
|
|
|
|
:show_data_values => true,
|
|
|
|
|
:rotate_y_labels => false,
|
|
|
|
|
:graph_title => l(:label_author_commits_per_month),
|
|
|
|
|
:show_graph_title => true
|
|
|
|
|
:graph_title => l(:label_author_commits_year),
|
|
|
|
|
:show_graph_title => true,
|
|
|
|
|
:no_css => true
|
|
|
|
|
)
|
|
|
|
|
graph.add_data(
|
|
|
|
|
:data => commits_data,
|
|
|
|
@ -735,7 +736,7 @@ update
|
|
|
|
|
)
|
|
|
|
|
graph.add_data(
|
|
|
|
|
:data => commits_data,
|
|
|
|
|
:title => l(:label_revision_plural)
|
|
|
|
|
:title => l(:lable_revision_code_count)
|
|
|
|
|
)
|
|
|
|
|
graph.burn
|
|
|
|
|
end
|
|
|
|
|