~gitpocket/gitpocket

4
596ffcb7561c765dcb863537f5fce31ae758797e
mainfeed-discovery
gitpocket/templates/interdiff.html -rw-r--r--1.2 KiB ViewLogBlameView rawPermalink 7878eb0781 feat(web): range-diff, pickaxe search and atom feeds 1 months ago
1
2
3
4
5
6
7
{{define "content"}}
{{$p := .Data.Page}}{{$pr := .Data.Pull}}
<h3 class="plain"><a href="/{{$p.Repo.Path}}/pulls/{{$pr.Number}}">{{$pr.Title}}</a> <span class="muted">#{{$pr.Number}}</span></h3>
<p class="muted">How the series changed between revision {{.Data.From}} (<code>{{short (index .Data.Revisions (sub .Data.From 1))}}</code>) and revision {{.Data.To}} (<code>{{short (index .Data.Revisions (sub .Data.To 1))}}</code>), computed with <code>git range-diff</code>. Lines marked <code>=</code> are unchanged commits, <code>!</code> were rewritten, <code>&gt;</code> are new and <code>&lt;</code> were dropped.</p>
<nav class="revpick">{{range $i, $h := .Data.Revisions}}{{$n := add $i 1}}{{if gt $n 1}}<a href="?from={{sub $n 1}}&to={{$n}}"{{if and (eq $.Data.To $n) (eq $.Data.From (sub $n 1))}} class="active"{{end}}>v{{sub $n 1}} → v{{$n}}</a>{{end}}{{end}}{{if gt (len .Data.Revisions) 2}}<a href="?from=1&to={{len .Data.Revisions}}"{{if and (eq .Data.From 1) (eq .Data.To (len .Data.Revisions))}} class="active"{{end}}>v1 → v{{len .Data.Revisions}}</a>{{end}}</nav>
<pre class="rangediff">{{range .Data.Lines}}<span class="{{.Class}}">{{.Text}}</span>{{end}}</pre>
{{end}}