diff options
author | 赵智超 <1012112796@qq.com> | 2020-04-18 21:50:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-18 10:50:25 -0300 |
commit | 1b86f174ce99b579df35c32e800551b1fd1df807 (patch) | |
tree | e057206a13cea7a0e2eb0219bb66d8d83a8781c9 /templates/repo/diff/section_unified.tmpl | |
parent | 38d5f88a8183147cc5ecc6ece58fc28836a4af8b (diff) | |
download | gitea-1b86f174ce99b579df35c32e800551b1fd1df807.tar.gz gitea-1b86f174ce99b579df35c32e800551b1fd1df807.zip |
Add a way to mark Conversation (code comment) resolved (#11037)
* Add a way to mark Conversation (code comment) resolved
mark Conversation is a way to mark a Conversation is stale
or be solved. when it's marked as stale, will be hided like
stale. all Pull Request writer , Offical Reviewers and poster
can add or remove Conversation resolved mark.
Signed-off-by: a1012112796 <1012112796@qq.com>
* fix lint
* Apply suggestions from code review
* Add ResolveDoer
* fix ui
Co-Authored-By: Lauris BH <lauris@nix.lv>
Co-Authored-By: 6543 <6543@obermui.de>
* change IsResolved to an function
Add permission check in UpdateResolveConversation
* Apply suggestions from code review
* change return error for permisson check
* add default message for deleted user
* get issue message from comment
* add migration for ``ResolveDoerID`` column
another change:
* block mark pending review as resolved because it's not necessary
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* change button color
* resolve button size
* fix code style
* remove unusefull code
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Diffstat (limited to 'templates/repo/diff/section_unified.tmpl')
-rw-r--r-- | templates/repo/diff/section_unified.tmpl | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl index c25d3ef079..4c23c159a2 100644 --- a/templates/repo/diff/section_unified.tmpl +++ b/templates/repo/diff/section_unified.tmpl @@ -23,17 +23,42 @@ <td class="lines-code{{if (not $line.RightIdx)}} lines-code-old{{end}}">{{if and $.root.SignedUserID $line.CanComment $.root.PageIsPullFiles}}<a class="ui green button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}" data-path="{{$file.Name}}" data-side="{{if $line.RightIdx}}right{{else}}left{{end}}" data-idx="{{if $line.RightIdx}}{{$line.RightIdx}}{{else}}{{$line.LeftIdx}}{{end}}">+</a>{{end}}<span class="mono wrap{{if $highlightClass}} language-{{$highlightClass}}{{else}} nohighlight{{end}}">{{$section.GetComputedInlineDiffFor $line}}</span></td> </tr> {{if gt (len $line.Comments) 0}} + {{$resolved := (index $line.Comments 0).IsResolved}} + {{$resolveDoer := (index $line.Comments 0).ResolveDoer}} + {{$isNotPending := (not (eq (index $line.Comments 0).Review.Type 0))}} <tr> <td colspan="2" class="lines-num"></td> <td class="lines-type-marker"></td> <td class="add-comment-left add-comment-right"> - <div class="field comment-code-cloud"> + {{if $resolved}} + <div class = "ui attached header"> + <span class="ui grey text left"><b>{{$resolveDoer.Name}}</b> {{$.root.i18n.Tr "repo.issues.review.resolved_by"}}</span> + <button id="show-outdated-{{(index $line.Comments 0).ID}}" data-comment="{{(index $line.Comments 0).ID}}" class="ui compact right labeled button show-outdated"> + {{svg "octicon-unfold" 16}} + {{$.root.i18n.Tr "repo.issues.review.show_resolved"}} + </button> + <button id="hide-outdated-{{(index $line.Comments 0).ID}}" data-comment="{{(index $line.Comments 0).ID}}" class="hide ui compact right labeled button hide-outdated"> + {{svg "octicon-fold" 16}} + {{$.root.i18n.Tr "repo.issues.review.hide_resolved"}} + </button> + </div> + {{end}} + <div id="code-comments-{{(index $line.Comments 0).ID}}" class="field comment-code-cloud {{if $resolved}}hide{{end}}"> <div class="comment-list"> <ui class="ui comments"> {{ template "repo/diff/comments" dict "root" $.root "comments" $line.Comments}} </ui> </div> {{template "repo/diff/comment_form_datahandler" dict "hidden" true "reply" (index $line.Comments 0).ReviewID "root" $.root "comment" (index $line.Comments 0)}} + {{if and $.root.CanMarkConversation $isNotPending}} + <button class="ui icon tiny button resolve-conversation" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index $line.Comments 0).ID}}" data-update-url="{{$.root.RepoLink}}/issues/resolve_conversation" > + {{if $resolved}} + {{$.root.i18n.Tr "repo.issues.review.un_resolve_conversation"}} + {{else}} + {{$.root.i18n.Tr "repo.issues.review.resolve_conversation"}} + {{end}} + </button> + {{end}} </div> </td> </tr> |