summaryrefslogtreecommitdiff
path: root/app/views/projects/graphs/charts.html.haml
blob: 7257dacf680ed5c6f37cccf71db6ea18b31c3220 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
- page_title _("Repository Analytics")

.mb-3
  %h3
    = _("Repository Analytics")

.repo-charts
  %h4.sub-header
    = _("Programming languages used in this repository")

  %p
    = _("Measured in bytes of code. Excludes generated and vendored code.")

  #js-languages-chart{ data: { chart_data: @languages.to_json.html_safe } }

- if defined?(@daily_coverage_options)
  .repo-charts.my-5
    .sub-header-block.border-top
    .d-flex.justify-content-between.align-items-center
      %h4.sub-header.m-0
        - start_date = capture do
          #{@daily_coverage_options[:base_params][:start_date].strftime('%b %d')}
        - end_date = capture do
          #{@daily_coverage_options[:base_params][:end_date].strftime('%b %d')}
        = (_("Code coverage statistics for master %{start_date} - %{end_date}") % {start_date: start_date, end_date: end_date})
      - download_path = capture do
        #{@daily_coverage_options[:download_path]}
      %a.btn.btn-sm{ href: "#{download_path}?#{@daily_coverage_options[:base_params].to_query}" }
        %small
          = _("Download raw data (.csv)")
    #js-code-coverage-chart{ data: { daily_coverage_options: @daily_coverage_options.to_json.html_safe } }

.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
      = _("Excluding merge commits. Limited to %{limit} commits.") % {limit: number_with_delimiter(@commits_limit, delimiter: ',')}

    .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
        #js-month-chart{ data: { chart_data: @commits_per_month.to_json.html_safe } }
  .row
    .col-md-6
    .col-md-6
      %p.slead
        = _("Commits per weekday")
      %div
        #js-weekday-chart{ data: { chart_data: @commits_per_week_days.to_json.html_safe } }
  .row
    .col-md-6
    .col-md-6
      %p.slead
        = _("Commits per day hour (UTC)")
      %div
        #js-hour-chart{ data: { chart_data: @commits_per_time.to_json.html_safe } }