aboutsummaryrefslogtreecommitdiff
path: root/layouts/index.html
blob: eedb08de2da8d221c42fdee6a0fdf23cae9f59bc (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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{{ partial "meta" . }}

{{ $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" }}

  <body class="status status-{{ if $isDown }}down{{ else }}{{ if $isDisrupted}}disrupted{{ else }}{{ if $isNotice }}notice{{ else }}ok{{ end }}{{ end }}{{ end }} {{ if not .Site.Params.alwaysKeepBrandColor }}change-header-color{{ end }}">
    {{ partial "header" . }}

    <!-- Main -->
    <div class="contain">
      <noscript>
        <p class="error">Uh oh! It looks like you have disabled JavaScript. Please <a href="//enable-javascript.com">enable scripting</a> to enhance your experience on this website.</p>
        <div class="padding"></div>
      </noscript>

      <!-- Main info -->
      <div class="summary">
        <strong>
          {{ if $isDown }}
            Experiencing major issues
          {{ else }}
          {{ if $isDisrupted }}
            Experiencing disruptions
          {{ else }}
          {{ if $isNotice }}
            Please read announcement
          {{ else }}
            All systems operational
          {{ end }}{{ end }}{{ end }}
        </strong>

          <span class="status summary__date" onclick="location.reload()"></span>
        </div>

      {{ if $active }}
      <div class="announcement-box">
        {{ range $active }}
          <div class="padding">
            <p><strong>{{ .Title }}</strong></p>
            {{ .Content }}
          </div>
        {{ else }}{{ end }}
      </div>
      {{ end }}


      <!-- Individual info -->
      <div class="padding"></div>
      <div class="components">
        {{ $systems := .Site.Params.systems }}
        {{ range $index, $systems }}
          {{ $activeComponentIssues := where $active "Params.affected" "intersect" (slice .) }}

          {{ $thisIsNotice := where $activeComponentIssues "Params.severity" "=" "notice" }}
          {{ $thisIsDisrupted := where $activeComponentIssues "Params.severity" "=" "disrupted" }}
          {{ $thisIsDown := where $activeComponentIssues "Params.severity" "=" "down" }}

          <div class="component" data-status="{{ if $thisIsDown }}down{{ else }}{{ if $thisIsDisrupted }}disrupted{{ else }}{{ if $thisIsNotice }}notice{{ else }}ok{{ end }}{{ end }}{{ end }}">
            {{ $this := . }}
            {{ . }}
            <span class="component-status">
              {{ if $thisIsDown }}
                Down
              {{ else }}
              {{ if $thisIsDisrupted }}
                Disrupted
              {{ else }}
              {{ if $thisIsNotice }}
                Maintenance
              {{ else }}
                Operational
              {{ end }}{{ end }}{{ end }}
            </span>
          </div>
        {{ end }}
      </div>

    <!-- End main -->
  </div>


  <div class="tabs">
    <div class="contain tabs--inner">
      <a href="#incidents" class="tab tab--current">
        Incidents
      </a>
      <a href="/stats" class="tab tab--other">
        Uptime
      </a>
    </div>
  </div>


  <div class="contain">
    <div class="padding"></div>
    {{ if not .Data.Pages }}
      <p class="center">Looks like we do not have any incidents logged.</p>
    {{ else }}
      {{ range .Data.Pages }}
        {{ .Render "issue" }}
      {{ end }}
    {{ end }}
  </div>

  {{ partial "js" . }}
  {{ partial "footer" . }}
  </body>
</html>