2015-09-17 06:16:24 -04:00
|
|
|
- page_title "Commits", "Graphs"
|
|
|
|
= render "header_title"
|
2015-11-08 14:31:55 -05:00
|
|
|
= render 'head'
|
2015-11-08 13:29:22 -05:00
|
|
|
|
2015-11-10 05:49:38 -05:00
|
|
|
.gray-content-block.append-bottom-default
|
2015-11-08 13:29:22 -05:00
|
|
|
.tree-ref-holder
|
|
|
|
= render 'shared/ref_switcher', destination: 'graphs_commits'
|
|
|
|
%ul.breadcrumb.repo-breadcrumb
|
|
|
|
= commits_breadcrumbs
|
2014-09-26 13:32:44 -04:00
|
|
|
|
|
|
|
%p.lead
|
2015-03-03 17:05:31 -05:00
|
|
|
Commit statistics for
|
2015-07-02 14:12:24 -04:00
|
|
|
%strong #{@ref}
|
2014-09-29 05:05:17 -04:00
|
|
|
#{@commits_graph.start_date.strftime('%b %d')} - #{@commits_graph.end_date.strftime('%b %d')}
|
2014-09-26 13:32:44 -04:00
|
|
|
|
|
|
|
.row
|
|
|
|
.col-md-6
|
|
|
|
%ul
|
|
|
|
%li
|
|
|
|
%p.lead
|
2014-09-29 05:05:17 -04:00
|
|
|
%strong #{@commits_graph.commits.size}
|
2014-09-26 13:32:44 -04:00
|
|
|
commits during
|
2014-09-29 05:05:17 -04:00
|
|
|
%strong #{@commits_graph.duration}
|
2014-09-26 13:32:44 -04:00
|
|
|
days
|
|
|
|
%li
|
|
|
|
%p.lead
|
|
|
|
Average
|
2014-09-29 05:05:17 -04:00
|
|
|
%strong #{@commits_graph.commit_per_day}
|
2014-09-26 13:32:44 -04:00
|
|
|
commits per day
|
|
|
|
%li
|
|
|
|
%p.lead
|
|
|
|
Contributed by
|
2014-09-29 05:05:17 -04:00
|
|
|
%strong #{@commits_graph.authors}
|
2014-09-26 13:32:44 -04:00
|
|
|
authors
|
|
|
|
.col-md-6
|
|
|
|
%div
|
|
|
|
%p.slead
|
|
|
|
Commits per day of month
|
2015-09-22 14:17:36 -04:00
|
|
|
%canvas#month-chart
|
2014-09-26 13:32:44 -04:00
|
|
|
.row
|
|
|
|
.col-md-6
|
|
|
|
%div
|
|
|
|
%p.slead
|
|
|
|
Commits per day hour (UTC)
|
2015-09-22 14:17:36 -04:00
|
|
|
%canvas#hour-chart
|
2014-09-26 13:32:44 -04:00
|
|
|
.col-md-6
|
|
|
|
%div
|
|
|
|
%p.slead
|
|
|
|
Commits per weekday
|
2015-09-22 14:17:36 -04:00
|
|
|
%canvas#weekday-chart
|
2014-09-26 13:32:44 -04:00
|
|
|
|
2015-11-10 06:17:37 -05:00
|
|
|
:javascript
|
|
|
|
var responsiveChart = function (selector, data) {
|
|
|
|
var options = { "scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2, maintainAspectRatio: false };
|
|
|
|
// get selector by context
|
|
|
|
var ctx = selector.get(0).getContext("2d");
|
|
|
|
// pointing parent container to make chart.js inherit its width
|
|
|
|
var container = $(selector).parent();
|
|
|
|
var generateChart = function() {
|
|
|
|
selector.attr('width', $(container).width());
|
|
|
|
return new Chart(ctx).Bar(data, options);
|
|
|
|
};
|
|
|
|
// enabling auto-resizing
|
|
|
|
$(window).resize(generateChart);
|
|
|
|
return generateChart();
|
|
|
|
};
|
2014-09-26 13:32:44 -04:00
|
|
|
|
2015-11-10 06:17:37 -05:00
|
|
|
var chartData = function (keys, values) {
|
|
|
|
var data = {
|
2015-09-22 14:17:36 -04:00
|
|
|
labels : keys,
|
|
|
|
datasets : [{
|
|
|
|
fillColor : "rgba(220,220,220,0.5)",
|
|
|
|
strokeColor : "rgba(220,220,220,1)",
|
|
|
|
barStrokeWidth: 1,
|
|
|
|
barValueSpacing: 1,
|
|
|
|
barDatasetSpacing: 1,
|
|
|
|
data : values
|
|
|
|
}]
|
2015-11-10 06:17:37 -05:00
|
|
|
};
|
|
|
|
return data;
|
|
|
|
};
|
2014-09-26 13:32:44 -04:00
|
|
|
|
2015-11-10 06:17:37 -05:00
|
|
|
var hourData = chartData(#{@commits_per_time.keys.to_json}, #{@commits_per_time.values.to_json});
|
|
|
|
responsiveChart($('#hour-chart'), hourData);
|
2015-09-22 14:17:36 -04:00
|
|
|
|
2015-11-10 06:17:37 -05:00
|
|
|
var dayData = chartData(#{@commits_per_week_days.keys.to_json}, #{@commits_per_week_days.values.to_json});
|
|
|
|
responsiveChart($('#weekday-chart'), dayData);
|
2015-09-22 14:17:36 -04:00
|
|
|
|
2015-11-10 06:17:37 -05:00
|
|
|
var monthData = chartData(#{@commits_per_month.keys.to_json}, #{@commits_per_month.values.to_json});
|
|
|
|
responsiveChart($('#month-chart'), monthData);
|