summaryrefslogtreecommitdiffstats
path: root/templates/mail/issue
diff options
context:
space:
mode:
Diffstat (limited to 'templates/mail/issue')
-rw-r--r--templates/mail/issue/assigned.tmpl28
-rw-r--r--templates/mail/issue/default.tmpl90
2 files changed, 118 insertions, 0 deletions
diff --git a/templates/mail/issue/assigned.tmpl b/templates/mail/issue/assigned.tmpl
new file mode 100644
index 0000000..f8ad62a
--- /dev/null
+++ b/templates/mail/issue/assigned.tmpl
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <style>
+ .footer { font-size:small; color:#666;}
+ </style>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+</head>
+
+{{$repo_url := HTMLFormat "<a href='%s'>%s</a>" .Issue.Repo.HTMLURL .Issue.Repo.FullName}}
+{{$link := HTMLFormat "<a href='%s'>#%d</a>" .Link .Issue.Index}}
+<body>
+ <p>
+ {{if .IsPull}}
+ {{.locale.Tr "mail.issue_assigned.pull" .Doer.Name $link $repo_url}}
+ {{else}}
+ {{.locale.Tr "mail.issue_assigned.issue" .Doer.Name $link $repo_url}}
+ {{end}}
+ </p>
+ <div class="footer">
+ <p>
+ ---
+ <br>
+ <a href="{{.Link}}">{{.locale.Tr "mail.view_it_on" AppName}}</a>.
+ </p>
+ </div>
+</body>
+</html>
diff --git a/templates/mail/issue/default.tmpl b/templates/mail/issue/default.tmpl
new file mode 100644
index 0000000..a94a10e
--- /dev/null
+++ b/templates/mail/issue/default.tmpl
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+
+ <style>
+ blockquote { padding-left: 1em; margin: 1em 0; border-left: 1px solid grey; color: #777}
+ .footer { font-size:small; color:#666;}
+ {{if .ReviewComments}}
+ .review { padding-left: 1em; margin: 1em 0; }
+ .review > pre { padding: 1em; border-left: 1px solid grey; }
+ {{end}}
+ </style>
+
+</head>
+
+<body>
+ {{if .IsMention}}<p>{{.locale.Tr "mail.issue.x_mentioned_you" .Doer.Name}}</p>{{end}}
+ {{if eq .ActionName "push"}}
+ <p>
+ {{if .Comment.IsForcePush}}
+ {{$oldCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.HTMLURL .Comment.OldCommit}}
+ {{$oldShortSha := ShortSha .Comment.OldCommit}}
+ {{$oldCommitLink := HTMLFormat "<a href='%[1]s'><b>%[2]s</b></a>" $oldCommitUrl $oldShortSha}}
+
+ {{$newCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.HTMLURL .Comment.NewCommit}}
+ {{$newShortSha := ShortSha .Comment.NewCommit}}
+ {{$newCommitLink := HTMLFormat "<a href='%[1]s'><b>%[2]s</b></a>" $newCommitUrl $newShortSha}}
+
+ {{.locale.Tr "mail.issue.action.force_push" .Doer.Name .Comment.Issue.PullRequest.HeadBranch $oldCommitLink $newCommitLink}}
+ {{else}}
+ {{.locale.TrN (len .Comment.Commits) "mail.issue.action.push_1" "mail.issue.action.push_n" .Doer.Name .Comment.Issue.PullRequest.HeadBranch (len .Comment.Commits)}}
+ {{end}}
+ </p>
+ {{end}}
+ <p>
+ {{if eq .ActionName "close"}}
+ {{.locale.Tr "mail.issue.action.close" .Doer.Name .Issue.Index}}
+ {{else if eq .ActionName "reopen"}}
+ {{.locale.Tr "mail.issue.action.reopen" .Doer.Name .Issue.Index}}
+ {{else if eq .ActionName "merge"}}
+ {{.locale.Tr "mail.issue.action.merge" .Doer.Name .Issue.Index .Issue.PullRequest.BaseBranch}}
+ {{else if eq .ActionName "approve"}}
+ {{.locale.Tr "mail.issue.action.approve" .Doer.Name}}
+ {{else if eq .ActionName "reject"}}
+ {{.locale.Tr "mail.issue.action.reject" .Doer.Name}}
+ {{else if eq .ActionName "review"}}
+ {{.locale.Tr "mail.issue.action.review" .Doer.Name}}
+ {{else if eq .ActionName "review_dismissed"}}
+ {{.locale.Tr "mail.issue.action.review_dismissed" .Doer.Name .Comment.Review.Reviewer.Name}}
+ {{else if eq .ActionName "ready_for_review"}}
+ {{.locale.Tr "mail.issue.action.ready_for_review" .Doer.Name}}
+ {{end}}
+
+ {{- if eq .Body ""}}
+ {{if eq .ActionName "new"}}
+ {{.locale.Tr "mail.issue.action.new" .Doer.Name .Issue.Index}}
+ {{end}}
+ {{else}}
+ {{.Body}}
+ {{end -}}
+ {{- range .ReviewComments}}
+ <hr>
+ {{$.locale.Tr "mail.issue.in_tree_path" .TreePath}}
+ <div class="review">
+ <pre>{{.Patch}}</pre>
+ <div>{{.RenderedContent}}</div>
+ </div>
+ {{end -}}
+ {{if eq .ActionName "push"}}
+ <ul>
+ {{range .Comment.Commits}}
+ <li>
+ <a href="{{$.Comment.Issue.PullRequest.BaseRepo.HTMLURL}}/commit/{{.ID}}">
+ {{ShortSha .ID.String}}
+ </a> - {{.Summary}}
+ </li>
+ {{end}}
+ </ul>
+ {{end}}
+ </p>
+ <div class="footer">
+ <p>
+ ---
+ <br>
+ <a href="{{.Link}}">{{.locale.Tr "mail.view_it_on" AppName}}</a>{{if .CanReply}} {{.locale.Tr "mail.reply"}}{{end}}.
+ </p>
+ </div>
+</body>
+</html>