using author name instead of email in charts

This commit is contained in:
Tomasz Gieniusz 2012-10-23 20:38:52 +02:00
parent 5b3b15f238
commit dc4d2a08e9
3 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@ module GitStats
def commits_sum_by_author_by_date(limit = 4)
Chart.new do |f|
f.multi_date_chart(
data: @authors.sort_by { |author| -author.commits.size }[0..limit].map { |author| {name: author.email, data: author.commits_sum_by_date} },
data: @authors.sort_by { |author| -author.commits.size }[0..limit].map { |author| {name: author.name, data: author.commits_sum_by_date} },
title: :lines_by_date.t,
y_text: :lines.t
)
@ -21,7 +21,7 @@ module GitStats
define_method "#{method}_by_author_by_date" do |limit = 4|
Chart.new do |f|
f.multi_date_chart(
data: @authors.sort_by { |author| -author.send(method) }[0..limit].map { |author| {name: author.email, data: author.send("#{method}_by_date")} },
data: @authors.sort_by { |author| -author.send(method) }[0..limit].map { |author| {name: author.name, data: author.send("#{method}_by_date")} },
title: :lines_by_date.t,
y_text: :lines.t
)

View File

@ -19,7 +19,7 @@
.tab-pane.active
.page-header.pagination-centered
%h1= page.t
%h3= author.respond_to?(:name) ? author.name : ""
%h3= "#{author.respond_to?(:name) ? author.name : ""} #{author.respond_to?(:email) ? "<#{author.email}>" : ""}"
- if page == :activity_by_date
= high_stock("charts.activity_by_date", charts.activity_by_date(author))

View File

@ -31,7 +31,7 @@
- sorted_authors.each_with_index do |author, i|
%tr
%th= i+1
%th= author.name
%th= "#{author.name} <#{author.email}>"
%td= author.commits.size
%td= author.insertions
%td= author.deletions