generated from cstate/example
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduces overrides for issue templates in order to always have the same coloring for "resolved" information. Content is taken from https://github.com/cstate/cstate/tree/d0d39000c2d3eef82f63c8a6a00dd8b30ba6688a/layouts/issues
- Loading branch information
Showing
2 changed files
with
187 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{{ $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="article"> | ||
<h1 class="clean"> | ||
{{ .Title }} | ||
</h1> | ||
|
||
<small class="date"> | ||
{{ if .Site.Params.dateFormat }} | ||
{{ dateFormat .Site.Params.dateFormat .Params.date }} | ||
{{ else }} | ||
{{ .Date.Format "January 2, 2006 at 3:04 PM" }} | ||
{{ end }} | ||
</small> | ||
|
||
<p><small> | ||
{{ range .Params.Affected }} | ||
<a href="{{ printf "affected/%s/" (. | urlize) | relURL }}" class="tag no-underline">{{ . }}</a> | ||
{{ end }} | ||
</small></p> | ||
|
||
{{ if .Params.informational }} | ||
{{ else if .Params.Resolved }} | ||
{{ $t := (time .Params.ResolvedWhen) }} | ||
{{ $timeDiff := (sub $t.Unix .Date.Unix) }} | ||
{{ $diffInMin := (div $timeDiff 60) }} | ||
|
||
|
||
<!-- Marker --> | ||
{{ if lt $timeDiff 60 }} | ||
<div class="faded"> | ||
<strong> | ||
{{ T "resolved" }} {{ T "inUnderAMinute" }}. | ||
</strong> | ||
</div> | ||
{{ else }} | ||
<div class="ok tooltip"> | ||
<strong> | ||
{{ T "resolvedAfter" }} | ||
|
||
{{ $secsForCalc := (mod $timeDiff 60) }} | ||
|
||
{{ div (sub $timeDiff $secsForCalc) 60 }}m | ||
{{ if eq .Params.severity "down" }} | ||
{{ T "ofDowntime" }} | ||
{{ end }} | ||
</strong> | ||
|
||
<span class="tooltip__text"> | ||
{{ if .Site.Params.dateFormat }} | ||
{{ dateFormat .Site.Params.dateFormat .Params.resolvedWhen }} | ||
{{ else }} | ||
{{ dateFormat "January 2, 2006 at 3:04 PM" .Params.resolvedWhen }} | ||
{{ end }} | ||
</span> | ||
</div> | ||
{{ end }} | ||
{{ else }} | ||
<strong class="error"> | ||
{{ if eq .Params.severity "down" }} | ||
■ | ||
{{ else if eq .Params.severity "disrupted" }} | ||
▲ | ||
{{ else }} | ||
◆ | ||
{{ end }} | ||
{{ T "downtimeOngoing" }}</strong> | ||
{{ end }} | ||
|
||
<hr> | ||
<div class="markdown">{{ .Content }}</div> | ||
</div> | ||
<div class="padding"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
{{ $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" }} | ||
|
||
<a href="{{ .Permalink }}" class="issue no-underline"> | ||
{{ if .Params.informational }} | ||
|
||
<small class="date float-right {{ cond .Site.Params.useRelativeTime "relative-time" "" }}" title="{{ dateFormat .Site.Params.dateFormat .Params.date }}" data-date="{{ .Date.Format "Jan 2 15:04:05 2006 UTC" }}"> | ||
{{ if .Site.Params.dateFormat }} | ||
{{ dateFormat .Site.Params.dateFormat .Params.date }} | ||
{{ else }} | ||
{{ .Date.Format "January 2, 2006 at 3:04 PM" }} | ||
{{ end }} | ||
</small> | ||
|
||
<h3> | ||
{{ .Title }} ℹ | ||
</h3> | ||
<span class="faded">{{ .Summary | truncate 200 }} | ||
</span> | ||
|
||
{{ else if .Params.Resolved }} | ||
<small class="date float-right {{ cond .Site.Params.useRelativeTime "relative-time" "" }}" title="{{ dateFormat .Site.Params.dateFormat .Params.date }}" data-date="{{ .Date.Format "Jan 2 15:04:05 2006 UTC" }}"> | ||
{{ if .Site.Params.dateFormat }} | ||
{{ dateFormat .Site.Params.dateFormat .Params.date }} | ||
{{ else }} | ||
{{ .Date.Format "January 2, 2006 at 3:04 PM" }} | ||
{{ end }} | ||
</small> | ||
|
||
<h3> | ||
{{ .Title }} | ||
</h3> | ||
|
||
{{ $t := (time .Params.ResolvedWhen) }} | ||
{{ $timeDiff := (sub $t.Unix .Date.Unix) }} | ||
{{ $diffInMin := (div $timeDiff 60) }} | ||
|
||
<!-- Marker --> | ||
{{ if lt $timeDiff 60 }} | ||
<div class="faded"> | ||
{{ T "resolved" }} {{ T "inUnderAMinute" }} | ||
</div> | ||
{{ else }} | ||
<div class="ok"> | ||
{{ T "resolvedAfter" }} | ||
|
||
{{ $secsForCalc := (mod $timeDiff 60) }} | ||
|
||
{{ div (sub $timeDiff $secsForCalc) 60 }}m | ||
{{ if eq .Params.severity "down" }} | ||
<!-- {{ $secsForCalc }}s --> {{ T "ofDowntime" }} | ||
{{ end }} | ||
</div> | ||
{{ end }} | ||
|
||
{{ else }} | ||
<!-- If not resolved --> | ||
<small class="date float-right {{ cond .Site.Params.useRelativeTime "relative-time" "" }}" title="{{ dateFormat .Site.Params.dateFormat .Params.date }}" data-date="{{ .Date.Format "Jan 2 15:04:05 2006 UTC" }}"> | ||
|
||
{{ if .Date.Before now }} | ||
{{ if .Site.Params.dateFormat }} | ||
{{ dateFormat .Site.Params.dateFormat .Params.date }} | ||
{{ else }} | ||
{{ .Date.Format "January 2, 2006 at 3:04 PM" }} | ||
{{ end }} | ||
{{ else }} | ||
{{ end }} | ||
</small> | ||
|
||
<h3> | ||
{{ .Title }} | ||
</h3> | ||
|
||
|
||
|
||
<!-- Marker --> | ||
{{ if eq .Params.severity "notice" }} | ||
<strong class="error"> | ||
◆ | ||
{{ if .Date.Before now }} | ||
{{ T "downtimeOngoing" }} | ||
{{ else }} | ||
{{ if .Site.Params.dateFormat }} | ||
{{ dateFormat .Site.Params.dateFormat .Params.date }} | ||
{{ else }} | ||
{{ .Date.Format "January 2, 2006 at 3:04 PM" }} | ||
{{ end }} | ||
{{ end }} | ||
</strong> | ||
{{ else }} | ||
|
||
<strong class="error"> | ||
{{ if eq .Params.severity "down" }} | ||
■ | ||
{{ else if eq .Params.severity "disrupted" }} | ||
▲ | ||
{{ else }} | ||
◆ | ||
{{ end }} | ||
{{ T "downtimeOngoing" }} | ||
</strong> | ||
{{ end }} | ||
|
||
{{ end }} | ||
</a> |