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.

new_review.tmpl 2.7KB

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