|  | 
| 1 |  | -{{$blobExcerptLink := print $.RepoLink (Iif $.PageIsWiki "/wiki" "") "/blob_excerpt/" (PathEscape $.AfterCommitID) (QueryBuild "?" "anchor" $.Anchor)}} | 
|  | 1 | +{{$blobExcerptLink := print $.RepoLink (Iif $.PageIsWiki "/wiki" "") "/blob_excerpt/" (PathEscape $.AfterCommitID) "?" (Iif $.PageIsPullFiles (print "is_pull=true&issue_index=" $.IssueIndex "&") "")}} | 
| 2 | 2 | {{if $.IsSplitStyle}} | 
| 3 | 3 | 	{{range $k, $line := $.section.Lines}} | 
| 4 |  | -	<tr class="{{.GetHTMLDiffLineType}}-code nl-{{$k}} ol-{{$k}} line-expanded"> | 
|  | 4 | +	<tr class="{{.GetHTMLDiffLineType}}-code nl-{{$k}} ol-{{$k}} line-expanded" data-line-type="{{.GetHTMLDiffLineType}}"> | 
| 5 | 5 | 		{{if eq .GetType 4}} | 
| 6 | 6 | 			{{$expandDirection := $line.GetExpandDirection}} | 
| 7 | 7 | 			<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"> | 
|  | 
| 33 | 33 | 			<td class="lines-escape lines-escape-old">{{if and $line.LeftIdx $inlineDiff.EscapeStatus.Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"></button>{{end}}</td> | 
| 34 | 34 | 			<td class="lines-type-marker lines-type-marker-old">{{if $line.LeftIdx}}<span class="tw-font-mono" data-type-marker=""></span>{{end}}</td> | 
| 35 | 35 | 			<td class="lines-code lines-code-old"> | 
|  | 36 | +				{{- if and $.SignedUserID $.PageIsPullFiles $line.LeftIdx -}} | 
|  | 37 | +					<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-left{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="left" data-idx="{{$line.LeftIdx}}"> | 
|  | 38 | +						{{- svg "octicon-plus" -}} | 
|  | 39 | +					</button> | 
|  | 40 | +				{{- end -}} | 
| 36 | 41 | 				{{- if $line.LeftIdx -}} | 
| 37 | 42 | 					{{- template "repo/diff/section_code" dict "diff" $inlineDiff -}} | 
| 38 | 43 | 				{{- else -}} | 
|  | 
| 43 | 48 | 			<td class="lines-escape lines-escape-new">{{if and $line.RightIdx $inlineDiff.EscapeStatus.Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"></button>{{end}}</td> | 
| 44 | 49 | 			<td class="lines-type-marker lines-type-marker-new">{{if $line.RightIdx}}<span class="tw-font-mono" data-type-marker=""></span>{{end}}</td> | 
| 45 | 50 | 			<td class="lines-code lines-code-new"> | 
|  | 51 | +				{{- if and $.SignedUserID $.PageIsPullFiles $line.RightIdx -}} | 
|  | 52 | +					<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-right{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="right" data-idx="{{$line.RightIdx}}"> | 
|  | 53 | +						{{- svg "octicon-plus" -}} | 
|  | 54 | +					</button> | 
|  | 55 | +				{{- end -}} | 
| 46 | 56 | 				{{- if $line.RightIdx -}} | 
| 47 | 57 | 					{{- template "repo/diff/section_code" dict "diff" $inlineDiff -}} | 
| 48 | 58 | 				{{- else -}} | 
|  | 
| 51 | 61 | 			</td> | 
| 52 | 62 | 		{{end}} | 
| 53 | 63 | 	</tr> | 
|  | 64 | +	{{if $line.Comments}} | 
|  | 65 | +		<tr class="add-comment" data-line-type="{{.GetHTMLDiffLineType}}"> | 
|  | 66 | +			<td class="add-comment-left" colspan="4"> | 
|  | 67 | +				{{if eq $line.GetCommentSide "previous"}} | 
|  | 68 | +					{{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}} | 
|  | 69 | +				{{end}} | 
|  | 70 | +			</td> | 
|  | 71 | +			<td class="add-comment-right" colspan="4"> | 
|  | 72 | +				{{if eq $line.GetCommentSide "proposed"}} | 
|  | 73 | +					{{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}} | 
|  | 74 | +				{{end}} | 
|  | 75 | +			</td> | 
|  | 76 | +		</tr> | 
|  | 77 | +	{{end}} | 
| 54 | 78 | 	{{end}} | 
| 55 | 79 | {{else}} | 
| 56 | 80 | 	{{range $k, $line := $.section.Lines}} | 
| 57 |  | -	<tr class="{{.GetHTMLDiffLineType}}-code nl-{{$k}} ol-{{$k}} line-expanded"> | 
|  | 81 | +	<tr class="{{.GetHTMLDiffLineType}}-code nl-{{$k}} ol-{{$k}} line-expanded" data-line-type="{{.GetHTMLDiffLineType}}"> | 
| 58 | 82 | 		{{if eq .GetType 4}} | 
| 59 | 83 | 			{{$expandDirection := $line.GetExpandDirection}} | 
| 60 | 84 | 			<td colspan="2" class="lines-num"> | 
|  | 
| 83 | 107 | 		{{$inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale}} | 
| 84 | 108 | 		<td class="lines-escape">{{if $inlineDiff.EscapeStatus.Escaped}}<button class="toggle-escape-button btn interact-bg" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"></button>{{end}}</td> | 
| 85 | 109 | 		<td class="lines-type-marker"><span class="tw-font-mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span></td> | 
| 86 |  | -		<td class="lines-code{{if (not $line.RightIdx)}} lines-code-old{{end}}"><code {{if $inlineDiff.EscapeStatus.Escaped}}class="code-inner has-escaped" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"{{else}}class="code-inner"{{end}}>{{$inlineDiff.Content}}</code></td> | 
|  | 110 | +		<td class="lines-code{{if (not $line.RightIdx)}} lines-code-old{{end}}"> | 
|  | 111 | +			{{- if and $.SignedUserID $.PageIsPullFiles -}} | 
|  | 112 | +				<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="{{if $line.RightIdx}}right{{else}}left{{end}}" data-idx="{{if $line.RightIdx}}{{$line.RightIdx}}{{else}}{{$line.LeftIdx}}{{end}}"> | 
|  | 113 | +					{{- svg "octicon-plus" -}} | 
|  | 114 | +				</button> | 
|  | 115 | +			{{- end -}} | 
|  | 116 | +			<code {{if $inlineDiff.EscapeStatus.Escaped}}class="code-inner has-escaped" title="{{template "repo/diff/escape_title" dict "diff" $inlineDiff}}"{{else}}class="code-inner"{{end}}>{{$inlineDiff.Content}}</code> | 
|  | 117 | +		</td> | 
| 87 | 118 | 	</tr> | 
|  | 119 | +	{{if $line.Comments}} | 
|  | 120 | +		<tr class="add-comment" data-line-type="{{.GetHTMLDiffLineType}}"> | 
|  | 121 | +			<td class="add-comment-left add-comment-right" colspan="5"> | 
|  | 122 | +				{{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}} | 
|  | 123 | +			</td> | 
|  | 124 | +		</tr> | 
|  | 125 | +	{{end}} | 
| 88 | 126 | 	{{end}} | 
| 89 | 127 | {{end}} | 
0 commit comments