internal/web/templates/builds.html
47 lines · 2403 bytes
1{{define "width"}}wide{{end}}
2{{define "title"}}builds · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}}
3{{define "content"}}
4<div class="listhead">
5 <h1>Builds</h1>
6 <nav class="filters">
7 {{range .FilterLinks}}<a {{if .Active}}class="active" aria-current="page" {{end}}href="{{.Href}}">{{.Label}}</a>{{end}}
8 </nav>
9 <form method="get" class="searchform compact">
10 <label for="ref">Branch</label>
11 <input type="text" id="ref" name="ref" value="{{.Filter.Ref}}" list="buildrefs">
12 <datalist id="buildrefs">{{range .Refs}}<option value="{{.}}">{{end}}</datalist>
13 <input type="hidden" name="status" value="{{.Filter.Status}}">
14 <input type="hidden" name="job" value="{{.Filter.Job}}">
15 <button type="submit" class="btn">Filter</button>
16 </form>
17</div>
18{{if .Notice}}<p class="error" role="alert">{{.Notice}}</p>{{end}}
19{{if and .CanWrite .Jobs}}
20<form method="post" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/builds" class="setform">
21 <label for="job">Run a job now</label>
22 <select id="job" name="job">
23 {{range .Jobs}}<option value="{{.Name}}">{{.Name}}{{if .Schedule}} (schedule {{.Schedule}}){{else if .Tags}} (tags {{.Tags}}){{end}}</option>{{end}}
24 </select>
25 <button type="submit" class="btn">Run</button>
26</form>
27{{end}}
28<details class="editbox"><summary>Status badge</summary>
29<p class="meta">Paste into a README; it shows the newest build's state.</p>
30<pre class="code">[](https://{{.Host}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/builds)</pre>
31<p class="meta">Add <code>?job=name</code> for one job.</p>
32</details>
33<p class="meta">{{len .Runs}} run{{if ne (len .Runs) 1}}s{{end}}{{if or .Filter.Ref .Filter.Status .Filter.Job}}, <a href="?">clear filters</a>{{end}}</p>
34<ul class="loglist">
35{{range .Runs}}<li>
36 <div class="commitmain">
37 <p class="subject"><code><a href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/commit/{{.SHA}}">{{printf "%.10s" .SHA}}</a></code></p>
38 <p class="meta">{{.Ref}} · {{when .CreatedAt}}</p>
39 </div>
40 <div class="commitside">
41 <span class="badge check-{{.Status}}">{{.Status}}</span>
42 {{range .Builds}}<a class="chip check-{{.Status}}" href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/builds/{{.Number}}">{{.Job}}</a>{{end}}
43 </div>
44</li>
45{{else}}<li class="empty">no builds — push a commit with a <code>.gitbay/ci.yml</code></li>{{end}}
46</ul>
47{{end}}