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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <div id="review-box">
  2. <button class="ui tiny green button gt-pr-2 gt-df js-btn-review {{if not $.IsShowingAllCommits}}disabled{{end}}" {{if not $.IsShowingAllCommits}}data-tooltip-content="{{$.locale.Tr "repo.pulls.review_only_possible_for_full_diff"}}"{{end}}>
  3. {{.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 gt-df gt-ac">
  14. <div class="gt-f1">{{$.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. "locale" $.locale
  20. "MarkdownPreviewUrl" (print .Repository.Link "/markup")
  21. "MarkdownPreviewContext" .RepoLink
  22. "TextareaName" "content"
  23. "TextareaPlaceholder" ($.locale.Tr "repo.diff.review.placeholder")
  24. "DropzoneParentContainer" "form"
  25. )}}
  26. </div>
  27. {{if .IsAttachmentEnabled}}
  28. <div class="field">
  29. {{template "repo/upload" .}}
  30. </div>
  31. {{end}}
  32. <div class="divider"></div>
  33. {{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}}
  34. {{if $showSelfTooltip}}
  35. <span class="gt-dib" data-tooltip-content="{{$.locale.Tr "repo.diff.review.self_approve"}}">
  36. <button type="submit" name="type" value="approve" disabled class="ui submit green tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button>
  37. </span>
  38. {{else}}
  39. <button type="submit" name="type" value="approve" class="ui submit green tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button>
  40. {{end}}
  41. <button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{$.locale.Tr "repo.diff.review.comment"}}</button>
  42. {{if $showSelfTooltip}}
  43. <span class="gt-dib" data-tooltip-content="{{$.locale.Tr "repo.diff.review.self_reject"}}">
  44. <button type="submit" name="type" value="reject" disabled class="ui submit red tiny button btn-submit">{{$.locale.Tr "repo.diff.review.reject"}}</button>
  45. </span>
  46. {{else}}
  47. <button type="submit" name="type" value="reject" class="ui submit red tiny button btn-submit">{{$.locale.Tr "repo.diff.review.reject"}}</button>
  48. {{end}}
  49. </form>
  50. </div>
  51. </div>
  52. {{end}}
  53. </div>