You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

conversation.tmpl 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. {{$resolved := (index .comments 0).IsResolved}}
  2. {{$invalid := (index .comments 0).Invalidated}}
  3. {{$resolveDoer := (index .comments 0).ResolveDoer}}
  4. {{$isNotPending := (not (eq (index .comments 0).Review.Type 0))}}
  5. {{$referenceUrl := printf "%s#%s" $.Issue.Link (index .comments 0).HashTag}}
  6. <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}}">
  7. {{if $resolved}}
  8. <div class="ui attached header resolved-placeholder gt-df gt-ac gt-sb">
  9. <div class="ui grey text gt-df gt-ac gt-fw gt-gap-2">
  10. {{svg "octicon-check" 16 "icon gt-mr-2"}}
  11. <b>{{$resolveDoer.Name}}</b> {{$.locale.Tr "repo.issues.review.resolved_by"}}
  12. {{if $invalid}}
  13. <!--
  14. We only handle the case $resolved=true and $invalid=true in this template because if the comment is not resolved it has the outdated label in the comments area (not the header above).
  15. The case $resolved=false and $invalid=true is handled in repo/diff/comments.tmpl
  16. -->
  17. <a href="{{AppSubUrl}}{{$referenceUrl}}" class="ui label basic small gt-ml-3" data-tooltip-content="{{$.locale.Tr "repo.issues.review.outdated_description"}}">
  18. {{$.locale.Tr "repo.issues.review.outdated"}}
  19. </a>
  20. {{end}}
  21. </div>
  22. <div class="gt-df gt-ac gt-gap-3">
  23. <button id="show-outdated-{{(index .comments 0).ID}}" data-comment="{{(index .comments 0).ID}}" class="ui tiny labeled button show-outdated gt-df gt-ac">
  24. {{svg "octicon-unfold" 16 "gt-mr-3"}}
  25. {{$.locale.Tr "repo.issues.review.show_resolved"}}
  26. </button>
  27. <button id="hide-outdated-{{(index .comments 0).ID}}" data-comment="{{(index .comments 0).ID}}" class="ui tiny labeled button hide-outdated gt-df gt-ac gt-hidden">
  28. {{svg "octicon-fold" 16 "gt-mr-3"}}
  29. {{$.locale.Tr "repo.issues.review.hide_resolved"}}
  30. </button>
  31. </div>
  32. </div>
  33. {{end}}
  34. <div id="code-comments-{{(index .comments 0).ID}}" class="field comment-code-cloud {{if $resolved}}gt-hidden{{end}}">
  35. <div class="comment-list">
  36. <ui class="ui comments">
  37. {{template "repo/diff/comments" dict "root" $ "comments" .comments}}
  38. </ui>
  39. </div>
  40. <div class="gt-df gt-je gt-js-small gt-ac gt-fw gt-mt-3">
  41. <div class="ui buttons gt-mr-2">
  42. <button class="ui icon tiny basic button previous-conversation">
  43. {{svg "octicon-arrow-up" 12 "icon"}} {{$.locale.Tr "repo.issues.previous"}}
  44. </button>
  45. <button class="ui icon tiny basic button next-conversation">
  46. {{svg "octicon-arrow-down" 12 "icon"}} {{$.locale.Tr "repo.issues.next"}}
  47. </button>
  48. </div>
  49. {{if and $.CanMarkConversation $isNotPending}}
  50. <button class="ui icon tiny basic 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">
  51. {{if $resolved}}
  52. {{$.locale.Tr "repo.issues.review.un_resolve_conversation"}}
  53. {{else}}
  54. {{$.locale.Tr "repo.issues.review.resolve_conversation"}}
  55. {{end}}
  56. </button>
  57. {{end}}
  58. {{if and $.SignedUserID (not $.Repository.IsArchived)}}
  59. <button class="comment-form-reply ui green tiny labeled icon button gt-ml-2 gt-mr-0">
  60. {{svg "octicon-reply" 16 "reply icon gt-mr-2"}}{{$.locale.Tr "repo.diff.comment.reply"}}
  61. </button>
  62. {{end}}
  63. </div>
  64. {{template "repo/diff/comment_form_datahandler" dict "hidden" true "reply" (index .comments 0).ReviewID "root" $ "comment" (index .comments 0)}}
  65. </div>
  66. </div>