diff options
author | Tony Tsang <tony@tcnhk.com> | 2015-02-06 17:02:32 +0800 |
---|---|---|
committer | Tony Tsang <tony@tcnhk.com> | 2015-02-06 17:02:32 +0800 |
commit | fc6d80d619d960b340bf1ebc7131add86985e725 (patch) | |
tree | c0456feb0ea004cc83dad3844fc927f4c3f4bcb6 /templates | |
parent | 16018e832394772591688a261646d3a80787ac9d (diff) | |
download | gitea-fc6d80d619d960b340bf1ebc7131add86985e725.tar.gz gitea-fc6d80d619d960b340bf1ebc7131add86985e725.zip |
Link to previous commited source file (diff.view_file button) instead of returning 404 for deleted files.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/diff.tmpl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl index 3d4a8b1fa7..443e002d59 100644 --- a/templates/repo/diff.tmpl +++ b/templates/repo/diff.tmpl @@ -89,7 +89,11 @@ {{$.i18n.Tr "repo.diff.bin"}} {{end}} </div> + {{if $file.IsDeleted}} + <a class="btn btn-gray btn-header btn-radius text-black pull-right" rel="nofollow" href="{{$.BeforeSourcePath}}/{{.Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a> + {{else}} <a class="btn btn-gray btn-header btn-radius text-black pull-right" rel="nofollow" href="{{$.SourcePath}}/{{.Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a> + {{end}} <span class="file">{{$file.Name}}</span> </div> {{$isImage := (call $.IsImageFile $file.Name)}} |