section_unified.tmpl 985 B

1234567891011121314151617181920212223
  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">
  12. <span rel="{{if $line.LeftIdx}}diff-{{Sha1 $file.Name}}L{{$line.LeftIdx}}{{end}}">{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}</span>
  13. </td>
  14. <td class="lines-num lines-num-new">
  15. <span rel="{{if $line.RightIdx}}diff-{{Sha1 $file.Name}}R{{$line.RightIdx}}{{end}}">{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}</span>
  16. </td>
  17. {{end}}
  18. <td class="lines-code">
  19. <pre><code class="{{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{$section.GetComputedInlineDiffFor $line}}</code></pre>
  20. </td>
  21. </tr>
  22. {{end}}
  23. {{end}}