1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
{{define "content"}}
{{$p := .Data.Page}}
{{$pr := .Data.Pull}}
<div class="pulltitle">
<h3 class="plain"><span class="state {{$pr.State}}">{{$pr.State}}</span> {{$pr.Title}} <span class="muted">#{{$pr.Number}}</span></h3>
<p class="muted"><a href="/~{{$pr.Author.Name}}">~{{$pr.Author.Name}}</a> wants to merge {{len .Data.Commits}} commits from <code>{{if $pr.SameRepo}}{{$pr.SourceBranch}}{{else}}{{$pr.SourceRepo.Path}}:{{$pr.SourceBranch}}{{end}}</code> into <code>{{$pr.TargetBranch}}</code> · opened {{ago $pr.Created}}{{if eq $pr.State "merged"}} · merged as <a href="/{{$p.Repo.Path}}/commit/{{$pr.Merged}}"><code>{{short $pr.Merged}}</code></a>{{end}}</p>
</div>
<div class="columns pullbody">
<div class="main">
{{if $pr.Body}}<div class="comment"><div class="who"><a href="/~{{$pr.Author.Name}}">~{{$pr.Author.Name}}</a> <span class="muted">{{ago $pr.Created}}</span></div><div class="readme">{{.Data.Body}}</div></div>{{end}}
{{range .Data.Comments}}<div class="comment"><div class="who"><a href="/~{{.Comment.Author.Name}}">~{{.Comment.Author.Name}}</a> <span class="muted">{{ago .Comment.Created}}</span></div><div class="readme">{{.Body}}</div></div>{{end}}
{{if .User}}<form method="post" action="/{{$p.Repo.Path}}/pulls/{{$pr.Number}}/comment" class="stack wide">
<label>Leave a comment <textarea name="body" rows="5" required placeholder="Markdown supported"></textarea></label>
<div class="actions"><button class="btn">Comment ▸</button></div>
</form>{{else}}<p class="muted"><a href="/login">Log in</a> to comment.</p>{{end}}
</div>
<aside>
<div class="panel">
{{if eq $pr.State "open"}}
{{if .Data.Unrelated}}<p>The branches have no common history.</p>
{{else if .Data.Mergeable}}<p>This branch can be merged automatically.</p>{{else}}<p>This branch has conflicts or nothing new to merge. Resolve locally, push, then update.</p>{{end}}
{{if .Data.Owner}}{{if .Data.Confirm}}
<form method="post" action="/{{$p.Repo.Path}}/pulls/{{$pr.Number}}/merge" class="stack mergeform">
<label>Commit message <input name="title" value="{{.Data.MergeTitle}}" maxlength="200" required></label>
<label>Extended description <textarea name="body" rows="4">{{$pr.Title}}</textarea></label>
<div class="actions left"><button class="btn primary">Confirm merge ▸</button><a class="btn" href="/{{$p.Repo.Path}}/pulls/{{$pr.Number}}">Cancel</a></div>
</form>
{{else}}{{if .Data.Mergeable}}<a class="btn primary block" href="?merge=1">Merge pull request ▸</a>{{else}}<button class="btn primary block" disabled>Merge pull request ▸</button>{{end}}{{end}}{{end}}
{{if or .Data.Owner .Data.Author}}<form method="post" action="/{{$p.Repo.Path}}/pulls/{{$pr.Number}}/update"><button class="btn block">Update from source ▸</button></form>
<form method="post" action="/{{$p.Repo.Path}}/pulls/{{$pr.Number}}/close"><button class="btn danger block">Close ▸</button></form>{{end}}
{{else if eq $pr.State "closed"}}<p>Closed without merging.</p>{{if or .Data.Owner .Data.Author}}<form method="post" action="/{{$p.Repo.Path}}/pulls/{{$pr.Number}}/reopen"><button class="btn block">Reopen ▸</button></form>{{end}}
{{else}}<p>Merged into <code>{{$pr.TargetBranch}}</code>.</p>{{end}}
<p class="muted small">Fetch locally with<br><code>git fetch https://{{.Host}}/{{$p.Repo.Path}} {{$pr.Ref}}</code></p>
</div>
</aside>
</div>
{{if .Data.Commits}}
<h3>Commits</h3>
<div class="log">{{range .Data.Commits}}<div class="event"><div><a class="hash" href="/{{$p.Repo.Path}}/commit/{{.Hash}}">{{short .Hash}}</a> <a class="subject" href="/{{$p.Repo.Path}}/commit/{{.Hash}}">{{.Subject}}</a>{{with signer .}}<span class="verified" title="Signed with a key registered by ~{{.}}">Verified ~{{.}}</span>{{end}}</div><div class="muted small">{{.Author}} · {{ago .Time}}</div></div>{{end}}</div>
{{end}}
{{if .Data.Files}}
<h3>Changes <span class="muted">{{len .Data.Files}} files, <span class="add">+{{.Data.Added}}</span> <span class="del">−{{.Data.Removed}}</span></span></h3>
{{range .Data.Files}}
<section class="diff" id="{{.New}}">
<h4><a href="/{{$p.Repo.Path}}/tree/{{$.Data.Head}}/{{.New}}">{{if eq .Status "renamed"}}{{.Old}} → {{end}}{{.New}}</a> <span class="muted">{{.Status}}</span></h4>
{{if .Binary}}<p class="muted">Binary file.</p>{{end}}
{{range .Hunks}}
<table class="hunk">
<tr class="head"><td colspan="3">{{.Header}}</td></tr>
{{range .Lines}}<tr class="{{.Kind}}"><td class="n">{{if .Old}}{{.Old}}{{end}}</td><td class="n">{{if .New}}{{.New}}{{end}}</td><td class="l">{{if eq .Kind "add"}}+{{else if eq .Kind "del"}}-{{else if eq .Kind "ctx"}} {{end}}{{.Text}}</td></tr>{{end}}
</table>
{{end}}
</section>
{{end}}
{{end}}
{{end}}
|