gunk-dev/the-valley

plan.tmpl

source87914182af0cmain's published tip history
4.6 KiB
1{{define "content"}}
2<header class="top">
3 <div>
4 <div class="eyebrow">{{.Projects}}</div>
5 <h1>Plan</h1>
6 </div>
7 <div class="tally">{{range .Tally}}<span><b>{{.N}}</b> {{.Label}}</span>{{end}}</div>
8</header>
9
10<div class="legend" aria-label="Legend">
11 <span><i class="k done"></i>done</span>
12 <span><i class="k in-progress"></i>in progress</span>
13 <span><i class="k ready"></i>free to start: an open, unclaimed, unblocked outcome or bug</span>
14 <span><i class="k blocked"></i>blocked</span>
15 <span><i class="k active"></i>question or idea</span>
16 <span><i class="k abandoned"></i>abandoned</span>
17</div>
18
19<section class="panel" aria-labelledby="yours-h">
20 <h2 id="yours-h">Waiting on you</h2>
21 <div class="card"><p class="muted">Nothing here waits on you. This page shows the public plan, the same for every reader.</p></div>
22</section>
23
24<section class="panel" aria-labelledby="flight-h">
25 <h2 id="flight-h">In flight</h2>
26 <div class="cols">
27 <div class="card">
28 <div class="eyebrow">Knots in flight</div>
29 <ul class="plain">
30 {{- range .InFlight}}
31 <li class="item">{{template "glyph" .Knot.State}}<span class="t"><a href="{{.Knot.URL}}">{{.Knot.Title}}</a> <span class="mono muted">{{.Knot.ID}}</span> <span class="chip quiet">{{.Knot.Project}}</span></span><span class="note">{{.Note}}</span></li>
32 {{- else}}
33 <li class="muted">No knot is in flight.</li>
34 {{- end}}
35 </ul>
36 </div>
37 <div class="card">
38 <div class="eyebrow">Ready changes — order not assessed</div>
39 <ul class="plain">
40 {{- range .Changes}}
41 <li class="item"><span class="handle">{{.Handle}}</span><span class="t">{{.Title}} <span class="chip quiet">{{.Version}}</span></span><span class="note">{{.Note}}{{range .Knots}} · <a href="{{.URL}}">{{.ID}}</a>{{end}}</span></li>
42 {{- else}}
43 <li class="muted">No change is ready for approval.</li>
44 {{- end}}
45 </ul>
46 </div>
47 </div>
48</section>
49
50<section class="panel" aria-labelledby="paths-h">
51 <h2 id="paths-h">Paths</h2>
52 <p class="muted">Each path is one knot's children in the order their blockers set. Knots at one stage do not wait on one another.</p>
53 {{- if .Paths}}
54 <div class="cols">
55 {{- range .Paths}}
56 <div class="card">
57 <h3><a href="{{.Parent.URL}}">{{.Parent.Title}}</a></h3>
58 <ol class="stages">
59 {{- range $i, $stage := .Stages}}
60 <li><span class="stage-num">{{inc $i}}</span><ul class="plain">{{range $stage}}<li class="item">{{template "glyph" .State}}<span class="t"><a href="{{.URL}}">{{.Title}}</a> <span class="mono muted">{{.ID}}</span></span></li>{{end}}</ul></li>
61 {{- end}}
62 </ol>
63 </div>
64 {{- end}}
65 </div>
66 {{- else}}
67 <div class="card"><p class="muted">No knot's children wait on one another.</p></div>
68 {{- end}}
69</section>
70
71<section class="panel" aria-labelledby="ms-h">
72 <h2 id="ms-h">Milestones</h2>
73 <div class="controls" id="filters" role="group" aria-label="Filter knots" hidden>
74 <button type="button" data-filter="all" aria-pressed="true">All open</button>
75 <button type="button" data-filter="ready" aria-pressed="false">Free to start</button>
76 <button type="button" data-filter="in-progress" aria-pressed="false">In progress</button>
77 <button type="button" data-filter="blocked" aria-pressed="false">Blocked</button>
78 <label><input type="checkbox" id="show-done"> show done</label>
79 </div>
80 <div class="milestones" id="milestones">
81 {{- range .Milestones}}
82 <article class="milestone">
83 <div class="ms-head"><h3>{{with .Knot}}<a href="{{.URL}}">{{.Title}}</a>{{else}}{{.Title}}{{end}}</h3><span class="count">{{.Count}} · {{.Project}}</span></div>
84 {{- if .Cord}}
85 <div class="cord" aria-hidden="true">{{range .Cord}}<i class="k {{glyph .}}"></i>{{end}}</div>
86 {{- end}}
87 {{template "tree" .Tree}}
88 </article>
89 {{- else}}
90 <div class="card"><p class="muted">No milestone is published.</p></div>
91 {{- end}}
92 </div>
93</section>
94{{end}}
95
96{{define "tree"}}<ul class="tree">{{range .}}<li data-state="{{.Row.Filter}}">{{if .Children}}<details{{if .Open}} open{{end}}><summary>{{template "row" .}}</summary>{{template "tree" .Children}}</details>{{else}}{{template "row" .}}{{end}}</li>{{end}}</ul>{{end}}
97
98{{define "row"}}<div class="row {{glyph .Row.State}}">{{if .Children}}<span class="twisty" aria-hidden="true">▸</span>{{else}}<span class="nochild"></span>{{end}}{{template "glyph" .Row.State}}<span class="body"><a class="id" href="{{.Row.URL}}">{{.Row.ID}}</a><a class="title" href="{{.Row.URL}}">{{.Row.Title}}</a>{{range .Row.Chips}}<span class="chip{{with .Class}} {{.}}{{end}}">{{.Text}}</span>{{end}}</span></div>{{end}}