{{$diffBlobExcerptData := .DiffBlobExcerptData}} {{$canCreateComment := and ctx.RootData.SignedUserID $diffBlobExcerptData.PullIssueIndex}} {{if $.IsSplitStyle}} {{range $k, $line := $.section.Lines}} {{if eq .GetType 4}} {{$line.RenderBlobExcerptButtons $.FileNameHash $diffBlobExcerptData}} {{- $inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale -}} {{- template "repo/diff/section_code" dict "diff" $inlineDiff -}} {{else}} {{$inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale}} {{if and $line.LeftIdx $inlineDiff.EscapeStatus.Escaped}}{{end}} {{if $line.LeftIdx}}{{end}} {{/* ATTENTION: BLOB-EXCERPT-COMMENT-RIGHT: here it intentially use "right" side to comment, because the backend code depends on the assumption that the comment only happens on right side*/}} {{- if and $canCreateComment $line.RightIdx -}} {{- end -}} {{- if $line.LeftIdx -}} {{- template "repo/diff/section_code" dict "diff" $inlineDiff -}} {{- else -}} {{- end -}} {{if and $line.RightIdx $inlineDiff.EscapeStatus.Escaped}}{{end}} {{if $line.RightIdx}}{{end}} {{- if and $canCreateComment $line.RightIdx -}} {{- end -}} {{- if $line.RightIdx -}} {{- template "repo/diff/section_code" dict "diff" $inlineDiff -}} {{- else -}} {{- end -}} {{end}} {{if $line.Comments}} {{if eq $line.GetCommentSide "previous"}} {{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}} {{end}} {{if eq $line.GetCommentSide "proposed"}} {{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}} {{end}} {{end}} {{end}} {{else}} {{range $k, $line := $.section.Lines}} {{if eq .GetType 4}} {{$line.RenderBlobExcerptButtons $.FileNameHash $diffBlobExcerptData}} {{else}} {{end}} {{$inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale}} {{if $inlineDiff.EscapeStatus.Escaped}}{{end}} {{- if and $canCreateComment -}} {{- end -}} {{$inlineDiff.Content}} {{if $line.Comments}} {{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}} {{end}} {{end}} {{end}}