{{$file := $.file}} {{/* this tmpl is also used by the PR Conversation page, so "DiffBlobExcerptData" may not exist */}} {{$diffBlobExcerptData := ctx.RootData.DiffBlobExcerptData}} {{$canAddComment := and ctx.RootData.SignedUserID $diffBlobExcerptData.PullIssueIndex}} {{range $section := $file.Sections}} {{range $line := $section.Lines}} {{if $line.IsDiffLineSection}} {{if $diffBlobExcerptData}} {{$line.RenderBlobExcerptButtons $file.NameHash $diffBlobExcerptData}} {{else}} {{/* when DiffBlobExcerptData is not available (code file preview, pull conversation diff comment), do not show the expansion arrows */}} {{end}} {{else}} {{end}} {{$inlineDiff := $section.GetComputedInlineDiffFor $line ctx.Locale -}} {{ctx.RenderUtils.RenderUnicodeEscapeToggleButton $inlineDiff.EscapeStatus}} {{if $line.IsDiffLineSection}} {{template "repo/diff/section_code" dict "diff" $inlineDiff}} {{else}} {{- if $canAddComment -}} {{- end -}} {{- template "repo/diff/section_code" dict "diff" $inlineDiff -}} {{end}} {{if $line.Comments}} {{template "repo/diff/conversation" dict "comments" $line.Comments}} {{end}} {{end}} {{end}}