summaryrefslogtreecommitdiffstats
path: root/templates/repo
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-11-03 09:52:17 -0500
committerUnknwon <u@gogs.io>2015-11-03 09:52:17 -0500
commit0af035c37e8b561662c93b163b3294b91be6ffac (patch)
treed985f7b5c5e635235c5fc503a3d09cf91d81bd14 /templates/repo
parentbc8215721627fcdeaa23c6e3bf625e0c4e5c3407 (diff)
downloadgitea-0af035c37e8b561662c93b163b3294b91be6ffac.tar.gz
gitea-0af035c37e8b561662c93b163b3294b91be6ffac.zip
#1078 not show bin when rename a file
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/diff_box.tmpl56
1 files changed, 29 insertions, 27 deletions
diff --git a/templates/repo/diff_box.tmpl b/templates/repo/diff_box.tmpl
index e531434310..a1d106b7f2 100644
--- a/templates/repo/diff_box.tmpl
+++ b/templates/repo/diff_box.tmpl
@@ -57,33 +57,35 @@
</div>
</h4>
<div class="ui attached table segment">
- {{$isImage := (call $.IsImageFile $file.Name)}}
- {{if $isImage}}
- <div class="center">
- <img src="{{$.RawPath}}/{{EscapePound .Name}}">
- </div>
- {{else}}
- <div class="file-body file-code code-view code-diff">
- <table>
- <tbody>
- {{range .Sections}}
- {{range $k, $line := .Lines}}
- <tr class="{{DiffLineTypeToStr .Type}}-code nl-{{$k}} ol-{{$k}}">
- <td class="lines-num lines-num-old">
- <span rel="{{if $line.LeftIdx}}diff-{{Sha1 $file.Name}}L{{$line.LeftIdx}}{{end}}">{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}</span>
- </td>
- <td class="lines-num lines-num-new">
- <span rel="{{if $line.RightIdx}}diff-{{Sha1 $file.Name}}R{{$line.RightIdx}}{{end}}">{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}</span>
- </td>
- <td class="lines-code">
- <pre>{{$line.Content}}</pre>
- </td>
- </tr>
- {{end}}
- {{end}}
- </tbody>
- </table>
- </div>
+ {{if not $file.IsRenamed}}
+ {{$isImage := (call $.IsImageFile $file.Name)}}
+ {{if and $isImage}}
+ <div class="center">
+ <img src="{{$.RawPath}}/{{EscapePound .Name}}">
+ </div>
+ {{else}}
+ <div class="file-body file-code code-view code-diff">
+ <table>
+ <tbody>
+ {{range .Sections}}
+ {{range $k, $line := .Lines}}
+ <tr class="{{DiffLineTypeToStr .Type}}-code nl-{{$k}} ol-{{$k}}">
+ <td class="lines-num lines-num-old">
+ <span rel="{{if $line.LeftIdx}}diff-{{Sha1 $file.Name}}L{{$line.LeftIdx}}{{end}}">{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}</span>
+ </td>
+ <td class="lines-num lines-num-new">
+ <span rel="{{if $line.RightIdx}}diff-{{Sha1 $file.Name}}R{{$line.RightIdx}}{{end}}">{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}</span>
+ </td>
+ <td class="lines-code">
+ <pre>{{$line.Content}}</pre>
+ </td>
+ </tr>
+ {{end}}
+ {{end}}
+ </tbody>
+ </table>
+ </div>
+ {{end}}
{{end}}
</div>
</div>