fix(templates): cross-validate against official Gitea mail templates

- Fix INK theme: replace .ActiveCodeLives with correct field, remove from non-auth contexts (8 files)
- Fix hardcoded button text: use locale key mail.view_it_on in ember, heritage, ink, mono, terminal, terra (30+ files)
- Add missing {{if .CanReply}}mail.reply{{end}} block to all 10 themes default.tmpl
- Add missing mail.release.note locale label to all 10 themes release.tmpl
- Add missing mail.team_invite.text_3 to ink and terra team_invite.tmpl
- Add missing blockquote CSS to aurora, ink, mono, neon, terra default.tmpl

Verified: all 110 templates compile successfully with Go build-preview.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
KenanZhuandClaude Opus 4.8 committed 2026-06-03 20:18:40 +08:00
1 parent 493def1ab8
commit 86bb2538bb
48 files changed
+91 -85

No files matched your search

@@ -32,9 +32,9 @@
<tr><td class="resp-pad" style="padding:16px 32px 24px;color:#5c4030;">
<p style="margin:0 0 8px;font-size:15px;line-height:1.8;color:#6b5040;"><h2>{{.Repo.FullName}} - {{.Run.WorkflowID}}: {{.RunStatusText}}</h2><ul>{{range $job := .Jobs}}<li><a href="{{$job.HTMLURL}}">{{$job.Status}}: {{$job.Name}}{{if gt $job.Attempt 1}} (retry #{{$job.Attempt}}){{end}} - {{$job.Duration}}</a></li>{{end}}</ul></p>
<p style="margin:0 0 24px;font-size:14px;line-height:1.8;color:#8c7a6e;font-style:italic;"></p>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin:0 0 28px;"><tr><td>
<a href="{{.Run.HTMLURL}}" class="resp-btn" style="display:inline-block;padding:14px 38px;font-size:15px;font-weight:600;color:#fff;text-decoration:none;background:#c67b5c;border-radius:24px;letter-spacing:0.3px;">Activate Your Account</a>
<a href="{{.Run.HTMLURL}}" class="resp-btn" style="display:inline-block;padding:14px 38px;font-size:15px;font-weight:600;color:#fff;text-decoration:none;background:#c67b5c;border-radius:24px;letter-spacing:0.3px;">{{.locale.Tr "mail.view_it_on" AppName}}</a>
</td></tr></table>
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border:1px solid #d4c4a8;background:#f5ede0;border-radius:8px;"><tr><td style="padding:14px 16px;border-radius:8px;">
<p style="margin:0 0 6px;font-size:12px;color:#8c7a6e;font-style:italic;">{{.locale.Tr "mail.link_not_working_do_paste"}}</p>
+2 -2
View File
@@ -32,9 +32,9 @@
<tr><td class="resp-pad" style="padding:16px 32px 24px;color:#5c4030;">
<p style="margin:0 0 8px;font-size:15px;line-height:1.8;color:#6b5040;">{{.locale.Tr "mail.repo.collaborator.added.text"}} <code>{{.RepoName}}</code>.</p>
<p style="margin:0 0 24px;font-size:14px;line-height:1.8;color:#8c7a6e;font-style:italic;"></p>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin:0 0 28px;"><tr><td>
<a href="{{.Link}}" class="resp-btn" style="display:inline-block;padding:14px 38px;font-size:15px;font-weight:600;color:#fff;text-decoration:none;background:#c67b5c;border-radius:24px;letter-spacing:0.3px;">Activate Your Account</a>
<a href="{{.Link}}" class="resp-btn" style="display:inline-block;padding:14px 38px;font-size:15px;font-weight:600;color:#fff;text-decoration:none;background:#c67b5c;border-radius:24px;letter-spacing:0.3px;">{{.locale.Tr "mail.view_it_on" AppName}}</a>
</td></tr></table>
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border:1px solid #d4c4a8;background:#f5ede0;border-radius:8px;"><tr><td style="padding:14px 16px;border-radius:8px;">
<p style="margin:0 0 6px;font-size:12px;color:#8c7a6e;font-style:italic;">{{.locale.Tr "mail.link_not_working_do_paste"}}</p>
+2 -2
View File
@@ -32,9 +32,9 @@
<tr><td class="resp-pad" style="padding:16px 32px 24px;color:#5c4030;">
<p style="margin:0 0 8px;font-size:15px;line-height:1.8;color:#6b5040;">{{$repo_url := HTMLFormat "<a href=\047%s\047>%s</a>" .Issue.Repo.HTMLURL .Issue.Repo.FullName}}{{$link := HTMLFormat "<a href=\047%s\047>#%d</a>" .Link .Issue.Index}}{{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>
<p style="margin:0 0 24px;font-size:14px;line-height:1.8;color:#8c7a6e;font-style:italic;"></p>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin:0 0 28px;"><tr><td>
<a href="{{.Link}}" class="resp-btn" style="display:inline-block;padding:14px 38px;font-size:15px;font-weight:600;color:#fff;text-decoration:none;background:#c67b5c;border-radius:24px;letter-spacing:0.3px;">Activate Your Account</a>
<a href="{{.Link}}" class="resp-btn" style="display:inline-block;padding:14px 38px;font-size:15px;font-weight:600;color:#fff;text-decoration:none;background:#c67b5c;border-radius:24px;letter-spacing:0.3px;">{{.locale.Tr "mail.view_it_on" AppName}}</a>
</td></tr></table>
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border:1px solid #d4c4a8;background:#f5ede0;border-radius:8px;"><tr><td style="padding:14px 16px;border-radius:8px;">
<p style="margin:0 0 6px;font-size:12px;color:#8c7a6e;font-style:italic;">{{.locale.Tr "mail.link_not_working_do_paste"}}</p>
+2 -2
View File
@@ -32,9 +32,9 @@
<tr><td class="resp-pad" style="padding:16px 32px 24px;color:#5c4030;">
<p style="margin:0 0 8px;font-size:15px;line-height:1.8;color:#6b5040;">{{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=\047%[1]s\047>%[2]s</a>" $oldCommitUrl $oldShortSha}}{{$newCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.HTMLURL .Comment.NewCommit}}{{$newShortSha := ShortSha .Comment.NewCommit}}{{$newCommitLink := HTMLFormat "<a href=\047%[1]s\047>%[2]s</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 -}}</p>{{- range .ReviewComments}}<hr><p>{{$.locale.Tr "mail.issue.in_tree_path" .TreePath}}</p><pre>{{.Patch}}</pre><div>{{.RenderedContent}}</div>{{end -}}{{if eq .ActionName "push"}}<ul>{{range .Comment.Commits}}<li><a href="{{$.Comment.Issue.PullRequest.BaseRepo.HTMLURL}}/commit/{{.ID}}">{{ShortSha .ID.String}}</a> - {{.MessageTitle}}</li>{{end}}</ul>{{end}}</p>
<p style="margin:0 0 24px;font-size:14px;line-height:1.8;color:#8c7a6e;font-style:italic;"></p>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin:0 0 28px;"><tr><td>
<a href="{{.Link}}" class="resp-btn" style="display:inline-block;padding:14px 38px;font-size:15px;font-weight:600;color:#fff;text-decoration:none;background:#c67b5c;border-radius:24px;letter-spacing:0.3px;">Activate Your Account</a>
<a href="{{.Link}}" class="resp-btn" style="display:inline-block;padding:14px 38px;font-size:15px;font-weight:600;color:#fff;text-decoration:none;background:#c67b5c;border-radius:24px;letter-spacing:0.3px;">{{.locale.Tr "mail.view_it_on" AppName}}</a>{{if .CanReply}}&nbsp;{{.locale.Tr "mail.reply"}}{{end}}
</td></tr></table>
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border:1px solid #d4c4a8;background:#f5ede0;border-radius:8px;"><tr><td style="padding:14px 16px;border-radius:8px;">
<p style="margin:0 0 6px;font-size:12px;color:#8c7a6e;font-style:italic;">{{.locale.Tr "mail.link_not_working_do_paste"}}</p>
+2 -2
View File
@@ -32,11 +32,11 @@
<tr><td class="resp-pad" style="padding:16px 32px 24px;color:#5c4030;">
<p style="margin:0 0 8px;font-size:15px;line-height:1.8;color:#6b5040;">{{$release_url := HTMLFormat "<a href=\047%s\047>%s</a>" .Release.HTMLURL .Release.TagName}}{{$repo_url := HTMLFormat "<a href=\047%s\047>%s</a>" .Release.Repo.HTMLURL .Release.Repo.FullName}}{{.locale.Tr "mail.release.new.text" .Release.Publisher.Name $release_url $repo_url}}
<h4>{{.locale.Tr "mail.release.title" .Release.Title}}</h4>
{{if .Release.RenderedNote}}<div>{{.Release.RenderedNote}}</div>{{end}}
{{if .Release.RenderedNote}}{{.locale.Tr "mail.release.note"}}<br><div>{{.Release.RenderedNote}}</div>{{end}}
<p>{{.locale.Tr "mail.release.downloads"}}</p>
<ul>{{if not .DisableDownloadSourceArchives}}<li><a href="{{.Release.Repo.HTMLURL}}/archive/{{.Release.TagName | PathEscapeSegments}}.zip">{{.locale.Tr "mail.release.download.zip"}}</a></li><li><a href="{{.Release.Repo.HTMLURL}}/archive/{{.Release.TagName | PathEscapeSegments}}.tar.gz">{{.locale.Tr "mail.release.download.targz"}}</a></li>{{end}}{{if .Release.Attachments}}{{range .Release.Attachments}}<li><a href="{{.DownloadURL}}">{{.Name}} ({{.Size | FileSize}})</a></li>{{end}}{{end}}</ul></p>
<p style="margin:0 0 24px;font-size:14px;line-height:1.8;color:#8c7a6e;font-style:italic;"></p>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin:0 0 28px;"><tr><td>
<a href="{{.Link}}" class="resp-btn" style="display:inline-block;padding:14px 38px;font-size:15px;font-weight:600;color:#fff;text-decoration:none;background:#c67b5c;border-radius:24px;letter-spacing:0.3px;">{{.locale.Tr "mail.view_it_on" AppName}}</a>
</td></tr></table>
+2 -2
View File
@@ -32,9 +32,9 @@
<tr><td class="resp-pad" style="padding:16px 32px 24px;color:#5c4030;">
<p style="margin:0 0 8px;font-size:15px;line-height:1.8;color:#6b5040;">{{$url := HTMLFormat "<a href=\047%[1]s\047>%[2]s</a>" .Link .Repo}}{{.Subject}}. {{.locale.Tr "mail.repo.transfer.body" $url}}</p>
<p style="margin:0 0 24px;font-size:14px;line-height:1.8;color:#8c7a6e;font-style:italic;"></p>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin:0 0 28px;"><tr><td>
<a href="{{.Link}}" class="resp-btn" style="display:inline-block;padding:14px 38px;font-size:15px;font-weight:600;color:#fff;text-decoration:none;background:#c67b5c;border-radius:24px;letter-spacing:0.3px;">Activate Your Account</a>
<a href="{{.Link}}" class="resp-btn" style="display:inline-block;padding:14px 38px;font-size:15px;font-weight:600;color:#fff;text-decoration:none;background:#c67b5c;border-radius:24px;letter-spacing:0.3px;">{{.locale.Tr "mail.view_it_on" AppName}}</a>
</td></tr></table>
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border:1px solid #d4c4a8;background:#f5ede0;border-radius:8px;"><tr><td style="padding:14px 16px;border-radius:8px;">
<p style="margin:0 0 6px;font-size:12px;color:#8c7a6e;font-style:italic;">{{.locale.Tr "mail.link_not_working_do_paste"}}</p>