1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-25 02:33:11 +00:00

add multifile support to diff view highlighting

This commit is contained in:
Alexey Makhov 2015-02-04 21:54:45 +03:00
parent 7f71fe9dae
commit 5d4425bbbc

View file

@ -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">