diff options
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/index.json | 16 | ||||
-rw-r--r-- | layouts/issues/issue.html | 11 | ||||
-rw-r--r-- | layouts/issues/small.html | 7 | ||||
-rw-r--r-- | layouts/partials/index/announcements.html | 4 | ||||
-rw-r--r-- | layouts/partials/index/components.html | 26 | ||||
-rw-r--r-- | layouts/partials/js.html | 2 | ||||
-rw-r--r-- | layouts/partials/meta.html | 6 |
7 files changed, 51 insertions, 21 deletions
diff --git a/layouts/index.json b/layouts/index.json index e2e7b7f..0067dc3 100644 --- a/layouts/index.json +++ b/layouts/index.json @@ -1,6 +1,6 @@ {{ $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" }}{ "is": "index", - "cStateVersion": "5.5.1", + "cStateVersion": "5.6", "apiVersion": "2.0", "title": "{{ .Site.Title }}", "languageCodeHTML": "{{ .Site.LanguageCode }}", @@ -17,6 +17,20 @@ } {{ end }} ], + {{ $informationals := where $incidents "Params.informational" "=" true }}{{ $pinnedIssues := where $informationals "Params.pin" "=" true }} + {{ if not $pinnedIssues }} + "pinnedIssues": []{{ else }} + "pinnedIssues": [{{ range $i, $e := $pinnedIssues }}{{ if $i }},{{ end }} + { + "is": "issue", + "title": "{{ .Title }}", + "createdAt": "{{ .Date }}", + "lastMod": "{{ .Lastmod }}", + "permalink": "{{ .Permalink }}", + "affected": [{{ range $i, $e := .Params.Affected }}{{ if $i }}, {{ end }}"{{ . }}"{{ end }}], + "filename": "{{ .File.LogicalName }}" + }{{ end }} + ]{{ end }}, "systems": [ {{ range $i, $e := .Site.Params.systems }}{{ if $i }},{{ end }} { diff --git a/layouts/issues/issue.html b/layouts/issues/issue.html index b7ec2ce..513d884 100644 --- a/layouts/issues/issue.html +++ b/layouts/issues/issue.html @@ -47,7 +47,10 @@ {{ $minutesForCalc := (mod $diffInMin 60) }} {{ div (sub $diffInMin $minutesForCalc) 60 }}h - {{ $minutesForCalc }}m {{ T "ofDowntime" }}. + {{ $minutesForCalc }}m + {{ if eq .Params.severity "down" }} + {{ T "ofDowntime" }} + {{ end }} </strong> <span class="tooltip__text"> @@ -66,7 +69,9 @@ {{ $secsForCalc := (mod $timeDiff 60) }} {{ div (sub $timeDiff $secsForCalc) 60 }}m - {{ T "ofDowntime" }}. + {{ if eq .Params.severity "down" }} + {{ T "ofDowntime" }} + {{ end }} </strong> <span class="tooltip__text"> @@ -92,6 +97,6 @@ {{ end }} <hr> - {{ .Content }} + <div class="markdown">{{ .Content }}</div> </div> <div class="padding"></div> diff --git a/layouts/issues/small.html b/layouts/issues/small.html index 94fede3..cac8109 100644 --- a/layouts/issues/small.html +++ b/layouts/issues/small.html @@ -52,7 +52,10 @@ {{ $minutesForCalc := (mod $diffInMin 60) }} {{ div (sub $diffInMin $minutesForCalc) 60 }}h - {{ $minutesForCalc }}m {{ T "ofDowntime" }} + {{ $minutesForCalc }}m + {{ if eq .Params.severity "down" }} + {{ T "ofDowntime" }} + {{ end }} </div> {{ else }} <div class="ok"> @@ -61,7 +64,9 @@ {{ $secsForCalc := (mod $timeDiff 60) }} {{ div (sub $timeDiff $secsForCalc) 60 }}m + {{ if eq .Params.severity "down" }} <!-- {{ $secsForCalc }}s --> {{ T "ofDowntime" }} + {{ end }} </div> {{ end }} {{ end }} diff --git a/layouts/partials/index/announcements.html b/layouts/partials/index/announcements.html index 2bb7f08..389d673 100644 --- a/layouts/partials/index/announcements.html +++ b/layouts/partials/index/announcements.html @@ -1,5 +1,7 @@ {{ $allPosts := where .Site.RegularPages "Params.section" "issue" }} -{{ $active := where $allPosts "Params.resolved" "=" false }} +{{ $allActive := where $allPosts "Params.resolved" "=" false }} +{{ $active := where $allActive "Params.pin" "!=" false }} +{{/* this $active checks if pin is explicitely set to false */}} {{ $informationals := where $allPosts "Params.informational" "=" true }} {{ $pinned := where $informationals "Params.pin" "=" true }} diff --git a/layouts/partials/index/components.html b/layouts/partials/index/components.html index f9937f2..1a338c4 100644 --- a/layouts/partials/index/components.html +++ b/layouts/partials/index/components.html @@ -110,35 +110,35 @@ // // By default, all is good but we change this value // for progressively worse statuses - var highlestLevelStatus = ''; + var highestLevelStatus = ''; function checkStatus(element) { var status = element.getAttribute('data-status'); if (status === 'down') { - highlestLevelStatus = 'down' - } else if (status === 'disrupted' && highlestLevelStatus !== 'down') { - highlestLevelStatus = 'disrupted' - } else if (status === 'notice' && highlestLevelStatus !== 'down' && highlestLevelStatus !== 'disrupted') { - highlestLevelStatus = 'notice' + highestLevelStatus = 'down' + } else if (status === 'disrupted' && highestLevelStatus !== 'down') { + highestLevelStatus = 'disrupted' + } else if (status === 'notice' && highestLevelStatus !== 'down' && highestLevelStatus !== 'disrupted') { + highestLevelStatus = 'notice' } } componentsOfThisCategory.forEach(element => checkStatus(element)); // Human readable (i18n) status name variable - var highlestLevelStatusReadable = highlestLevelStatus; + var highestLevelStatusReadable = highestLevelStatus; - if (highlestLevelStatus === 'ok') { highlestLevelStatusReadable = '{{ T "thisIsOk" }}' } - if (highlestLevelStatus === 'notice') { highlestLevelStatusReadable = '{{ T "thisIsNotice" }}' } - if (highlestLevelStatus === 'disrupted') { highlestLevelStatusReadable = '{{ T "thisIsDisrupted" }}' } - if (highlestLevelStatus === 'down') { highlestLevelStatusReadable = '{{ T "thisIsDown" }}' } + if (highestLevelStatus === 'ok') { highestLevelStatusReadable = '{{ T "thisIsOk" }}' } + if (highestLevelStatus === 'notice') { highestLevelStatusReadable = '{{ T "thisIsNotice" }}' } + if (highestLevelStatus === 'disrupted') { highestLevelStatusReadable = '{{ T "thisIsDisrupted" }}' } + if (highestLevelStatus === 'down') { highestLevelStatusReadable = '{{ T "thisIsDown" }}' } // Finally we can show the status // (but only for categories with a name) if (thisCategory.classList.contains('category--titled')) { - thisCategory.querySelector('.category__head').setAttribute('data-status', highlestLevelStatus); - thisCategory.querySelector('.category-status').innerHTML = highlestLevelStatusReadable; + thisCategory.querySelector('.category__head').setAttribute('data-status', highestLevelStatus); + thisCategory.querySelector('.category-status').innerHTML = highestLevelStatusReadable; } </script> </div> diff --git a/layouts/partials/js.html b/layouts/partials/js.html index 691b8dc..b7dad07 100644 --- a/layouts/partials/js.html +++ b/layouts/partials/js.html @@ -3,7 +3,7 @@ * Dev toolset */ - console.log('cState v5.5.1 - https://github.com/cstate/cstate'); + console.log('cState v5.6 - https://github.com/cstate/cstate'); document.getElementsByTagName('html')[0].className = 'js'; /** diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index c8381a9..eec0772 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -12,7 +12,7 @@ {{ range .AlternativeOutputFormats -}} {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ end -}} - <meta name="generator" content="cState v5.5.1 - https://github.com/cstate/cstate"> + <meta name="generator" content="cState v5.6 - https://github.com/cstate/cstate"> <meta name="theme-color" content="{{ .Site.Params.brand }}"> <script> var themeBrandColor = '{{ .Site.Params.brand }}'; @@ -107,6 +107,10 @@ padding: 16px; } + .markdown pre { + overflow-x: scroll; + } + .contain--more { max-width: 680px; } .center { text-align: center; } |