aboutsummaryrefslogtreecommitdiff
path: root/layouts/issues
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/issues')
-rw-r--r--layouts/issues/issue.html96
-rw-r--r--layouts/issues/single.html6
-rw-r--r--layouts/issues/small.html76
3 files changed, 145 insertions, 33 deletions
diff --git a/layouts/issues/issue.html b/layouts/issues/issue.html
index 014a33a..c344f57 100644
--- a/layouts/issues/issue.html
+++ b/layouts/issues/issue.html
@@ -6,43 +6,81 @@
{{ $isDown := where $active "Params.severity" "=" "down" }}
<div class="article">
+ <h1 class="clean">
+ {{ .Title }}
+ </h1>
+
+ <small class="date">
+ {{ if .Site.Params.dateFormat }}
+ {{ .Date.Format .Site.Params.dateFormat }}
+ {{ else }}
+ {{ .Date.Format "January 2, 2006 at 3:04 PM" }}
+ {{ end }}
+ </small>
+
+ <p><small>
+ {{ range .Params.Affected }}
+ <a href="/affected/{{ . | urlize }}" class="tag no-underline">{{ . }}</a>
+ {{ end }}
+ </small></p>
+
{{ if .Params.Resolved }}
- <span class="ok">
-
- {{ $t := (time .Params.ResolvedWhen) }}
- {{ $timeDiff := (sub $t.Unix .Date.Unix) }}
- {{ $diffInMin := (div $timeDiff 60) }}
-
- <!-- Marker -->
- {{ if lt $timeDiff 60 }}
- ✓ 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" }}
- ✓ Resolved after
- {{ if gt $timeDiff 3600 }}
- {{ $minutesForCalc := (mod $diffInMin 60) }}
+ {{ $secsForCalc := (mod $timeDiff 60) }}
- {{ div (sub $diffInMin $minutesForCalc) 60 }}h
- {{ $minutesForCalc }}m of downtime
- {{ else }}
- {{ $secsForCalc := (mod $timeDiff 60) }}
+ {{ div (sub $timeDiff $secsForCalc) 60 }}m
+ {{ T "ofDowntime" }}.
+ </strong>
- {{ div (sub $timeDiff $secsForCalc) 60 }}m
- <!-- {{ $secsForCalc }}s --> of downtime
- {{ end }}
-
+ <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 }}
- </span>
+ {{ end }}
{{ else }}
- <em>Ongoing, services {{ if eq .Params.severity "notice" }}on notice{{ else }}{{ .Params.severity }}{{ end }}</em>
+ <strong class="error">{{ T "downtimeOngoing" }}</strong>
{{ end }}
- <h3>
- <a href="{{ .Permalink }}">{{ .Title }}</a>
- </h3>
-
- <small class="date">
- {{ .Date.Format "January 02, 2006 at 3:04 PM" }}
- </small>
<hr>
{{ .Content }}
diff --git a/layouts/issues/single.html b/layouts/issues/single.html
index 5076148..5761477 100644
--- a/layouts/issues/single.html
+++ b/layouts/issues/single.html
@@ -7,11 +7,9 @@
{{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }}
{{ $isDown := where $active "Params.severity" "=" "down" }}
- <body class="status-{{ if $isDown }}down{{ else }}{{ if $isDisrupted}}disrupted{{ else }}{{ if $isNotice }}notice{{ else }}ok{{ end }}{{ end }}{{ end }}">
- {{ partial "header" . }}
-
+ <body class="issues single">
<div class="contain">
- <a href="{{ .Site.BaseURL }}">← Go back</a>
+ <a href="{{ .Site.BaseURL }}">← {{ T "goBack" }} <em>{{ .Site.Title }}</em></a>
</div>
<div class="contain">
diff --git a/layouts/issues/small.html b/layouts/issues/small.html
new file mode 100644
index 0000000..6833b68
--- /dev/null
+++ b/layouts/issues/small.html
@@ -0,0 +1,76 @@
+{{ $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" }}
+
+<a href="{{ .Permalink }}" class="issue no-underline">
+ {{ if .Params.Resolved }}
+ <small class="date float-right">
+ {{ if .Site.Params.dateFormat }}
+ {{ .Date.Format .Site.Params.dateFormat }}
+ {{ else }}
+ {{ .Date.Format "January 2, 2006 at 3:04 PM" }}
+ {{ end }}
+ </small>
+
+ <h3>
+ {{ .Title }}
+ </h3>
+
+ {{ $t := (time .Params.ResolvedWhen) }}
+ {{ $timeDiff := (sub $t.Unix .Date.Unix) }}
+ {{ $diffInMin := (div $timeDiff 60) }}
+
+ <!-- Marker -->
+ {{ if lt $timeDiff 60 }}
+ <div class="faded">
+ {{ T "resolved" }} {{ T "inUnderAMinute" }}
+ </div>
+ {{ else }}
+ {{ if gt $timeDiff 3600 }}
+ <div class="warning">
+ {{ T "resolvedAfter" }}
+
+ {{ $minutesForCalc := (mod $diffInMin 60) }}
+
+ {{ div (sub $diffInMin $minutesForCalc) 60 }}h
+ {{ $minutesForCalc }}m {{ T "ofDowntime" }}
+ </div>
+ {{ else }}
+ <div class="ok">
+ {{ T "resolvedAfter" }}
+
+ {{ $secsForCalc := (mod $timeDiff 60) }}
+
+ {{ div (sub $timeDiff $secsForCalc) 60 }}m
+ <!-- {{ $secsForCalc }}s --> {{ T "ofDowntime" }}
+ </div>
+ {{ end }}
+ {{ end }}
+
+
+ {{ else }}
+
+ <small class="date float-right">
+ {{ if .Site.Params.dateFormat }}
+ {{ .Date.Format .Site.Params.dateFormat }}
+ {{ else }}
+ {{ .Date.Format "January 2, 2006 at 3:04 PM" }}
+ {{ end }}
+ </small>
+
+ <h3>
+ {{ .Title }}
+ </h3>
+
+ {{ $t := (time .Params.ResolvedWhen) }}
+ {{ $timeDiff := (sub $t.Unix .Date.Unix) }}
+ {{ $diffInMin := (div $timeDiff 60) }}
+
+ <!-- Marker -->
+ <div class="error">{{ T "downtimeOngoing" }}</div>
+
+ {{ end }}
+</a>