aboutsummaryrefslogtreecommitdiff
path: root/templates/repo
diff options
context:
space:
mode:
Diffstat (limited to 'templates/repo')
-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 80453516..3d4a8b1f 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="diff-{{Add $i 1}}L{{$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="diff-{{Add $i 1}}L{{$j}}{{$k}}">{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}</span>
</td>
<td class="lines-code">
- <pre>{{.Content}}</pre>
+ <pre>{{$line.Content}}</pre>
</td>
</tr>
{{end}}