gitea源码

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