diff options
author | Mantas <11616378+mistermantas@users.noreply.github.com> | 2019-04-08 21:46:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-08 21:46:03 +0300 |
commit | d69ebc475fc67c65c52c206b7cc1eb70e1633645 (patch) | |
tree | 4808b9ae6e28372ced486b1e827d8300406dcbe0 /layouts/partials/index | |
parent | 9c2eb26b5732e0a9087dd024f7fd0b10fec9ef74 (diff) | |
parent | 7f610d23ed696d050ed2d1e405f6bba339a497c4 (diff) |
cState v3.1.0 | #54 | here goes nothing
cState v3.1.0
Diffstat (limited to 'layouts/partials/index')
-rw-r--r-- | layouts/partials/index/announcements.html | 24 | ||||
-rw-r--r-- | layouts/partials/index/autorefresh.html | 8 | ||||
-rw-r--r-- | layouts/partials/index/components.html | 53 | ||||
-rw-r--r-- | layouts/partials/index/incidents.html | 61 | ||||
-rw-r--r-- | layouts/partials/index/noscript.html | 4 | ||||
-rw-r--r-- | layouts/partials/index/summary.html | 24 | ||||
-rw-r--r-- | layouts/partials/index/tabs.html | 20 |
7 files changed, 194 insertions, 0 deletions
diff --git a/layouts/partials/index/announcements.html b/layouts/partials/index/announcements.html new file mode 100644 index 0000000..0be3835 --- /dev/null +++ b/layouts/partials/index/announcements.html @@ -0,0 +1,24 @@ +{{ $incidents := where .Site.RegularPages "Params.section" "issue" }} +{{ $active := where $incidents "Params.resolved" "=" false }} + +{{ if $active }} + <div class="announcement-box" style="border-bottom: 0"> + {{ range $active }} + <div class="padding"> + <p> + <a href="{{ .Permalink }}"><strong class="bold">{{ .Title }} →</strong></a> + </p> + + <p><small> + {{ range .Params.Affected }} + <a href="/affected/{{ . | urlize }}" class="tag no-underline">{{ . }}</a> + {{ end }} + </small></p> + + {{ .Content | safeHTML | truncate 500 "…" }} + <p></p> + </div> + <hr class="clean announcement-box"> + {{ end }} + </div> +{{ end }}
\ No newline at end of file diff --git a/layouts/partials/index/autorefresh.html b/layouts/partials/index/autorefresh.html new file mode 100644 index 0000000..b419e2f --- /dev/null +++ b/layouts/partials/index/autorefresh.html @@ -0,0 +1,8 @@ +{{ if .Site.Params.autoRefresh }} + <div class="faded right"> + <small><em>{{ T "autoRefreshNotice" }}</em></small> + </div> + <div class="padding-s"></div> + {{ else }} + <div class="padding"></div> +{{ end }}
\ No newline at end of file diff --git a/layouts/partials/index/components.html b/layouts/partials/index/components.html new file mode 100644 index 0000000..128b887 --- /dev/null +++ b/layouts/partials/index/components.html @@ -0,0 +1,53 @@ +{{ $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" }} + +<div class="components"> + {{ $systems := .Site.Params.systems }} + {{ range $systems }} + {{ $activeComponentIssues := where $active "Params.affected" "intersect" (slice .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="/affected/{{ .name | urlize }}" class="no-underline"> + {{ .name }} + </a> + + {{ with .description }} + <span class="tooltip tooltip--small"> + <span class="faded">(?)</span> + + <span class="tooltip__text"> + {{ . }} + </span> + </span> + {{ end }} + + <span class="component-status"> + {{ if $thisIsDown }} + <b>{{ T "thisIsDown" }}</b> + {{ else }} + {{ if $thisIsDisrupted }} + <b>{{ T "thisIsDisrupted" }}</b> + {{ else }} + {{ if $thisIsNotice }} + <b>{{ T "thisIsNotice" }}</b> + {{ else }} + {{ T "thisIsOk" }} + {{ end }}{{ end }}{{ end }} + </span> + + {{ with .partial }} + <div> + {{ partial . . }} + </div> + {{ end }} + </div> + {{ end }} + </div>
\ No newline at end of file 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"> + ⭠ + {{ T "prev" }} + </a> + {{ else }} + <span class="faded"> + ⭠ + {{ T "prev" }} + </span> + {{ end }} + + + + {{ $paginator.PageNumber }} + / + {{ $paginator.TotalPages }} + + + + {{ if $paginator.HasNext }} + <a href="{{ $paginator.Next.URL }}#incidents"> + {{ T "next" }} + ⭢ + </a> + {{ else }} + <span class="faded"> + {{ T "next" }} + ⭢ + </span> + {{ end }} + </div> + {{ end }} +{{ end }}
\ No newline at end of file diff --git a/layouts/partials/index/noscript.html b/layouts/partials/index/noscript.html new file mode 100644 index 0000000..ebebe8c --- /dev/null +++ b/layouts/partials/index/noscript.html @@ -0,0 +1,4 @@ +<noscript> + <p class="error">{{ T "noScriptingIntro" }} <a href="//enable-javascript.com">{{ T "noScriptingLink" }}</a> {{ T "noScriptingOutro" }}</p> + <div class="padding"></div> +</noscript>
\ No newline at end of file diff --git a/layouts/partials/index/summary.html b/layouts/partials/index/summary.html new file mode 100644 index 0000000..d8e3108 --- /dev/null +++ b/layouts/partials/index/summary.html @@ -0,0 +1,24 @@ +{{ $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" }} + +<div class="summary"> + <strong> + {{ if $isDown }} + {{ T "isDown" }} + {{ else }} + {{ if $isDisrupted }} + {{ T "isDisrupted" }} + {{ else }} + {{ if $isNotice }} + {{ T "isNotice" }} + {{ else }} + {{ T "isOk" }} + {{ end }}{{ end }}{{ end }} + </strong> + + <span class="summary__date float-right" onclick="location.reload()"></span> +</div>
\ No newline at end of file diff --git a/layouts/partials/index/tabs.html b/layouts/partials/index/tabs.html new file mode 100644 index 0000000..e1fc986 --- /dev/null +++ b/layouts/partials/index/tabs.html @@ -0,0 +1,20 @@ +{{ if .Site.Params.customTabs }} + <div class="tabs"> + <div class="contain tabs--inner"> + <a href="/#incidents" class="tab tab--current"> + {{ T "incidents" }} + </a> + + {{ range .Site.Params.customTabs }} + <a href="{{ .link }}" class="tab tab--other"> + {{ .name }} + </a> + {{ end }} + </div> + </div> +{{ else }} + <div class="contain contain--more"> + <h2 class="center">{{ T "incidentHistory" }}</h2> + <hr class="clean"> + </div> +{{ end }}
\ No newline at end of file |