From 4a968698e45ece04b25f41783298b9b397a191a1 Mon Sep 17 00:00:00 2001 From: Mantas <11616378+mistermantas@users.noreply.github.com> Date: Thu, 24 Jan 2019 19:23:35 +0200 Subject: cState is now stable on v3.0 - 2019-01-24 (info: #41) --- layouts/404.html | 21 ++++ layouts/_default/list.html | 88 ++++++++++++++++ layouts/_default/list.xml | 30 ++++++ layouts/_default/single.html | 8 +- layouts/index.html | 61 +++++------ layouts/index.xml | 30 ++++++ layouts/issues/issue.html | 96 ++++++++++++------ layouts/issues/single.html | 6 +- layouts/issues/small.html | 76 ++++++++++++++ layouts/partials/footer.html | 22 +++- layouts/partials/header.html | 4 +- layouts/partials/js.html | 33 ++++-- layouts/partials/meta.html | 229 +++++++++++++++++++++++++----------------- layouts/shortcodes/track.html | 6 +- 14 files changed, 532 insertions(+), 178 deletions(-) create mode 100644 layouts/404.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/list.xml create mode 100644 layouts/index.xml create mode 100644 layouts/issues/small.html (limited to 'layouts') diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..64ff118 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,21 @@ +{{ 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" }} + + + {{ partial "header" . }} + +
+

{{ T "notFound" }}

+

{{ T "notFoundText" }}

+
+ + {{ partial "js" . }} + {{ partial "footer" . }} + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..b8c14c6 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,88 @@ +{{ partial "meta" . }} +{{ $title := .Title }} + + +
+
+ ← {{ T "goBack" }} {{ .Site.Title }} +
+
+ +

{{ $title }}

+ + {{ range .Site.Params.systems }} + {{ if eq .name $title }} + {{ with .description }} +

{{ . }}

+ {{ end }} + {{ end }} + {{ end }} + + {{ len .Pages }} {{ T "entries" }}, {{ T "newestToOldest" }} + +
+
+
+ {{ $incidents := .Pages }} +
+ +
+ {{ if not $incidents }} +
+

{{ T "calmBeforeTheStorm" }}

+

{{ T "noIncidentsDesc" }}

+
+
+
+ {{ else }} + {{ $paginator := .Paginate $incidents .Site.Params.incidentPostsPerPage }} + {{ range $paginator.Pages }} + {{ .Render "small" }} + {{ end }} + + + {{ if gt $paginator.TotalPages 1 }} +
+ +
+ {{ if $paginator.HasPrev }} + + ⭠   + {{ T "prev" }} + + {{ else }} + + ⭠   + {{ T "prev" }} + + {{ end }} + + +     + {{ $paginator.PageNumber }} + / + {{ $paginator.TotalPages }} +     + + + {{ if $paginator.HasNext }} + + {{ T "next" }}   + ⭢ + + {{ else }} + + {{ T "next" }}   + ⭢ + + {{ end }} +
+ {{ end }} + {{ end }} +
+
+ + {{ partial "js" . }} + {{ partial "footer" . }} + + diff --git a/layouts/_default/list.xml b/layouts/_default/list.xml new file mode 100644 index 0000000..219354b --- /dev/null +++ b/layouts/_default/list.xml @@ -0,0 +1,30 @@ + + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + {{ T "incidentHistory" }} + github.com/cstate + {{ with .Site.LanguageCode }}{{.}}{{end}} + {{ if not .Date.IsZero }} + {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }} + {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }} + {{ end }} + {{ with .Site.Copyright }} + {{.}}{{end}} + {{ with .OutputFormats.Get "RSS" }} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{ end }} + {{ range .Pages }} + + {{ if .Params.resolved }}[{{ T "resolved" }}] {{ end }}{{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ .Permalink }} + {{ .Params.resolvedWhen }} + {{ .Summary | html }} + {{ .Content | html }} + + {{ end }} + + diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 8463204..c1292b2 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,13 +1,11 @@ {{ partial "meta" . }} - - +
- ← Go back + ← {{ T "goBack" }} {{ .Site.Title }}
- {{ .Render "post" }} + {{ .Content }}
- {{ partial "js" . }} {{ partial "footer" . }} diff --git a/layouts/index.html b/layouts/index.html index 13e684d..2802ce1 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -13,7 +13,7 @@
@@ -21,28 +21,28 @@
{{ if $isDown }} - Experiencing major issues + {{ T "isDown" }} {{ else }} {{ if $isDisrupted }} - Experiencing disruptions + {{ T "isDisrupted" }} {{ else }} {{ if $isNotice }} - Please read announcement + {{ T "isNotice" }} {{ else }} - All systems operational + {{ T "isOk" }} {{ end }}{{ end }}{{ end }} - +
{{ if $active }}
{{ range $active }}
-

