internal/web/templates/orglabels.html
47 lines · 2739 bytes
1{{define "title"}}labels · {{.Org}}{{end}}
2{{define "content"}}
3<div class="pagehead">
4 <h1><a href="/{{.Org}}">{{.Org}}</a> labels <span class="chip">{{len .Labels}}</span></h1>
5 <span class="grow"></span>
6 {{if .Labels}}<input type="search" class="tablefilter" placeholder="Filter labels…" aria-label="Filter labels" data-filter-table="org-labels-table">{{end}}
7</div>
8{{if .Notice}}<p class="error" role="alert">{{.Notice}}</p>{{end}}
9<p class="meta">Every repository under {{.Org}} sees these beside its own. Counts span the repositories you can read.</p>
10<section class="setcard">
11{{if .Labels}}<div class="tablewrap"><table class="keys" id="org-labels-table">
12<thead><tr class="cols"><th scope="col">label</th><th scope="col">colour</th><th scope="col">issues</th><th scope="col">merge requests</th>{{if .CanAdmin}}<th scope="col"><span class="vh">actions</span></th>{{end}}</tr></thead>
13<tbody>{{range .Labels}}<tr>
14 <td><span class="chip label" style="{{index $.LabelColors .Name}}">{{.Name}}</span></td>
15 <td>{{if $.CanAdmin}}<form method="post" action="/{{$.Org}}/-/labels" class="inline">
16 <input type="hidden" name="name" value="{{.Name}}">
17 <input type="text" name="color" value="{{.Color}}" aria-label="Colour for {{.Name}}" placeholder="rrggbb" size="8">
18 <button type="submit" class="btn">Save</button>
19 </form>{{else}}<span class="mono">{{if .Color}}{{.Color}}{{else}}—{{end}}</span>{{end}}</td>
20 <td>{{.Issues}}</td>
21 <td>{{.MRs}}</td>
22 {{if $.CanAdmin}}<td class="act"><details class="popover"><summary class="popbtn popbtn-danger">Remove</summary><div class="popmenu">
23 <form method="post" action="/{{$.Org}}/-/labels" class="popform popform-stack">
24 <input type="hidden" name="action" value="remove">
25 <input type="hidden" name="name" value="{{.Name}}">
26 {{template "confirmfield" .Name}}
27 <button type="submit" class="danger">Remove</button>
28 </form>
29 </div></details></td>{{end}}
30</tr>
31{{end}}</tbody></table></div>
32{{else}}<p class="none">No org labels yet.</p>{{end}}
33{{if .CanAdmin}}
34<details class="editbox">
35 <summary>New org label</summary>
36 <form method="post" action="/{{.Org}}/-/labels" class="setform stack">
37 <label for="labelname">Name</label>
38 <input type="text" id="labelname" name="name" maxlength="50" required>
39 <label for="labelcolor">Colour</label>
40 <input type="text" id="labelcolor" name="color" placeholder="rrggbb, or blank for one picked from the name">
41 <span class="btngroup"><button type="submit">Create label</button></span>
42 </form>
43</details>
44<p class="meta">Removing a label takes it off every issue and merge request under {{.Org}}. Creating one folds in same-named repository labels.</p>
45{{end}}
46</section>
47{{end}}