You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

diff_preview.tmpl 1.3KB

1234567891011121314151617181920212223242526272829303132
  1. {{$highlightClass := .File.GetHighlightClass}}
  2. <div class="diff-file-box diff-box file-content" id="diff-{{.Index}}">
  3. <div class="ui attached table segment">
  4. <div class="file-body file-code code-view code-diff">
  5. <table>
  6. <tbody>
  7. {{range $j, $section := .File.Sections}}
  8. {{range $k, $line := $section.Lines}}
  9. <tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
  10. {{if eq .GetType 4}}
  11. <td colspan="2" class="lines-num">
  12. {{/* {{if gt $j 0}}<span class="fold octicon octicon-fold"></span>{{end}} */}}
  13. </td>
  14. {{else}}
  15. <td class="lines-num lines-num-old">
  16. <span rel="{{if $line.LeftIdx}}diff-{{Sha1 $.File.Name}}L{{$line.LeftIdx}}{{end}}">{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}</span>
  17. </td>
  18. <td class="lines-num lines-num-new">
  19. <span rel="{{if $line.RightIdx}}diff-{{Sha1 $.File.Name}}R{{$line.RightIdx}}{{end}}">{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}</span>
  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}}
  28. </tbody>
  29. </table>
  30. </div>
  31. </div>
  32. </div>