gogs/templates/repo/diff/section_unified.tmpl

27 lines
991 B
Cheetah

{{$file := .}}
{{$highlightClass := $file.HighlightClass}}
{{range $j, $section := $file.Sections}}
{{range $k, $line := $section.Lines}}
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
{{if eq .GetType 4}}
<td colspan="2" class="lines-num">
{{/* {{if gt $j 0}}<span class="fold octicon octicon-fold"></span>{{end}} */}}
</td>
{{else}}
<td class="lines-num lines-num-old" {{if $line.LeftIdx}}id="diff-{{$file.Index}}L{{$line.LeftIdx}}"{{end}}>
{{if $line.LeftIdx}}
<span>{{$line.LeftIdx}}</span>
{{end}}
</td>
<td class="lines-num lines-num-new" {{if $line.RightIdx}}id="diff-{{$file.Index}}R{{$line.RightIdx}}"{{end}}>
{{if $line.RightIdx}}
<span>{{$line.RightIdx}}</span>
{{end}}
</td>
{{end}}
<td class="lines-code">
<pre><code class="{{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{$section.ComputedInlineDiffFor $line}}</code></pre>
</td>
</tr>
{{end}}
{{end}}