Skip to content

Commit

Permalink
using author name instead of email in charts
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgi committed Oct 23, 2012
1 parent 5b3b15f commit dc4d2a0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/git_stats/stats_view/charts/authors_charts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize(authors)
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
)
Expand All @@ -21,7 +21,7 @@ def commits_sum_by_author_by_date(limit = 4)
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
)
Expand Down
2 changes: 1 addition & 1 deletion templates/activity/_activity.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
2 changes: 1 addition & 1 deletion templates/authors/_authors.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dc4d2a0

Please sign in to comment.