diff --git a/appview/pages/templates/repo/commit.html b/appview/pages/templates/repo/commit.html index 7f05d8a..952b23a 100644 --- a/appview/pages/templates/repo/commit.html +++ b/appview/pages/templates/repo/commit.html @@ -61,7 +61,9 @@ {{ $this := $commit.This }} {{ $parent := $commit.Parent }} - {{ range $diff }} + {{ $last := sub (len $diff) 1 }} + {{ range $idx, $hunk := $diff }} + {{ with $hunk }}
@@ -91,7 +93,20 @@
- to top of file + top of file + + {{ if gt $idx 0 }} +  ·  + {{ $prev := index $diff (sub $idx 1) }} + prev + {{ end }} + + + {{ if lt $idx $last }} +  ·  + {{ $next := index $diff (add $idx 1) }} + next + {{ end }}
@@ -128,5 +143,6 @@
{{ end }} + {{ end }} {{end}}