From bcb7f352215be12368de937fc0faa91cdb3d639a Mon Sep 17 00:00:00 2001 From: Jimmy Praet Date: Fri, 8 Jan 2021 22:49:55 +0100 Subject: Do not reload page after adding comments in Pull Request reviews (#13877) Fixed #8861 * use ajax on PR review page * handle review comments * extract duplicate code FetchCodeCommentsByLine was initially more or less copied from fetchCodeCommentsByReview. Now they both use a common findCodeComments function instead * use the Engine that was passed into the method Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao Co-authored-by: Lauris BH --- templates/repo/diff/section_unified.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'templates/repo/diff/section_unified.tmpl') diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl index 5376e77630..96e193df73 100644 --- a/templates/repo/diff/section_unified.tmpl +++ b/templates/repo/diff/section_unified.tmpl @@ -2,7 +2,7 @@ {{range $j, $section := $file.Sections}} {{range $k, $line := $section.Lines}} {{if or $.root.AfterCommitID (ne .GetType 4)}} - + {{if eq .GetType 4}} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} @@ -29,11 +29,11 @@ {{if eq .GetType 4}} {{$section.GetComputedInlineDiffFor $line}} {{else}} - {{if and $.root.SignedUserID $line.CanComment $.root.PageIsPullFiles}}{{svg "octicon-plus"}}{{end}}{{$section.GetComputedInlineDiffFor $line}} + {{if and $.root.SignedUserID $.root.PageIsPullFiles}}{{svg "octicon-plus"}}{{end}}{{$section.GetComputedInlineDiffFor $line}} {{end}} {{if gt (len $line.Comments) 0}} - + {{template "repo/diff/conversation" mergeinto $.root "comments" $line.Comments}} -- cgit v1.2.3