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.

default.tmpl 3.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>{{.Subject}}</title>
  6. <style>
  7. blockquote { padding-left: 1em; margin: 1em 0; border-left: 1px solid grey; color: #777}
  8. .footer { font-size:small; color:#666;}
  9. {{if .ReviewComments}}
  10. .review { padding-left: 1em; margin: 1em 0; }
  11. .review > pre { padding: 1em; border-left: 1px solid grey; }
  12. {{end}}
  13. </style>
  14. </head>
  15. <body>
  16. {{if .IsMention}}<p>{{.locale.Tr "mail.issue.x_mentioned_you" .Doer.Name}}</p>{{end}}
  17. {{if eq .ActionName "push"}}
  18. <p>
  19. {{if .Comment.IsForcePush}}
  20. {{$oldCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.HTMLURL .Comment.OldCommit}}
  21. {{$oldShortSha := ShortSha .Comment.OldCommit}}
  22. {{$oldCommitLink := HTMLFormat "<a href='%[1]s'><b>%[2]s</b></a>" $oldCommitUrl $oldShortSha}}
  23. {{$newCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.HTMLURL .Comment.NewCommit}}
  24. {{$newShortSha := ShortSha .Comment.NewCommit}}
  25. {{$newCommitLink := HTMLFormat "<a href='%[1]s'><b>%[2]s</b></a>" $newCommitUrl $newShortSha}}
  26. {{.locale.Tr "mail.issue.action.force_push" .Doer.Name .Comment.Issue.PullRequest.HeadBranch $oldCommitLink $newCommitLink}}
  27. {{else}}
  28. {{.locale.TrN (len .Comment.Commits) "mail.issue.action.push_1" "mail.issue.action.push_n" .Doer.Name .Comment.Issue.PullRequest.HeadBranch (len .Comment.Commits)}}
  29. {{end}}
  30. </p>
  31. {{end}}
  32. <p>
  33. {{if eq .ActionName "close"}}
  34. {{.locale.Tr "mail.issue.action.close" .Doer.Name .Issue.Index}}
  35. {{else if eq .ActionName "reopen"}}
  36. {{.locale.Tr "mail.issue.action.reopen" .Doer.Name .Issue.Index}}
  37. {{else if eq .ActionName "merge"}}
  38. {{.locale.Tr "mail.issue.action.merge" .Doer.Name .Issue.Index .Issue.PullRequest.BaseBranch}}
  39. {{else if eq .ActionName "approve"}}
  40. {{.locale.Tr "mail.issue.action.approve" .Doer.Name}}
  41. {{else if eq .ActionName "reject"}}
  42. {{.locale.Tr "mail.issue.action.reject" .Doer.Name}}
  43. {{else if eq .ActionName "review"}}
  44. {{.locale.Tr "mail.issue.action.review" .Doer.Name}}
  45. {{else if eq .ActionName "review_dismissed"}}
  46. {{.locale.Tr "mail.issue.action.review_dismissed" .Doer.Name .Comment.Review.Reviewer.Name}}
  47. {{else if eq .ActionName "ready_for_review"}}
  48. {{.locale.Tr "mail.issue.action.ready_for_review" .Doer.Name}}
  49. {{end}}
  50. {{- if eq .Body ""}}
  51. {{if eq .ActionName "new"}}
  52. {{.locale.Tr "mail.issue.action.new" .Doer.Name .Issue.Index}}
  53. {{end}}
  54. {{else}}
  55. {{.Body}}
  56. {{end -}}
  57. {{- range .ReviewComments}}
  58. <hr>
  59. {{ctx.Locale.Tr "mail.issue.in_tree_path" .TreePath}}
  60. <div class="review">
  61. <pre>{{.Patch}}</pre>
  62. <div>{{.RenderedContent}}</div>
  63. </div>
  64. {{end -}}
  65. {{if eq .ActionName "push"}}
  66. <ul>
  67. {{range .Comment.Commits}}
  68. <li>
  69. <a href="{{$.Comment.Issue.PullRequest.BaseRepo.HTMLURL}}/commit/{{.ID}}">
  70. {{ShortSha .ID.String}}
  71. </a> - {{.Summary}}
  72. </li>
  73. {{end}}
  74. </ul>
  75. {{end}}
  76. </p>
  77. <div class="footer">
  78. <p>
  79. ---
  80. <br>
  81. <a href="{{.Link}}">{{.locale.Tr "mail.view_it_on" AppName}}</a>{{if .CanReply}} {{.locale.Tr "mail.reply"}}{{end}}.
  82. </p>
  83. </div>
  84. </body>
  85. </html>