Skip to content

Commit

Permalink
cState v5.4 goes live
Browse files Browse the repository at this point in the history
  • Loading branch information
mistermantas committed Jul 13, 2022
2 parents 6dfb346 + bdd27c6 commit 44f87a0
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 28 deletions.
11 changes: 1 addition & 10 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,7 @@ <h1 class="clean">{{ $title }}</h1>
{{ range .Site.Params.systems }}
{{ if eq .name $title }}
{{ with .description }}
<p class="bold">{{ . }}
&nbsp;
{{ with .link }}
<span class="span-icon">
<a href="{{ . }}">
🔗
</a>
</span>
{{ end }}
</p>
<p class="bold">{{ . }}</p>
{{ end }}
{{ end }}
{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/index.json
Original file line number Diff line number Diff line change
@@ -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.3",
"cStateVersion": "5.4",
"apiVersion": "2.0",
"title": "{{ .Site.Title }}",
"languageCodeHTML": "{{ .Site.LanguageCode }}",
Expand Down
16 changes: 9 additions & 7 deletions layouts/partials/index/announcements.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{{ $incidents := where .Site.RegularPages "Params.section" "issue" }}
{{ $active := where $incidents "Params.resolved" "=" false }}
{{ $activeIncidents := where $incidents "Params.informational" "=" false }}
{{ $pinned := where $incidents "Params.pin" "=" true }}
{{ $allPosts := where .Site.RegularPages "Params.section" "issue" }}
{{ $active := where $allPosts "Params.resolved" "=" false }}

{{ if or ($activeIncidents) ($pinned) }}
{{ $informationals := where $allPosts "Params.informational" "=" true }}
{{ $pinned := where $informationals "Params.pin" "=" true }}


{{ if or ($active) ($pinned) }}
<div class="announcement-box" style="border-bottom: 0">
{{ range $activeIncidents }}
{{ range $active }}
<div class="padding">
<p>
<a href="{{ .RelPermalink }}"><strong class="bold">{{ .Title }} →</strong></a>
Expand All @@ -19,7 +21,7 @@
{{ end }}
</small></p>

{{ .Content | safeHTML | truncate 500 "…" }} <a href="{{ .RelPermalink }}"><b></b></a>
{{ .Content | safeHTML | truncate 500 "…" }}
<p></p>
</div>
<hr class="clean announcement-box">
Expand Down
16 changes: 8 additions & 8 deletions layouts/partials/index/components.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@
{{ $categorySystems := where $systems "category" "=" .name }}

<div class="components">
{{ range $categorySystems }}
{{ $activeComponentIssues := where $active "Params.affected" "intersect" (slice .name) }}
{{ range $system := $categorySystems }}
{{ $activeComponentIssues := where $active "Params.affected" "intersect" (slice $system.name) }}

{{ $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 }}">
<a href="{{ printf "/affected/%s/" (.name | urlize) | relURL }}" class="no-underline">
{{ default .name .displayName }}
<a href="{{ printf "/affected/%s/" ($system.name | urlize) | relURL }}" class="no-underline">
{{ default $system.name $system.displayName }}
</a>

{{ with .description }}
{{ with $system.description }}
<span class="tooltip tooltip--small">
&nbsp; <span class="faded">(?)</span>

Expand All @@ -65,7 +65,7 @@
</span>
{{ end }}

{{ with .link }}
{{ with $system.link }}
<span class="span-icon">
<a href="{{ . }}" class="link-style">
🔗
Expand All @@ -87,9 +87,9 @@
{{ end }}{{ end }}{{ end }}
</span>

{{ with .partial }}
{{ with $system.partial }}
<div>
{{ partial . . }}
{{ partial . (dict "system" $system "incidents" $incidents) }}
</div>
{{ end }}
</div>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/js.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Dev toolset
*/

console.log('cState v5.3 - https://github.com/cstate/cstate');
console.log('cState v5.4 - https://github.com/cstate/cstate');
document.getElementsByTagName('html')[0].className = 'js';

/**
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -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.3 - https://github.com/cstate/cstate">
<meta name="generator" content="cState v5.4 - https://github.com/cstate/cstate">
<meta name="theme-color" content="{{ .Site.Params.brand }}">
<script>
var themeBrandColor = '{{ .Site.Params.brand }}';
Expand Down

0 comments on commit 44f87a0

Please sign in to comment.