summaryrefslogtreecommitdiff
path: root/app/views/projects/pipelines/charts/_pipelines.haml
blob: 47f1f07421060e014160032b32ae180b2139e83a (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
%h4= _("Pipelines charts")
%p
   
  %span.legend-success
    = icon("circle")
    = s_("Pipeline|success")
   
  %span.legend-all
    = icon("circle")
    = s_("Pipeline|all")

.prepend-top-default
  %p.light
    = _("Pipelines for last week")
    (#{date_from_to(Date.today - 7.days, Date.today)})
  %div
    %canvas#weekChart{ height: 200 }

.prepend-top-default
  %p.light
    = _("Pipelines for last month")
    (#{date_from_to(Date.today - 30.days, Date.today)})
  %div
    %canvas#monthChart{ height: 200 }

.prepend-top-default
  %p.light
    = _("Pipelines for last year")
  %div
    %canvas#yearChart.padded{ height: 250 }

-# haml-lint:disable InlineJavaScript
%script#pipelinesChartsData{ type: "application/json" }
  - chartData = []
  - [:week, :month, :year].each do |scope|
    - chartData.push({ 'scope' => scope, 'labels' => @charts[scope].labels, 'totalValues' => @charts[scope].total, 'successValues' => @charts[scope].success })
  = chartData.to_json.html_safe