{{$file := .file}} {{range $j, $section := $file.Sections}} {{range $k, $line := $section.Lines}} {{$hasmatch := ne $line.Match -1}} {{if or (ne .GetType 2) (not $hasmatch)}} {{if eq .GetType 4}} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} {{svg "octicon-fold-down"}} {{end}} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} {{svg "octicon-fold-up"}} {{end}} {{if eq $line.GetExpandDirection 2}} {{svg "octicon-fold"}} {{end}} {{$section.GetComputedInlineDiffFor $line}} {{else if and (eq .GetType 3) $hasmatch}}{{/* DEL */}} {{$match := index $section.Lines $line.Match}} {{if and $.root.SignedUserID $.root.PageIsPullFiles}}{{svg "octicon-plus"}}{{end}}{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}} {{if $match.RightIdx}}{{end}} {{if and $.root.SignedUserID $.root.PageIsPullFiles}}{{svg "octicon-plus"}}{{end}}{{if $match.RightIdx}}{{$section.GetComputedInlineDiffFor $match}}{{end}} {{else}} {{if $line.LeftIdx}}{{end}} {{if and $.root.SignedUserID $.root.PageIsPullFiles (not (eq .GetType 2))}}{{svg "octicon-plus"}}{{end}}{{if $line.LeftIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}} {{if $line.RightIdx}}{{end}} {{if and $.root.SignedUserID $.root.PageIsPullFiles (not (eq .GetType 3))}}{{svg "octicon-plus"}}{{end}}{{if $line.RightIdx}}{{$section.GetComputedInlineDiffFor $line}}{{end}} {{end}} {{if and (eq .GetType 3) $hasmatch}} {{$match := index $section.Lines $line.Match}} {{if or (gt (len $line.Comments) 0) (gt (len $match.Comments) 0)}} {{if gt (len $line.Comments) 0}} {{if eq $line.GetCommentSide "previous"}} {{template "repo/diff/conversation" mergeinto $.root "comments" $line.Comments}} {{end}} {{end}} {{if gt (len $match.Comments) 0}} {{if eq $match.GetCommentSide "previous"}} {{template "repo/diff/conversation" mergeinto $.root "comments" $match.Comments}} {{end}} {{end}} {{if eq $line.GetCommentSide "proposed"}} {{template "repo/diff/conversation" mergeinto $.root "comments" $line.Comments}} {{end}} {{if gt (len $match.Comments) 0}} {{if eq $match.GetCommentSide "proposed"}} {{template "repo/diff/conversation" mergeinto $.root "comments" $match.Comments}} {{end}} {{end}} {{end}} {{else if gt (len $line.Comments) 0}} {{if gt (len $line.Comments) 0}} {{if eq $line.GetCommentSide "previous"}} {{template "repo/diff/conversation" mergeinto $.root "comments" $line.Comments}} {{end}} {{end}} {{if eq $line.GetCommentSide "proposed"}} {{template "repo/diff/conversation" mergeinto $.root "comments" $line.Comments}} {{end}} {{end}} {{end}} {{end}} {{end}}