~gitpocket/gitpocket

1
e25b6c8474f332e0ea5e97f3115d1fb8c1ffb252
mainfeed-discovery
gitpocket/templates/compare.html -rw-r--r--1.9 KiB ViewLogBlameView rawPermalink a3d84a990a feat(basin): mail, password reset, totp, issues, stars, rename, transfer, archive, blame, compare, downloads, feeds, admin commands 15 hours ago
 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
{{define "content"}}
{{$p := .Data.Page}}
<h3 class="plain">Compare</h3>
<form method="get" action="/{{$p.Repo.Path}}/compare" class="compareform">
<label>base <input name="base" list="refs" value="{{.Data.Base}}" placeholder="main"></label>
<span>…</span>
<label>head <input name="head" list="refs" value="{{.Data.Head}}" placeholder="feature"></label>
<datalist id="refs">{{range .Data.Branches}}<option value="{{.Name}}">{{end}}</datalist>
<button class="btn">Compare ▸</button>
</form>
{{if .Data.Unrelated}}<p class="info">These refs have no common history.</p>{{end}}
{{if .Data.Commits}}
<h3>Commits <span class="muted">{{len .Data.Commits}}</span></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></div><div class="muted small">{{.Author}} · {{ago .Time}}</div></div>{{end}}</div>
{{else if and .Data.Base .Data.Head (not .Data.Unrelated)}}<p class="info">{{.Data.Head}} has nothing that {{.Data.Base}} does not.</p>{{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.HeadHash}}/{{.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}}