{{ .Title }}

+

{{ .Title }}

{{ .Content | safeHTML | truncate 500 "…" }} -

Continue reading

+

{{ T "continueReading" }}

{{ else }}{{ end }}
@@ -50,7 +50,7 @@ {{ if .Site.Params.autoRefresh }}
- We will try to refresh every 5 minutes + {{ T "autoRefreshNotice" }}
{{ else }} @@ -68,14 +68,15 @@ {{ $thisIsDown := where $activeComponentIssues "Params.severity" "=" "down" }}
- {{ $this := .name }} - {{ .name }} + + {{ .name }} + {{ with .description }} - +   (?) - + {{ . }} @@ -83,15 +84,15 @@ {{ if $thisIsDown }} - Down + {{ T "thisIsDown" }} {{ else }} {{ if $thisIsDisrupted }} - Disrupted + {{ T "thisIsDisrupted" }} {{ else }} {{ if $thisIsNotice }} - Maintenance + {{ T "thisIsNotice" }} {{ else }} - Operational + {{ T "thisIsOk" }} {{ end }}{{ end }}{{ end }} @@ -114,7 +115,7 @@
- Incidents + {{ T "incidents" }} {{ range .Site.Params.customTabs }} @@ -125,26 +126,25 @@
{{ else }} -
-

Incident history

-
+
+

{{ T "incidentHistory" }}

+
{{ end }} -
-
+
{{ if not $incidents }}
-

Is it the calm before the storm?

-

This status page has no logged incidents. This may be because the status page owner (or owners) have recently set up their status page, have had no downtime, or have not logged any downtime.

+

{{ T "calmBeforeTheStorm" }}

+

{{ T "noIncidentsDesc" }}

{{ else }} {{ $paginator := .Paginate $incidents .Site.Params.incidentPostsPerPage }} {{ range $paginator.Pages }} - {{ .Render "issue" }} + {{ .Render "small" }} {{ end }} @@ -155,12 +155,12 @@ {{ if $paginator.HasPrev }} ⭠   - Previuos + {{ T "prev" }} {{ else }} ⭠   - Previuos + {{ T "prev" }} {{ end }} @@ -174,18 +174,19 @@ {{ if $paginator.HasNext }} - Next   + {{ T "next" }}   ⭢ {{ else }} - Next   + {{ T "next" }}   ⭢ {{ end }}
{{ end }} {{ end }} +
diff --git a/layouts/index.xml b/layouts/index.xml new file mode 100644 index 0000000..e9ae53d --- /dev/null +++ b/layouts/index.xml @@ -0,0 +1,30 @@ + + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + {{ T "incidentHistory" }} + github.com/cstate + {{ with .Site.LanguageCode }}{{.}}{{end}} + {{ if not .Date.IsZero }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ end }} + {{ with .Site.Copyright }} + {{.}}{{end}} + {{ with .OutputFormats.Get "RSS" }} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{ end }} + {{ $incidents := where .Site.RegularPages "Params.section" "issue" }} + {{ range $incidents }} + + {{ if .Params.resolved }}[{{ T "resolved" }}] {{ end }}{{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ .Permalink }} + {{ .Params.resolvedWhen }} + {{ .Content | html }} + + {{ end }} + + 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" }}
+

+ {{ .Title }} +

+ + + {{ if .Site.Params.dateFormat }} + {{ .Date.Format .Site.Params.dateFormat }} + {{ else }} + {{ .Date.Format "January 2, 2006 at 3:04 PM" }} + {{ end }} + + +

+ {{ range .Params.Affected }} + {{ . }} + {{ end }} +

