section_unified.tmpl 917 B

12345678910111213141516171819
  1. {{$file := .}}
  2. {{$highlightClass := $file.HighlightClass}}
  3. {{range $j, $section := $file.Sections}}
  4. {{range $k, $line := $section.Lines}}
  5. <tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
  6. {{if eq .GetType 4}}
  7. <td colspan="2" class="lines-num">
  8. {{/* {{if gt $j 0}}<span class="fold octicon octicon-fold"></span>{{end}} */}}
  9. </td>
  10. {{else}}
  11. <td class="lines-num lines-num-old" {{if $line.LeftIdx}} id="diff-{{$file.Index}}L{{$line.LeftIdx}}" data-line-number="{{$line.LeftIdx}}"{{end}}></td>
  12. <td class="lines-num lines-num-new" {{if $line.RightIdx}} id="diff-{{$file.Index}}R{{$line.RightIdx}}" data-line-number="{{$line.RightIdx}}"{{end}}></td>
  13. {{end}}
  14. <td class="lines-code">
  15. <pre><code class="{{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{$section.ComputedInlineDiffFor $line}}</code></pre>
  16. </td>
  17. </tr>
  18. {{end}}
  19. {{end}}