gitea源码

new_review.tmpl 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <div id="review-box" {{if $.Repository.IsArchived}}data-tooltip-content="{{ctx.Locale.Tr "repo.archive.pull.nocomment"}}"{{end}}>
  2. <button class="ui tiny primary button tw-pr-1 js-btn-review {{if not $.IsShowingAllCommits}}disabled{{end}}"
  3. {{if not $.IsShowingAllCommits}}data-tooltip-content="{{ctx.Locale.Tr "repo.pulls.review_only_possible_for_full_diff"}}"{{end}}
  4. {{if $.Repository.IsArchived}}disabled{{end}}
  5. >
  6. {{ctx.Locale.Tr "repo.diff.review"}}
  7. <span class="ui small label review-comments-counter" data-pending-comment-number="{{.PendingCodeCommentNumber}}">{{.PendingCodeCommentNumber}}</span>
  8. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  9. </button>
  10. </div>
  11. {{if $.IsShowingAllCommits}}
  12. <div class="review-box-panel tippy-target">
  13. <div class="ui segment">
  14. <form class="ui form form-fetch-action" action="{{.Link}}/reviews/submit" method="post">
  15. {{.CsrfTokenHtml}}
  16. <input type="hidden" name="commit_id" value="{{.AfterCommitID}}">
  17. <div class="field tw-flex tw-items-center">
  18. <div class="tw-flex-1">{{ctx.Locale.Tr "repo.diff.review.header"}}</div>
  19. <a class="muted close">{{svg "octicon-x" 16}}</a>
  20. </div>
  21. <div class="field">
  22. {{template "shared/combomarkdowneditor" (dict
  23. "MarkdownPreviewInRepo" $.Repository
  24. "MarkdownPreviewMode" "comment"
  25. "TextareaName" "content"
  26. "TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.review.placeholder")
  27. "DropzoneParentContainer" "form"
  28. )}}
  29. </div>
  30. {{if .IsAttachmentEnabled}}
  31. <div class="field">
  32. {{template "repo/upload" .}}
  33. </div>
  34. {{end}}
  35. <div class="divider"></div>
  36. {{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}}
  37. {{if not $.Issue.IsClosed}}
  38. {{if $showSelfTooltip}}
  39. <span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_approve"}}">
  40. <button type="submit" name="type" value="approve" disabled class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button>
  41. </span>
  42. {{else}}
  43. <button type="submit" name="type" value="approve" class="ui submit primary tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.approve"}}</button>
  44. {{end}}
  45. {{end}}
  46. <button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{ctx.Locale.Tr "repo.diff.review.comment"}}</button>
  47. {{if not $.Issue.IsClosed}}
  48. {{if $showSelfTooltip}}
  49. <span class="tw-inline-block" data-tooltip-content="{{ctx.Locale.Tr "repo.diff.review.self_reject"}}">
  50. <button type="submit" name="type" value="reject" disabled class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button>
  51. </span>
  52. {{else}}
  53. <button type="submit" name="type" value="reject" class="ui submit red tiny button btn-submit">{{ctx.Locale.Tr "repo.diff.review.reject"}}</button>
  54. {{end}}
  55. {{end}}
  56. </form>
  57. </div>
  58. </div>
  59. {{end}}