gunk-dev/the-valley

knot.tmpl

source215012f1aaa7main's published tip history
2.5 KiB
1{{define "content"}}
2<nav class="trail" aria-label="Where this knot sits"><a href="/">Plan</a>{{if .TrailCut}}<span>›</span><span>…</span>{{end}}{{range .Trail}}<span>›</span><a href="{{.URL}}">{{.Title}}</a>{{end}}</nav>
3<header class="knot-head">
4 <div class="meta">{{template "glyph" .Knot.State}}<span class="mono">{{.Knot.Project}}:{{.Knot.ID}}</span><span class="chip quiet">{{.Type}}</span><span class="chip quiet">{{.Status}}</span></div>
5 <h1>{{.Knot.Title}}</h1>
6</header>
7
8<div class="card">
9 <dl class="facts">
10 {{- range .Facts}}
11 <dt>{{.Label}}</dt><dd>{{if .URL}}<a href="{{.URL}}">{{.Text}}</a>{{else}}{{.Text}}{{end}}</dd>
12 {{- end}}
13 {{- if .BlockedBy}}
14 <dt>Blocked by</dt>
15 <dd><ul class="plain">{{range .BlockedBy}}<li class="item">{{with .Knot}}{{template "glyph" .State}}<span class="t"><a href="{{.URL}}">{{.Title}}</a> <span class="mono muted">{{.Project}}:{{.ID}}</span></span>{{else}}<span class="nochild"></span><span class="t">{{with .Ref}}<span class="mono">{{.}}</span> {{end}}<span class="muted">{{.Note}}</span></span>{{end}}</li>{{end}}</ul></dd>
16 {{- end}}
17 {{- if .Blocks}}
18 <dt>Blocks</dt>
19 <dd><ul class="plain">{{range .Blocks}}<li class="item">{{template "glyph" .State}}<span class="t"><a href="{{.URL}}">{{.Title}}</a> <span class="mono muted">{{.ID}}</span></span></li>{{end}}</ul></dd>
20 {{- end}}
21 {{- if .Children}}
22 <dt>Children</dt>
23 <dd><ul class="plain">{{range .Children}}<li class="item">{{template "glyph" .State}}<span class="t"><a href="{{.URL}}">{{.Title}}</a> <span class="mono muted">{{.ID}}</span></span></li>{{end}}</ul></dd>
24 {{- end}}
25 {{- if .Changes}}
26 <dt>Changes</dt>
27 <dd><ul class="plain">{{range .Changes}}<li class="mono">{{.}}</li>{{end}}</ul></dd>
28 {{- end}}
29 </dl>
30</div>
31
32<section class="panel" aria-labelledby="body-h">
33 <h2 id="body-h">Body</h2>
34 <div class="card">{{if .Body}}<pre class="prose">{{.Body}}</pre>{{else}}<p class="muted">This knot has no body.</p>{{end}}</div>
35</section>
36
37<section class="panel" aria-labelledby="comments-h">
38 <h2 id="comments-h">Comments</h2>
39 {{- if .Comments}}
40 <ol class="comments">
41 {{- range .Comments}}
42 <li class="card">
43 <div class="comment-head"><b>{{.Author}}</b><span>{{.At}}</span>{{if .Edited}}<span class="chip quiet">edited</span><span>{{.EditedAt}}{{with .EditedBy}} by {{.}}{{end}}</span>{{end}}</div>
44 <pre class="prose">{{.Body}}</pre>
45 </li>
46 {{- end}}
47 </ol>
48 {{- else}}
49 <p class="muted">No comments.</p>
50 {{- end}}
51</section>
52{{end}}