From d89cba7a1fa9338a2c1baa70acda2c66770e4f9d Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 26 Jul 2015 14:12:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index bbc3e1596..41b44b6cd 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -670,7 +670,7 @@ update @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} @@ -705,7 +705,7 @@ update @date_from = @date_to << 6 @date_from = Date.civil(@date_from.year, @date_from.month, @date_from.day) commits_by_author = Changeset.count(: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) all_author = [] commits_by_author.each do |cba| all_author << cba.first @@ -734,6 +734,10 @@ update :graph_title => l(:label_author_code_six_month), :show_graph_title => true ) + commits_data1 = [0]*12 + graph.add_data( + :data => commits_data1, + ) graph.add_data( :data => commits_data, :title => l(:lable_revision_code_count)