Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software:2222/vole.git

A free and open-source forge that lives in your Git repo.

Code

395 commit(s) on main

update readme Keenan Nemetz · 24m ago 32290114
history blame raw 2.9 KiB
1{{/* The diff component, used by the commit view, the compare view and the change
2 request Files tab. Go computes the parse and the summary (diff.go); this is
3 only the table, including the inline review-comment row and its notes. Each
4 file's header carries the file's own counts, so a pane that shows one file
5 needs no separate summary line above it; the total line is for the multi-file
6 diff a compare renders. */}}
7{{define "diff"}}
8{{if ne (len .Files) 1}}<div class="diffsum muted">{{len .Files}} file{{if ne (len .Files) 1}}s{{end}} changed{{if .Added}} · <span class="adds">+{{.Added}}</span>{{end}}{{if .Removed}} · <span class="dels">−{{.Removed}}</span>{{end}}</div>{{end}}
9{{range .Files}}
10{{$file := .}}
11<section class="diff"{{if .Language}} data-highlight="{{.Language}}"{{end}}>
12 <h3>
13 <span class="path">{{if and .OldPath .NewPath (ne .OldPath .NewPath)}}{{.OldPath}} → {{end}}{{.Label}}</span>{{if .Binary}}<span class="label">binary</span>{{end}}
14 <span class="diffstat">{{if .Added}}<span class="adds">+{{.Added}}</span>{{end}}{{if .Removed}}<span class="dels">−{{.Removed}}</span>{{end}}</span>
15 </h3>
16 {{if .Binary}}
17 <p class="binary">Binary file: no line diff to show. Use <code>git show</code> to inspect it.</p>
18 {{end}}
19 {{if .Hunks}}
20 <table>
21 <colgroup><col class="comment-col"><col class="ln-col"><col class="ln-col"><col></colgroup>
22 <tbody>
23 {{range .Hunks}}
24 <tr class="hunk"><td colspan="4">{{.Header}}</td></tr>
25 {{range .Lines}}
26 {{$side := "new"}}{{$path := $file.NewPath}}
27 {{if eq .Kind "del"}}{{$side = "old"}}{{$path = $file.OldPath}}{{end}}
28 <tr class="{{.Kind}}">
29 <td class="comment-cell">
30 {{if and $.LineCommentURL $path}}<a href="{{$.LineCommentURL}}?path={{urlquery $path}}&amp;line={{if eq $side "old"}}{{.OldNo}}{{else}}{{.NewNo}}{{end}}&amp;side={{$side}}#request-comment-form" hx-get="{{$.LineCommentURL}}/comment-form?path={{urlquery $path}}&amp;line={{if eq $side "old"}}{{.OldNo}}{{else}}{{.NewNo}}{{end}}&amp;side={{$side}}" hx-target="closest tr" hx-swap="afterend" data-inline-comment-add title="Comment on this line" aria-label="Comment on this line">{{icon "plus"}}</a>{{end}}
31 </td>
32 <td class="ln">{{if .OldNo}}{{.OldNo}}{{end}}</td>
33 <td class="ln">{{if .NewNo}}{{.NewNo}}{{end}}</td>
34 <td class="code" data-highlight-side="{{$side}}">{{.Text}}</td>
35 </tr>
36 {{if .Comments}}
37 <tr class="note"><td colspan="4">
38 {{range .Comments}}
39 <div class="inline-note" id="inline-c-{{.ID}}">
40 <div class="inline-note-head">
41 <a class="comment-author" href="#c-{{.ID}}">{{who .Author}}</a>
42 <span class="muted">{{since .Created.Unix}}</span>
43 </div>
44 <div class="comment-body md">{{.Body}}</div>
45 </div>
46 {{end}}
47 </td></tr>
48 {{end}}
49 {{end}}
50 {{end}}
51 </tbody>
52 </table>
53 {{end}}
54</section>
55{{end}}
56{{end}}
57