Link to parent commit file version in commit view
It makes sense for [oldfile] in [oldfile]->[newfile] to link to the previous version. This is also how cgit behaves.
This commit is contained in:
parent
e5d35c4dec
commit
1375740735
|
@ -45,6 +45,7 @@
|
||||||
<section>
|
<section>
|
||||||
{{ $repo := .name }}
|
{{ $repo := .name }}
|
||||||
{{ $this := .commit.This }}
|
{{ $this := .commit.This }}
|
||||||
|
{{ $parent := .commit.Parent }}
|
||||||
{{ range .diff }}
|
{{ range .diff }}
|
||||||
<div id="{{ .Name.New }}">
|
<div id="{{ .Name.New }}">
|
||||||
<div class="diff">
|
<div class="diff">
|
||||||
|
@ -58,7 +59,7 @@
|
||||||
<span class="diff-type">M</span>
|
<span class="diff-type">M</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if .Name.Old }}
|
{{ if .Name.Old }}
|
||||||
<a href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.Old }}">{{ .Name.Old }}</a>
|
<a href="/{{ $repo }}/blob/{{ $parent }}/{{ .Name.Old }}">{{ .Name.Old }}</a>
|
||||||
{{ if .Name.New }}
|
{{ if .Name.New }}
|
||||||
→
|
→
|
||||||
<a href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.New }}">{{ .Name.New }}</a>
|
<a href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.New }}">{{ .Name.New }}</a>
|
||||||
|
|
Loading…
Reference in New Issue