gitlab-org--gitlab-foss/app/views/projects/graphs/charts.html.haml
Fatih Acet 3741402a24 Make flash notifications sticky
This commit also unifies layout structure
and remove no_container flag
2019-09-03 09:03:35 +00:00

83 lines
2.4 KiB
Text

- page_title _("Contribution Charts")
.repo-charts
%h4.sub-header
= _("Programming languages used in this repository")
.row
.col-md-4
%ul.bordered-list
- @languages.each do |language|
%li
%span{ style: "color: #{language[:color]}" }
= icon('circle')
 
= language[:label]
.float-right
= language[:value]
\%
.col-md-8
%canvas#languages-chart{ height: 400 }
.repo-charts
.sub-header-block.border-top
.row.tree-ref-header
.col-md-6
%h4
- start_time = capture do
#{@commits_graph.start_date.strftime('%b %d')}
- end_time = capture do
#{@commits_graph.end_date.strftime('%b %d')}
= (_("Commit statistics for %{ref} %{start_time} - %{end_time}") % { ref: "<strong>#{h @ref}</strong>", start_time: start_time, end_time: end_time }).html_safe
.col-md-6
.tree-ref-container
.tree-ref-holder
= render 'shared/ref_switcher', destination: 'graphs_commits'
%ul.breadcrumb.repo-breadcrumb
= commits_breadcrumbs
.row
.col-md-6
%ul.commit-stats
%li
- total = capture do
#{@commits_graph.commits.size}
= (_("Total: %{total}") % { total: "<strong>#{total} commits</strong>" }).html_safe
%li
- average = capture do
#{@commits_graph.commit_per_day}
= (_("Average per day: %{average}") % { average: "<strong>#{average} commits</strong>" }).html_safe
%li
- authors = capture do
#{@commits_graph.authors}
= (_("Authors: %{authors}") % { authors: "<strong>#{authors}</strong>" }).html_safe
.col-md-6
%p.slead
= _("Commits per day of month")
%div
%canvas#month-chart
.row
.col-md-6
.col-md-6
%p.slead
= _("Commits per weekday")
%div
%canvas#weekday-chart
.row
.col-md-6
.col-md-6
%p.slead
= _("Commits per day hour (UTC)")
%div
%canvas#hour-chart
-# haml-lint:disable InlineJavaScript
%script#projectChartData{ type: "application/json" }
- projectChartData = {};
- projectChartData['hour'] = @commits_per_time
- projectChartData['weekDays'] = @commits_per_week_days
- projectChartData['month'] = @commits_per_month
- projectChartData['languages'] = @languages
= projectChartData.to_json.html_safe