+ {{ if .Params.Resolved }} - - - {{ $t := (time .Params.ResolvedWhen) }} - {{ $timeDiff := (sub $t.Unix .Date.Unix) }} - {{ $diffInMin := (div $timeDiff 60) }} - - - {{ if lt $timeDiff 60 }} - ✓ Resolved + {{ $t := (time .Params.ResolvedWhen) }} + {{ $timeDiff := (sub $t.Unix .Date.Unix) }} + {{ $diffInMin := (div $timeDiff 60) }} + + + + {{ if lt $timeDiff 60 }} +
+ + {{ T "resolved" }} {{ T "inUnderAMinute" }}. + +
+ {{ else }} + {{ if gt $timeDiff 3600 }} +
+ + {{ T "resolvedAfter" }} + + {{ $minutesForCalc := (mod $diffInMin 60) }} + + {{ div (sub $diffInMin $minutesForCalc) 60 }}h + {{ $minutesForCalc }}m {{ T "ofDowntime" }}. + + + + {{ if .Site.Params.dateFormat }} + {{ dateFormat .Site.Params.dateFormat .Params.resolvedWhen }} + {{ else }} + {{ dateFormat "January 2, 2006 at 3:04 PM" .Params.resolvedWhen }} + {{ end }} + +
{{ else }} +
+ + {{ 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" }}. + - {{ div (sub $timeDiff $secsForCalc) 60 }}m - of downtime - {{ end }} - + + {{ if .Site.Params.dateFormat }} + {{ dateFormat .Site.Params.dateFormat .Params.resolvedWhen }} + {{ else }} + {{ dateFormat "January 2, 2006 at 3:04 PM" .Params.resolvedWhen }} + {{ end }} + +
{{ end }} -
+ {{ end }} {{ else }} - Ongoing, services {{ if eq .Params.severity "notice" }}on notice{{ else }}{{ .Params.severity }}{{ end }} + {{ T "downtimeOngoing" }} {{ end }} -

- {{ .Title }} -

- - - {{ .Date.Format "January 02, 2006 at 3:04 PM" }} -
{{ .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" }} - - {{ partial "header" . }} - +
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" }} + + + {{ if .Params.Resolved }} + + {{ if .Site.Params.dateFormat }} + {{ .Date.Format .Site.Params.dateFormat }} + {{ else }} + {{ .Date.Format "January 2, 2006 at 3:04 PM" }} + {{ end }} + + +

+ {{ .Title }} +

+ + {{ $t := (time .Params.ResolvedWhen) }} + {{ $timeDiff := (sub $t.Unix .Date.Unix) }} + {{ $diffInMin := (div $timeDiff 60) }} + + + {{ if lt $timeDiff 60 }} +
+ {{ T "resolved" }} {{ T "inUnderAMinute" }} +
+ {{ else }} + {{ if gt $timeDiff 3600 }} +
+ {{ T "resolvedAfter" }} + + {{ $minutesForCalc := (mod $diffInMin 60) }} + + {{ div (sub $diffInMin $minutesForCalc) 60 }}h + {{ $minutesForCalc }}m {{ T "ofDowntime" }} +
+ {{ else }} +
+ {{ T "resolvedAfter" }} + + {{ $secsForCalc := (mod $timeDiff 60) }} + + {{ div (sub $timeDiff $secsForCalc) 60 }}m + {{ T "ofDowntime" }} +
+ {{ end }} + {{ end }} + + + {{ else }} + + + {{ if .Site.Params.dateFormat }} + {{ .Date.Format .Site.Params.dateFormat }} + {{ else }} + {{ .Date.Format "January 2, 2006 at 3:04 PM" }} + {{ end }} + + +

+ {{ .Title }} +

+ + {{ $t := (time .Params.ResolvedWhen) }} + {{ $timeDiff := (sub $t.Unix .Date.Unix) }} + {{ $diffInMin := (div $timeDiff 60) }} + + +
{{ T "downtimeOngoing" }}
+ + {{ end }} +
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index edbbb57..2dcea70 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -4,14 +4,30 @@ diff --git a/layouts/partials/header.html b/layouts/partials/header.html index cfe6109..242c4f3 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -5,7 +5,7 @@ {{ if .Site.Params.useLargeHeaderDesign }}
-