mirror of https://github.com/tomgi/git_stats.git
year
This commit is contained in:
parent
470bcd4ecf
commit
65bbdfa87a
|
@ -24,3 +24,7 @@ en:
|
||||||
hour_of_week: Hour of week
|
hour_of_week: Hour of week
|
||||||
month: Month
|
month: Month
|
||||||
month_of_year: Month of year
|
month_of_year: Month of year
|
||||||
|
commits_by_wday: Commits by day of week
|
||||||
|
commits_by_month: Commits by month of year
|
||||||
|
year: Year
|
||||||
|
commits_by_year: Commits by year
|
|
@ -41,6 +41,17 @@ module GitStats
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def activity_by_year
|
||||||
|
Chart.new do |f|
|
||||||
|
f.column_hash_chart(
|
||||||
|
title: :commits_by_year.t,
|
||||||
|
y_text: :commits.t,
|
||||||
|
x_text: :year.t,
|
||||||
|
data: @activity.by_year
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,7 +5,7 @@ module GitStats
|
||||||
delegate :files_by_extension, :lines_by_extension, :files_by_date, :lines_by_date,
|
delegate :files_by_extension, :lines_by_extension, :files_by_date, :lines_by_date,
|
||||||
:lines_added_by_author, :lines_deleted_by_author, to: :repo_charts
|
:lines_added_by_author, :lines_deleted_by_author, to: :repo_charts
|
||||||
delegate :by_authors_wday, to: :authors_charts
|
delegate :by_authors_wday, to: :authors_charts
|
||||||
delegate :activity_by_hour, :activity_by_wday, :activity_by_month, to: :activity_charts
|
delegate :activity_by_hour, :activity_by_wday, :activity_by_month, :activity_by_year, to: :activity_charts
|
||||||
|
|
||||||
attr_reader :repo
|
attr_reader :repo
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
%a{:href => '#hour_of_week', 'data-toogle' => 'tab'}= :hour_of_week.t
|
%a{:href => '#hour_of_week', 'data-toogle' => 'tab'}= :hour_of_week.t
|
||||||
%li
|
%li
|
||||||
%a{:href => '#month_of_year', 'data-toogle' => 'tab'}= :month_of_year.t
|
%a{:href => '#month_of_year', 'data-toogle' => 'tab'}= :month_of_year.t
|
||||||
|
%li
|
||||||
|
%a{:href => '#year', 'data-toogle' => 'tab'}= :year.t
|
||||||
|
|
||||||
.tab-content
|
.tab-content
|
||||||
.tab-pane.active{id: 'hour_of_day'}
|
.tab-pane.active{id: 'hour_of_day'}
|
||||||
|
@ -78,3 +80,9 @@
|
||||||
- repo.activity.by_month_array.each do |commits|
|
- repo.activity.by_month_array.each do |commits|
|
||||||
%td= (commits * 100.0 / repo.activity.by_month_array.sum).round(2)
|
%td= (commits * 100.0 / repo.activity.by_month_array.sum).round(2)
|
||||||
= high_chart("activity_by_month", charts.activity_by_month)
|
= high_chart("activity_by_month", charts.activity_by_month)
|
||||||
|
|
||||||
|
|
||||||
|
.tab-pane{id: 'year'}
|
||||||
|
.page-header
|
||||||
|
%h1.pagination-centered= :year.t
|
||||||
|
= high_chart("activity_by_year", charts.activity_by_year)
|
|
@ -21,7 +21,7 @@
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
%body
|
%body
|
||||||
%div.navbar.navbar-inverse.navbar-fixed-top
|
%div.navbar.navbar-fixed-top
|
||||||
%div.navbar-inner
|
%div.navbar-inner
|
||||||
%div.container
|
%div.container
|
||||||
%a.btn.btn-navbar{'data-toggle' => "collapse", 'data-target' => ".nav-collapse"}
|
%a.btn.btn-navbar{'data-toggle' => "collapse", 'data-target' => ".nav-collapse"}
|
||||||
|
|
Loading…
Reference in New Issue