選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

section_unified.tmpl 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {{$file := .file}}
  2. {{range $j, $section := $file.Sections}}
  3. {{range $k, $line := $section.Lines}}
  4. {{if or $.root.AfterCommitID (ne .GetType 4)}}
  5. <tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}" data-line-type="{{DiffLineTypeToStr .GetType}}">
  6. {{if eq .GetType 4}}
  7. <td colspan="2" class="lines-num">
  8. {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
  9. <a role="button" class="blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{$.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=down" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}">
  10. {{svg "octicon-fold-down"}}
  11. </a>
  12. {{end}}
  13. {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
  14. <a role="button" class="blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{$.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=up" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}">
  15. {{svg "octicon-fold-up"}}
  16. </a>
  17. {{end}}
  18. {{if eq $line.GetExpandDirection 2}}
  19. <a role="button" class="blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{$.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}">
  20. {{svg "octicon-fold"}}
  21. </a>
  22. {{end}}
  23. </td>
  24. {{else}}
  25. <td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{Sha1 $file.Name}}L{{$line.LeftIdx}}{{end}}"></span></td>
  26. <td class="lines-num lines-num-new" data-line-num="{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}"><span rel="{{if $line.RightIdx}}diff-{{Sha1 $file.Name}}R{{$line.RightIdx}}{{end}}"></span></td>
  27. {{end}}
  28. <td class="lines-type-marker"><span class="mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span></td>
  29. {{if eq .GetType 4}}
  30. <td class="chroma lines-code blob-hunk"><code class="code-inner">{{$section.GetComputedInlineDiffFor $line}}</code></td>
  31. {{else}}
  32. <td class="chroma lines-code{{if (not $line.RightIdx)}} lines-code-old{{end}}">{{if and $.root.SignedUserID $.root.PageIsPullFiles}}<a class="ui primary button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}{{if (not $line.CanComment)}} invisible{{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}}" data-new-comment-url="{{$.root.Issue.HTMLURL}}/files/reviews/new_comment">{{svg "octicon-plus"}}</a>{{end}}<code class="code-inner">{{$section.GetComputedInlineDiffFor $line}}</code></td>
  33. {{end}}
  34. </tr>
  35. {{if gt (len $line.Comments) 0}}
  36. <tr class="add-comment" data-line-type="{{DiffLineTypeToStr .GetType}}">
  37. <td colspan="2" class="lines-num"></td>
  38. <td class="add-comment-left add-comment-right" colspan="2">
  39. {{template "repo/diff/conversation" mergeinto $.root "comments" $line.Comments}}
  40. </td>
  41. </tr>
  42. {{end}}
  43. {{end}}
  44. {{end}}
  45. {{end}}