summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorAlexey Makhov <makhov.alex@gmail.com>2015-02-04 21:54:45 +0300
committerAlexey Makhov <makhov.alex@gmail.com>2015-02-04 21:54:45 +0300
commit5d4425bbbc8a6747f53e488d230dbae33ebd935e (patch)
tree7d57f3b02f93250f4200c06c764742c131d138f4 /templates
parent7f71fe9dae05d11c51ee5009580c14c47edf5043 (diff)
downloadgitea-5d4425bbbc8a6747f53e488d230dbae33ebd935e.tar.gz
gitea-5d4425bbbc8a6747f53e488d230dbae33ebd935e.zip
add multifile support to diff view highlighting
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/diff.tmpl16
1 files changed, 8 insertions, 8 deletions
diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl
index 8becb00659..13b78a38b9 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,14 +101,14 @@
{{else}}
<table>
<tbody>
- {{range .Sections}}
- {{range $i, $line := .Lines}}
+ {{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="L{{$i}}">{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}</span>
+ <span rel="L{{Add $i 1}}{{Add $j 1}}{{$k}}">{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}</span>
</td>
<td class="lines-num lines-num-new">
- <span rel="L{{$i}}">{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}</span>
+ <span rel="L{{Add $i 1}}{{Add $j 1}}{{$k}}">{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}</span>
</td>
<td class="lines-code">