section_unified.tmpl 997 B

123456789101112131415161718192021222324252627
  1. {{$file := .}}
  2. {{$highlightClass := $file.GetHighlightClass}}
  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}}"{{end}}>
  12. {{if $line.LeftIdx}}
  13. <span>{{$line.LeftIdx}}</span>
  14. {{end}}
  15. </td>
  16. <td class="lines-num lines-num-new" {{if $line.RightIdx}}id="diff-{{$file.Index}}R{{$line.RightIdx}}"{{end}}>
  17. {{if $line.RightIdx}}
  18. <span>{{$line.RightIdx}}</span>
  19. {{end}}
  20. </td>
  21. {{end}}
  22. <td class="lines-code">
  23. <pre><code class="{{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{$section.GetComputedInlineDiffFor $line}}</code></pre>
  24. </td>
  25. </tr>
  26. {{end}}
  27. {{end}}