aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/index/incidents.html
diff options
context:
space:
mode:
authorMantas <11616378+mistermantas@users.noreply.github.com>2019-04-08 21:46:03 +0300
committerGitHub <noreply@github.com>2019-04-08 21:46:03 +0300
commitd69ebc475fc67c65c52c206b7cc1eb70e1633645 (patch)
tree4808b9ae6e28372ced486b1e827d8300406dcbe0 /layouts/partials/index/incidents.html
parent9c2eb26b5732e0a9087dd024f7fd0b10fec9ef74 (diff)
parent7f610d23ed696d050ed2d1e405f6bba339a497c4 (diff)
cState v3.1.0 | #54 | here goes nothing
cState v3.1.0
Diffstat (limited to 'layouts/partials/index/incidents.html')
-rw-r--r--layouts/partials/index/incidents.html61
1 files changed, 61 insertions, 0 deletions
diff --git a/layouts/partials/index/incidents.html b/layouts/partials/index/incidents.html
new file mode 100644
index 0000000..bf312e9
--- /dev/null
+++ b/layouts/partials/index/incidents.html
@@ -0,0 +1,61 @@
+{{ $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" }}
+
+<!-- Pagination is also included with incidents -->
+
+{{ if not $incidents }}
+ <div class="padding"></div>
+ <h3>{{ T "calmBeforeTheStorm" }}</h3>
+ <p>{{ T "noIncidentsDesc" }}</p>
+ <div class="padding"></div>
+ <div class="padding"></div>
+ <div class="padding"></div>
+{{ else }}
+ {{ $paginator := .Paginate $incidents .Site.Params.incidentPostsPerPage }}
+ {{ range $paginator.Pages }}
+ {{ .Render "small" }}
+ {{ end }}
+
+ <!-- If there are more than 2 pages, show pagination -->
+ {{ if gt $paginator.TotalPages 1 }}
+ <hr>
+
+ <div class="center">
+ {{ if $paginator.HasPrev }}
+ <a href="{{ $paginator.Prev.URL }}#incidents">
+ ⭠ &nbsp;
+ {{ T "prev" }}
+ </a>
+ {{ else }}
+ <span class="faded">
+ ⭠ &nbsp;
+ {{ T "prev" }}
+ </span>
+ {{ end }}
+
+
+ &nbsp; &nbsp;
+ {{ $paginator.PageNumber }}
+ /
+ {{ $paginator.TotalPages }}
+ &nbsp; &nbsp;
+
+
+ {{ if $paginator.HasNext }}
+ <a href="{{ $paginator.Next.URL }}#incidents">
+ {{ T "next" }} &nbsp;
+ ⭢
+ </a>
+ {{ else }}
+ <span class="faded">
+ {{ T "next" }} &nbsp;
+ ⭢
+ </span>
+ {{ end }}
+ </div>
+ {{ end }}
+{{ end }} \ No newline at end of file