diff options
author | Jimmy Praet <jimmy.praet@telenet.be> | 2021-01-08 22:49:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-08 23:49:55 +0200 |
commit | bcb7f352215be12368de937fc0faa91cdb3d639a (patch) | |
tree | fa981e5c0110df8a094d7f3e3ba0ffdf2469c194 /templates/repo/diff/conversation.tmpl | |
parent | ce43d38b4ffa40255cc8f859c5b31f59351f827c (diff) | |
download | gitea-bcb7f352215be12368de937fc0faa91cdb3d639a.tar.gz gitea-bcb7f352215be12368de937fc0faa91cdb3d639a.zip |
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 <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'templates/repo/diff/conversation.tmpl')
-rw-r--r-- | templates/repo/diff/conversation.tmpl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/templates/repo/diff/conversation.tmpl b/templates/repo/diff/conversation.tmpl index 98898eee60..4dd7de0fc1 100644 --- a/templates/repo/diff/conversation.tmpl +++ b/templates/repo/diff/conversation.tmpl @@ -1,7 +1,7 @@ {{$resolved := (index .comments 0).IsResolved}} {{$resolveDoer := (index .comments 0).ResolveDoer}} {{$isNotPending := (not (eq (index .comments 0).Review.Type 0))}} -<div class="conversation-holder"> +<div class="conversation-holder" data-path="{{(index .comments 0).TreePath}}" data-side="{{if lt (index .comments 0).Line 0}}left{{else}}right{{end}}" data-idx="{{(index .comments 0).UnsignedLine}}"> {{if $resolved}} <div class="ui attached header resolved-placeholder"> <span class="ui grey text left"><b>{{$resolveDoer.Name}}</b> {{$.i18n.Tr "repo.issues.review.resolved_by"}}</span> @@ -23,7 +23,7 @@ </div> {{template "repo/diff/comment_form_datahandler" dict "hidden" true "reply" (index .comments 0).ReviewID "root" $ "comment" (index .comments 0)}} {{if and $.CanMarkConversation $isNotPending}} - <button class="ui icon tiny button resolve-conversation" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index .comments 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation" > + <button class="ui icon tiny button resolve-conversation" data-origin="diff" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index .comments 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation" > {{if $resolved}} {{$.i18n.Tr "repo.issues.review.un_resolve_conversation"}} {{else}} |