internal/web/templates/labels.html

ebf1e30fe0ae09b2d5f93705c1cbf7f513b6ed22
gitbay/internal/web/templates/labels.html history · blame · raw

36 lines · 2148 bytes

 1{{define "title"}}labels · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}}
 2{{define "content"}}
 3<h1>Labels</h1>
 4{{if .Notice}}<p class="error" role="alert">{{.Notice}}</p>{{end}}
 5{{if .Labels}}<div class="tablewrap"><table class="keys">
 6<tr class="cols"><th scope="col">label</th><th scope="col">colour</th><th scope="col">issues</th><th scope="col"></th></tr>
 7{{range .Labels}}<tr>
 8  <td><a class="chip label" style="{{index $.LabelColors .Name}}" href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/issues?label={{.Name}}">{{.Name}}</a>{{if .Org}} <span class="chip chip-neutral">org</span>{{end}}</td>
 9  <td>{{if and $.CanWrite (not .Org)}}<form method="post" action="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/labels" class="inline">
10    <input type="hidden" name="name" value="{{.Name}}">
11    <input type="text" name="color" value="{{.Color}}" aria-label="Colour for {{.Name}}" placeholder="rrggbb" size="8">
12    <button type="submit" class="btn">Save</button>
13  </form>{{else}}<span class="mono">{{if .Color}}{{.Color}}{{else}}—{{end}}</span>{{end}}</td>
14  <td>{{.Issues}}</td>
15  <td class="act">{{if and $.CanWrite (not .Org)}}<form method="post" action="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/labels" class="inline">
16    <input type="hidden" name="action" value="remove">
17    <input type="hidden" name="name" value="{{.Name}}">
18    <button type="submit" class="linklike">Remove</button>
19  </form>{{else if .Org}}<a href="/{{$.Repo.OwnerName}}/-/labels">org</a>{{end}}</td>
20</tr>
21{{end}}</table></div>
22{{else}}<p class="none">No labels yet.</p>{{end}}
23{{if .CanWrite}}
24<details class="editbox">
25  <summary>New label</summary>
26  <form method="post" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/labels" class="setform stack">
27    <label for="labelname">Name</label>
28    <input type="text" id="labelname" name="name" maxlength="50" required>
29    <label for="labelcolor">Colour</label>
30    <input type="text" id="labelcolor" name="color" placeholder="rrggbb, or blank for one picked from the name">
31    <button type="submit">Create label</button>
32  </form>
33</details>
34<p class="meta">Removing a label takes it off every issue that carries it.</p>
35{{end}}
36{{end}}