Gitea 1.27.1 fixed the mail template for push events (#38467) — commit data must now be accessed via .UserCommit.GitCommit instead of directly on the commit object. Changed across all 10 themes: - {{.ID}} → {{.UserCommit.GitCommit.ID}} - {{.ID.String}} → {{.UserCommit.GitCommit.ID.String}} - {{.MessageTitle}} → {{.UserCommit.GitCommit.MessageTitle}} Verification: - 3 mail-related files changed in Gitea v1.27.0→v1.27.1 - All 110 templates (10 themes × 11 types) render successfully - No breaking changes — data structure unchanged, only access path Co-Authored-By: Claude <noreply@anthropic.com>
221 lines
10 KiB
Cheetah
221 lines
10 KiB
Cheetah
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<meta name="x-apple-disable-message-reformatting" />
|
|
|
|
<title>
|
|
{{.Subject}}
|
|
</title>
|
|
|
|
<style type="text/css">
|
|
/* Base */
|
|
body,.ExternalClass,.ReadMsgBody { background-color:#ede4d4 }
|
|
.email-wrap { max-width:600px;margin:20px auto;font-family:Georgia,'Times New Roman',serif;background:#fefdfb;border:1px solid #c4a97d }
|
|
|
|
/* Header */
|
|
.email-logo { display:inline-block;vertical-align:middle;margin-right:8px;border:0;outline:none }
|
|
.email-brand { font-size:18px;font-weight:700;color:#1a1a2e;font-variant:small-caps;letter-spacing:2px }
|
|
.email-header { padding:24px 28px 16px;border-bottom:3px double #1a1a2e }
|
|
|
|
/* Card */
|
|
.email-card { padding:24px 24px 16px 28px;vertical-align:top;color:#333 }
|
|
.email-sidebar { padding:24px 28px 16px 0;vertical-align:top;border-left:1px solid #ddd }
|
|
.email-heading { margin:0 0 16px;font-size:15px;color:#333;line-height:1.7 }
|
|
.email-text { margin:0 0 12px;font-size:13px;line-height:1.8;color:#444 }
|
|
.email-subtext { margin:0 0 20px;font-size:12px;line-height:1.8;color:#666;font-style:italic }
|
|
|
|
/* Drop-cap */
|
|
.email-dropcap { float:left;font-size:42px;line-height:1;font-weight:700;color:#1a1a2e;padding-right:8px;padding-top:2px;font-family:Georgia,serif }
|
|
|
|
/* Divider */
|
|
.email-divider { height:1px;background:#ddd;margin:0 }
|
|
|
|
/* Button */
|
|
.email-btn-row { padding:0;text-align:left }
|
|
.email-btn { display:inline-block;padding:10px 24px;font-size:13px;font-weight:700;color:#fefdfb!important;text-decoration:none;background:#1a1a2e;border:1px solid #c4a97d;font-variant:small-caps;letter-spacing:1px }
|
|
.email-btn-table { margin:0 0 24px }
|
|
|
|
/* Fallback link */
|
|
.email-link-box { border:1px solid #c4a97d;background:#fefdfb }
|
|
.email-link-label { margin:0 0 4px;font-size:10px;color:#888;font-style:italic }
|
|
.email-link-url { margin:0;font-size:10px;font-family:monospace;color:#1a1a2e;background:#f5f0e8;padding:8px 10px;border:1px solid #ddd;word-break:break-all }
|
|
|
|
/* Footer */
|
|
.email-footer { padding:16px 28px;border-top:1px solid #ccc;text-align:center }
|
|
.email-footer-text { margin:0;font-size:11px;color:#888;font-style:italic }
|
|
.email-footer-link { color:#1a1a2e;text-decoration:none;font-weight:600;border-bottom:1px dotted #c4a97d }
|
|
|
|
/* Content */
|
|
.ink-content,.ink-content * { color:#444!important }
|
|
.ink-content a,.ink-content a:link,.ink-content a:visited { color:#1a1a2e!important;text-decoration:underline!important }
|
|
.ink-content blockquote { border-left:1px solid #c4a97d!important;color:#777!important }
|
|
.ink-content code,.ink-content pre { color:#1a1a2e!important;background:#f5f0e8!important;border-color:#ddd!important }
|
|
.ink-content hr { border-color:#ddd!important }
|
|
.ink-content img { border:0;max-width:100%!important }
|
|
|
|
/* Typography utilities */
|
|
.card-body a:not(.email-btn),.card-body a:not(.email-btn):link,.card-body a:not(.email-btn):visited { color:#1a1a2e!important;text-decoration:underline!important }
|
|
.card-body blockquote { padding-left:1em;margin:1em 0;border-left:1px solid #c4a97d;color:#777 }
|
|
.card-body hr { border:none;border-top:1px solid #ddd;margin:16px 0 }
|
|
|
|
/* Responsive */
|
|
@media only screen and (max-width:480px) {
|
|
/* Stack layout — convert table rows to blocks */
|
|
.email-wrap,.email-wrap tbody,.email-wrap tr{ display:block!important;width:100%!important }
|
|
.email-wrap td{ box-sizing:border-box!important }
|
|
.email-header { padding-left:16px!important;padding-right:16px!important }
|
|
.email-card { width:100%!important;display:block!important;border-left:none!important;padding:0 16px 16px!important }
|
|
.email-sidebar { width:100%!important;display:block!important;padding:0 16px 16px!important;border-left:none!important;border-top:1px solid #ddd!important }
|
|
.email-btn { display:block!important;width:auto!important;text-align:center!important }
|
|
.email-footer { padding-left:16px!important;padding-right:16px!important }
|
|
/* Prevent content overflow */
|
|
.email-wrap,.email-wrap td,.email-wrap th{ word-break:break-word!important;overflow-wrap:break-word!important }
|
|
img{ max-width:100%!important;height:auto!important }
|
|
pre,code{ white-space:pre-wrap!important;word-break:break-all!important }
|
|
table{ max-width:100%!important }
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body style="margin:0;padding:0;background:#ede4d4;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;">
|
|
<center style="width:100%;">
|
|
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="email-wrap">
|
|
|
|
<!-- Floating Title -->
|
|
<tr>
|
|
<td colspan="2" class="email-header">
|
|
|
|
<img src="{{AppUrl}}assets/img/favicon.png" alt="logo" width="24" height="24" class="email-logo" />
|
|
<span class="email-brand">{{AppName}}</span>
|
|
<br />
|
|
<span style="font-size:11px;color:#888;font-style:italic;">Git with a cup of tea</span>
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
<!-- Card -->
|
|
<tr>
|
|
<!-- left column -->
|
|
<td width="64%" class="email-card card-body">
|
|
|
|
<p class="email-heading">
|
|
<span class="email-dropcap">D</span>
|
|
</p>
|
|
|
|
<p class="email-text">
|
|
{{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}}
|
|
<span class="ink-content">{{.Body}}</span>
|
|
{{end -}}
|
|
</p>
|
|
|
|
{{- range .ReviewComments}}
|
|
<hr>
|
|
<p>{{$.locale.Tr "mail.issue.in_tree_path" .TreePath}}</p>
|
|
<pre>{{.Patch}}</pre>
|
|
<div class="ink-content">{{.RenderedContent}}</div>
|
|
{{end -}}
|
|
|
|
{{if eq .ActionName "push"}}
|
|
<ul>
|
|
{{range .Comment.Commits}}
|
|
<li>
|
|
<a href="{{$.Comment.Issue.PullRequest.BaseRepo.HTMLURL}}/commit/{{.UserCommit.GitCommit.ID}}">{{ShortSha .UserCommit.GitCommit.ID.String}}</a> - {{.UserCommit.GitCommit.MessageTitle}}
|
|
</li>
|
|
{{end}}
|
|
</ul>
|
|
{{end}}
|
|
</p>
|
|
|
|
<p class="email-subtext"></p>
|
|
|
|
<table border="0" cellpadding="0" cellspacing="0" class="email-btn-table">
|
|
<tr>
|
|
<td>
|
|
<a href="{{.Link}}" class="email-btn">{{.locale.Tr "mail.view_it_on" AppName}} »{{if .CanReply}} {{.locale.Tr "mail.reply"}}{{end}}</a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="email-link-box">
|
|
<tr>
|
|
<td style="padding:12px 14px;">
|
|
<p class="email-link-label">{{.locale.Tr "mail.link_not_working_do_paste"}}</p>
|
|
<p class="email-link-url">{{.Link}}</p>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</td>
|
|
<!-- right column / sidebar -->
|
|
<td width="36%" class="email-sidebar">
|
|
|
|
<p style="margin:0 0 10px;font-size:10px;color:#888;text-transform:uppercase;letter-spacing:1px;font-family:system-ui,sans-serif;font-weight:700;">Quick Info</p>
|
|
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-top:1px solid #ddd;border-bottom:1px solid #ddd;">
|
|
<tr>
|
|
<td style="padding:8px 0;font-size:11px;color:#555;font-family:system-ui,sans-serif;">From<br /><strong style="color:#1a1a2e;">{{AppName}}</strong></td>
|
|
</tr>
|
|
</table>
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
<!-- Footer -->
|
|
<tr>
|
|
<td colspan="2" class="email-footer">
|
|
|
|
<p class="email-footer-text">
|
|
©
|
|
<a href="{{AppUrl}}" class="email-footer-link">{{AppName}}</a>
|
|
</p>
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
</center>
|
|
</body>
|
|
</html> |