internal/web/templates/builds.html
32 lines · 1548 bytes
1{{define "title"}}builds · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}}
2{{define "content"}}
3<h1>Builds</h1>
4{{if .Notice}}<p class="error" role="alert">{{.Notice}}</p>{{end}}
5{{if and .CanWrite .Jobs}}
6<form method="post" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/builds" class="setform">
7 <label for="job">Run a job now</label>
8 <select id="job" name="job">
9 {{range .Jobs}}<option value="{{.Name}}">{{.Name}}{{if .Schedule}} (schedule {{.Schedule}}){{else if .Tags}} (tags {{.Tags}}){{end}}</option>{{end}}
10 </select>
11 <button type="submit" class="primary">Run</button>
12</form>
13{{end}}
14<details class="editbox"><summary>Status badge</summary>
15<p class="meta">Paste into a README; it shows the newest build's state.</p>
16<pre class="code">[](https://{{.Host}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/builds)</pre>
17<p class="meta">Add <code>?job=name</code> for one job.</p>
18</details>
19<ul class="loglist">
20{{range .Builds}}<li>
21 <div class="commitmain">
22 <p class="subject"><a href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/builds/{{.Number}}">#{{.Number}} {{.Job}}</a></p>
23 <p class="meta">{{.Ref}} · {{when .CreatedAt}}</p>
24 </div>
25 <div class="commitside">
26 <span class="badge check-{{.Status}}">{{.Status}}</span>
27 <code><a href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/commit/{{.SHA}}">{{printf "%.10s" .SHA}}</a></code>
28 </div>
29</li>
30{{else}}<li class="empty">no builds — push a commit with a <code>.gitbay/ci.yml</code></li>{{end}}
31</ul>
32{{end}}