|
40 | 40 | <td class="lines-code lines-code-new halfwidth">{{if and $.root.SignedUserID $.root.PageIsPullFiles (not (eq .GetType 3))}}<a class="ui primary button add-code-comment add-code-comment-right{{if (not $line.CanComment)}} invisible{{end}}" data-path="{{$file.Name}}" data-side="right" data-idx="{{$line.RightIdx}}" data-new-comment-url="{{$.root.Issue.HTMLURL}}/files/reviews/new_comment">{{svg "octicon-plus"}}</a>{{end}}<code class="code-inner">{{if $line.RightIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}}</code></td>
|
41 | 41 | {{end}}
|
42 | 42 | </tr>
|
43 |
| - {{if gt (len $line.Comments) 0}} |
44 |
| - <tr class="add-comment" data-line-type="{{DiffLineTypeToStr .GetType}}"> |
45 |
| - <td class="lines-num"></td> |
46 |
| - <td class="lines-type-marker"></td> |
47 |
| - <td class="add-comment-left"> |
48 |
| - {{if eq $line.GetCommentSide "previous"}} |
49 |
| - {{template "repo/diff/conversation" mergeinto $.root "comments" $line.Comments}} |
50 |
| - {{end}} |
51 |
| - </td> |
52 |
| - <td class="lines-num"></td> |
53 |
| - <td class="lines-type-marker"></td> |
54 |
| - <td class="add-comment-right"> |
55 |
| - {{if eq $line.GetCommentSide "proposed"}} |
56 |
| - {{template "repo/diff/conversation" mergeinto $.root "comments" $line.Comments}} |
57 |
| - {{end}} |
58 |
| - </td> |
59 |
| - </tr> |
60 |
| - {{end}} |
61 | 43 | {{if and (eq .GetType 3) $hasmatch}}
|
62 | 44 | {{$match := index $section.Lines $line.Match}}
|
63 |
| - {{if gt (len $match.Comments) 0}} |
64 |
| - <tr class="add-comment" data-line-type="add"> |
| 45 | + {{if or (gt (len $line.Comments) 0) (gt (len $match.Comments) 0)}} |
| 46 | + <tr class="add-comment" data-line-type="{{DiffLineTypeToStr .GetType}}"> |
65 | 47 | <td class="lines-num"></td>
|
66 | 48 | <td class="lines-type-marker"></td>
|
67 | 49 | <td class="add-comment-left">
|
68 |
| - {{if eq $match.GetCommentSide "previous"}} |
69 |
| - {{template "repo/diff/conversation" mergeinto $.root "comments" $match.Comments}} |
| 50 | + {{if gt (len $line.Comments) 0}} |
| 51 | + {{if eq $line.GetCommentSide "previous"}} |
| 52 | + {{template "repo/diff/conversation" mergeinto $.root "comments" $line.Comments}} |
| 53 | + {{end}} |
| 54 | + {{end}} |
| 55 | + {{if gt (len $match.Comments) 0}} |
| 56 | + {{if eq $match.GetCommentSide "previous"}} |
| 57 | + {{template "repo/diff/conversation" mergeinto $.root "comments" $match.Comments}} |
| 58 | + {{end}} |
70 | 59 | {{end}}
|
71 | 60 | </td>
|
72 | 61 | <td class="lines-num"></td>
|
73 | 62 | <td class="lines-type-marker"></td>
|
74 | 63 | <td class="add-comment-right">
|
75 |
| - {{if eq $match.GetCommentSide "proposed"}} |
76 |
| - {{template "repo/diff/conversation" mergeinto $.root "comments" $match.Comments}} |
| 64 | + {{if eq $line.GetCommentSide "proposed"}} |
| 65 | + {{template "repo/diff/conversation" mergeinto $.root "comments" $line.Comments}} |
| 66 | + {{end}} |
| 67 | + {{if gt (len $match.Comments) 0}} |
| 68 | + {{if eq $match.GetCommentSide "proposed"}} |
| 69 | + {{template "repo/diff/conversation" mergeinto $.root "comments" $match.Comments}} |
| 70 | + {{end}} |
77 | 71 | {{end}}
|
78 | 72 | </td>
|
79 | 73 | </tr>
|
80 | 74 | {{end}}
|
| 75 | + {{else if gt (len $line.Comments) 0}} |
| 76 | + <tr class="add-comment" data-line-type="{{DiffLineTypeToStr .GetType}}"> |
| 77 | + <td class="lines-num"></td> |
| 78 | + <td class="lines-type-marker"></td> |
| 79 | + <td class="add-comment-left"> |
| 80 | + {{if gt (len $line.Comments) 0}} |
| 81 | + {{if eq $line.GetCommentSide "previous"}} |
| 82 | + {{template "repo/diff/conversation" mergeinto $.root "comments" $line.Comments}} |
| 83 | + {{end}} |
| 84 | + {{end}} |
| 85 | + </td> |
| 86 | + <td class="lines-num"></td> |
| 87 | + <td class="lines-type-marker"></td> |
| 88 | + <td class="add-comment-right"> |
| 89 | + {{if eq $line.GetCommentSide "proposed"}} |
| 90 | + {{template "repo/diff/conversation" mergeinto $.root "comments" $line.Comments}} |
| 91 | + {{end}} |
| 92 | + </td> |
| 93 | + </tr> |
81 | 94 | {{end}}
|
82 | 95 | {{end}}
|
83 | 96 | {{end}}
|
|
0 commit comments