aboutsummaryrefslogtreecommitdiff
path: root/layouts/issues/issue.html
blob: b7ec2ce988820b20f47b9a69c7434f5485f1da8b (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
87
88
89
90
91
92
93
94
95
96
97
{{ $incidents := where .Site.RegularPages "Params.section" "issue" }}
{{ $active := where $incidents "Params.resolved" "=" false }}

{{ $isNotice := where $active "Params.severity" "=" "notice" }}
{{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }}
{{ $isDown := where $active "Params.severity" "=" "down" }}

<div class="article">
  <h1 class="clean">
    {{ .Title }}
  </h1>

  <small class="date">
    {{ if .Site.Params.dateFormat }}
      {{ dateFormat .Site.Params.dateFormat .Params.date }}
    {{ else }}
      {{ .Date.Format "January 2, 2006 at 3:04 PM" }}
    {{ end }}
  </small>

  <p><small>
    {{ range .Params.Affected }}
      <a href="{{ printf "affected/%s/" (. | urlize) | relURL }}" class="tag no-underline">{{ . }}</a>
    {{ end }}
  </small></p>

  {{ if .Params.informational }}
  {{ else if .Params.Resolved }}
  {{ $t := (time .Params.ResolvedWhen) }}
  {{ $timeDiff := (sub $t.Unix .Date.Unix) }}
  {{ $diffInMin := (div $timeDiff 60) }}


  <!-- Marker -->
  {{ if lt $timeDiff 60 }}
  <div class="faded">
    <strong>
    {{ T "resolved" }} {{ T "inUnderAMinute" }}.
    </strong>
  </div>
  {{ else }}
    {{ if gt $timeDiff 3600 }}
      <div class="warning tooltip">
        <strong>
          {{ T "resolvedAfter" }}

          {{ $minutesForCalc := (mod $diffInMin 60) }}

          {{ div (sub $diffInMin $minutesForCalc) 60 }}h
          {{ $minutesForCalc }}m {{ T "ofDowntime" }}.
        </strong>

        <span class="tooltip__text">
          {{ if .Site.Params.dateFormat }}
            {{ dateFormat .Site.Params.dateFormat .Params.resolvedWhen }}
          {{ else }}
            {{ dateFormat "January 2, 2006 at 3:04 PM" .Params.resolvedWhen }}
          {{ end }}
        </span>
      </div>
    {{ else }}
      <div class="ok tooltip">
        <strong>
          {{ T "resolvedAfter" }}

          {{ $secsForCalc := (mod $timeDiff 60) }}

          {{ div (sub $timeDiff $secsForCalc) 60 }}m
          {{ T "ofDowntime" }}.
        </strong>

        <span class="tooltip__text">
          {{ if .Site.Params.dateFormat }}
            {{ dateFormat .Site.Params.dateFormat .Params.resolvedWhen }}
          {{ else }}
            {{ dateFormat "January 2, 2006 at 3:04 PM" .Params.resolvedWhen }}
          {{ end }}
        </span>
      </div>
    {{ end }}
  {{ end }}
  {{ else }}
    <strong class="error">
      {{ if eq .Params.severity "down" }}
      ■ 
      {{ else if eq .Params.severity "disrupted" }}
      ▲ 
      {{ else }}
      ◆ 
      {{ end }}
      {{ T "downtimeOngoing" }}</strong>
  {{ end }}

  <hr>
  {{ .Content }}
</div>
<div class="padding"></div>