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.

section_unified.tmpl 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {{$file := .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" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}">
  12. <span rel="{{if $line.LeftIdx}}diff-{{Sha1 $file.Name}}L{{$line.LeftIdx}}{{end}}"></span>
  13. </td>
  14. <td class="lines-num lines-num-new" data-line-num="{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}">
  15. <span rel="{{if $line.RightIdx}}diff-{{Sha1 $file.Name}}R{{$line.RightIdx}}{{end}}"></span>
  16. </td>
  17. {{end}}
  18. <td class="lines-type-marker">
  19. <pre><span class="line-type-marker" data-type-marker="{{$line.GetLineTypeMarker}}"></span></pre>
  20. </td>
  21. <td class="lines-code {{if (not $line.RightIdx)}}lines-code-old{{end}}">
  22. {{if and $.root.SignedUserID $line.CanComment $.root.PageIsPullFiles}}
  23. <a class="ui green button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}" data-path="{{$file.Name}}" data-side="{{if $line.RightIdx}}right{{else}}left{{end}}" data-idx="{{if $line.RightIdx}}{{$line.RightIdx}}{{else}}{{$line.LeftIdx}}{{end}}">+</a>
  24. {{end}}
  25. <pre><code class="wrap {{if $highlightClass}}language-{{$highlightClass}}{{else}}nohighlight{{end}}">{{$section.GetComputedInlineDiffFor $line}}</code></pre>
  26. </td>
  27. </tr>
  28. {{if gt (len $line.Comments) 0}}
  29. <tr>
  30. <td colspan="2" class="lines-num"></td>
  31. <td class="lines-type-marker"></td>
  32. <td class="add-comment-left add-comment-right">
  33. <div class="field comment-code-cloud">
  34. <div class="comment-list">
  35. <ui class="ui comments">
  36. {{ template "repo/diff/comments" dict "root" $.root "comments" $line.Comments}}
  37. </ui>
  38. </div>
  39. {{template "repo/diff/comment_form_datahandler" dict "hidden" true "reply" (index $line.Comments 0).ReviewID "root" $.root "comment" (index $line.Comments 0)}}
  40. </div>
  41. </td>
  42. </tr>
  43. {{end}}
  44. {{end}}
  45. {{end}}