diff options
author | Mantas <11616378+mistermantas@users.noreply.github.com> | 2019-01-25 16:53:51 +0200 |
---|---|---|
committer | Mantas <11616378+mistermantas@users.noreply.github.com> | 2019-01-25 16:53:51 +0200 |
commit | 290aa0df0204038b8c7b23c28d716755e468f169 (patch) | |
tree | f550e674805b3cc42b4b0c74ea7d78a8c59aca77 /layouts/partials/index/incidents.html | |
parent | 6a1fbad426c29b4f3fe4f6fa4d240735d5432b50 (diff) |
fix #42, #51; v4-dev1 begins
Diffstat (limited to 'layouts/partials/index/incidents.html')
-rw-r--r-- | layouts/partials/index/incidents.html | 61 |
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"> + ⭠ + {{ 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 |