aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/index
diff options
context:
space:
mode:
authorMantas Vilčinskas <hi@mnts.lt>2022-07-13 18:41:26 +0300
committerGitHub <noreply@github.com>2022-07-13 18:41:26 +0300
commit44f87a0c23691761661ef98b862f18d5747c0153 (patch)
treeaa8e2e0ca58bd1611fa22732aee6d434825d8679 /layouts/partials/index
parent6dfb346e10b5bae65ddc3910bbdb92f3c2f49a3f (diff)
parentbdd27c6ee3ec7f127cf9bc1e567c7a7a23b16a09 (diff)
cState v5.4 goes live
Diffstat (limited to 'layouts/partials/index')
-rw-r--r--layouts/partials/index/announcements.html16
-rw-r--r--layouts/partials/index/components.html16
2 files changed, 17 insertions, 15 deletions
diff --git a/layouts/partials/index/announcements.html b/layouts/partials/index/announcements.html
index e33c262..f8f7471 100644
--- a/layouts/partials/index/announcements.html
+++ b/layouts/partials/index/announcements.html
@@ -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>
@@ -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">
diff --git a/layouts/partials/index/components.html b/layouts/partials/index/components.html
index 835c523..9b9b082 100644
--- a/layouts/partials/index/components.html
+++ b/layouts/partials/index/components.html
@@ -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>
@@ -65,7 +65,7 @@
</span>
{{ end }}
- {{ with .link }}
+ {{ with $system.link }}
<span class="span-icon">
<a href="{{ . }}" class="link-style">
🔗
@@ -87,9 +87,9 @@
{{ end }}{{ end }}{{ end }}
</span>
- {{ with .partial }}
+ {{ with $system.partial }}
<div>
- {{ partial . . }}
+ {{ partial . (dict "system" $system "incidents" $incidents) }}
</div>
{{ end }}
</div>