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.

63 lines
2.1 KiB

  1. <div class="comment merge box">
  2. <a class="avatar text
  3. {{if .Issue.PullRequest.HasMerged}}purple
  4. {{else if .Issue.IsClosed}}grey
  5. {{else if .IsPullReuqestBroken}}red
  6. {{else if .Issue.PullRequest.IsChecking}}yellow
  7. {{else if .Issue.PullRequest.CanAutoMerge}}green
  8. {{else}}red{{end}}"><span class="mega-octicon octicon-git-merge"></span></a>
  9. <div class="content">
  10. <div class="ui merge segment">
  11. {{if .Issue.PullRequest.HasMerged}}
  12. <div class="item text purple">
  13. {{$.i18n.Tr "repo.pulls.has_merged"}}
  14. </div>
  15. {{if .IsPullBranchDeletable}}
  16. <div class="ui divider"></div>
  17. <div>
  18. <a class="delete-button ui red button" href="" data-url="{{.DeleteBranchLink}}">{{$.i18n.Tr "repo.branch.delete" .HeadTarget}}</a>
  19. </div>
  20. {{end}}
  21. {{else if .Issue.IsClosed}}
  22. <div class="item text grey">
  23. {{$.i18n.Tr "repo.pulls.reopen_to_merge"}}
  24. </div>
  25. {{else if .IsPullReuqestBroken}}
  26. <div class="item text red">
  27. <span class="octicon octicon-x"></span>
  28. {{$.i18n.Tr "repo.pulls.data_broken"}}
  29. </div>
  30. {{else if .Issue.PullRequest.IsChecking}}
  31. <div class="item text yellow">
  32. <span class="octicon octicon-sync"></span>
  33. {{$.i18n.Tr "repo.pulls.is_checking"}}
  34. </div>
  35. {{else if .Issue.PullRequest.CanAutoMerge}}
  36. <div class="item text green">
  37. <span class="octicon octicon-check"></span>
  38. {{$.i18n.Tr "repo.pulls.can_auto_merge_desc"}}
  39. </div>
  40. {{if .IsRepositoryWriter}}
  41. <div class="ui divider"></div>
  42. <div>
  43. <form class="ui form" action="{{.Link}}/merge" method="post">
  44. {{.CsrfTokenHtml}}
  45. <button class="ui green button">
  46. <span class="octicon octicon-git-merge"></span> {{$.i18n.Tr "repo.pulls.merge_pull_request"}}
  47. </button>
  48. </form>
  49. </div>
  50. {{end}}
  51. {{else}}
  52. <div class="item text red">
  53. <span class="octicon octicon-x"></span>
  54. {{$.i18n.Tr "repo.pulls.cannot_auto_merge_desc"}}
  55. </div>
  56. <div class="item text grey">
  57. <span class="octicon octicon-info"></span>
  58. {{$.i18n.Tr "repo.pulls.cannot_auto_merge_helper"}}
  59. </div>
  60. {{end}}
  61. </div>
  62. </div>
  63. </div>