diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 355033b8f..bbc3e1596 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -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 diff --git a/config/locales/zh.yml b/config/locales/zh.yml index a5f4f4d10..78e8379dc 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -669,6 +669,7 @@ zh: label_tag: 标签 label_revision: 修订 label_revision_plural: 修订 + lable_revision_code_count: 代码量 label_revision_id: 修订 %{value} label_associated_revisions: 相关修订版本 label_added: 已添加