summaryrefslogtreecommitdiffstats
path: root/templates/repo/diff.tmpl
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2015-02-04 19:14:13 -0500
committerUnknwon <joe2010xtmf@163.com>2015-02-04 19:14:13 -0500
commite0329c0eb5eb54db81aab95bc2856b1d2036a022 (patch)
tree937517ee314284194cb57b4d80d5a64eaf825dbe /templates/repo/diff.tmpl
parent4dfffee9fb716672c7170013a4f69ca759f2dd51 (diff)
parent3e307e7862b29db87c99cccbf0866cb7be52b13c (diff)
downloadgitea-e0329c0eb5eb54db81aab95bc2856b1d2036a022.tar.gz
gitea-e0329c0eb5eb54db81aab95bc2856b1d2036a022.zip
Merge branch 'dev' of github.com:gogits/gogs into dev
Diffstat (limited to 'templates/repo/diff.tmpl')
-rw-r--r--templates/repo/diff.tmpl20
1 files changed, 10 insertions, 10 deletions
diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl
index 8045351600..ce31da6db5 100644
--- a/templates/repo/diff.tmpl
+++ b/templates/repo/diff.tmpl
@@ -74,11 +74,11 @@
</ol>
</div>
- {{range .Diff.Files}}
+ {{range $i, $file := .Diff.Files}}
<div class="panel panel-radius diff-file-box diff-box file-content" id="diff-{{.Index}}">
<div class="panel-header">
<div class="diff-counter count pull-left">
- {{if not .IsBin}}
+ {{if not $file.IsBin}}
<span class="add" data-line="{{.Addition}}">+ {{.Addition}}</span>
<span class="bar">
<span class="pull-left add"></span>
@@ -90,9 +90,9 @@
{{end}}
</div>
<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>
- <span class="file">{{.Name}}</span>
+ <span class="file">{{$file.Name}}</span>
</div>
- {{$isImage := (call $.IsImageFile .Name)}}
+ {{$isImage := (call $.IsImageFile $file.Name)}}
<div class="panel-body file-body file-code code-view code-diff">
{{if $isImage}}
<div class="text-center">
@@ -101,18 +101,18 @@
{{else}}
<table>
<tbody>
- {{range .Sections}}
- {{range .Lines}}
- <tr class="{{DiffLineTypeToStr .Type}}-code nl-1 ol-1">
+ {{range $j, $section := $file.Sections}}
+ {{range $k, $line := $section.Lines}}
+ <tr class="{{DiffLineTypeToStr .Type}}-code nl-{{$i}} ol-{{$i}}">
<td class="lines-num lines-num-old">
- <span rel="L1">{{if .LeftIdx}}{{.LeftIdx}}{{end}}</span>
+ <span rel="L{{Add $i 1}}{{$j}}{{$k}}">{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}</span>
</td>
<td class="lines-num lines-num-new">
- <span rel="L1">{{if .RightIdx}}{{.RightIdx}}{{end}}</span>
+ <span rel="L{{Add $i 1}}{{$j}}{{$k}}">{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}</span>
</td>
<td class="lines-code">
- <pre>{{.Content}}</pre>
+ <pre>{{$line.Content}}</pre>
</td>
</tr>
{{end}}