Skip to content

Commit e7f41a4

Browse files
wxiaoguangGiteaBot
authored andcommitted
Revert relative links to absolute links in mail templates (go-gitea#23267)
Follow go-gitea#21986 , fix regression. The mail templates should always use `AppURL` (the full absolute URL)
1 parent ef8209a commit e7f41a4

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

templates/mail/issue/assigned.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<title>{{.Subject}}</title>
99
</head>
1010

11-
{{$repo_url := printf "<a href='%s'>%s</a>" (Escape .Issue.Repo.Link) (Escape .Issue.Repo.FullName)}}
11+
{{$repo_url := printf "<a href='%s'>%s</a>" (Escape .Issue.Repo.HTMLURL) (Escape .Issue.Repo.FullName)}}
1212
{{$link := printf "<a href='%s'>#%d</a>" (Escape .Link) .Issue.Index}}
1313
<body>
1414
<p>

templates/mail/issue/default.tmpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
{{if eq .ActionName "push"}}
2121
<p>
2222
{{if .Comment.IsForcePush}}
23-
{{$oldCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.Link .Comment.OldCommit}}
23+
{{$oldCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.HTMLURL .Comment.OldCommit}}
2424
{{$oldShortSha := ShortSha .Comment.OldCommit}}
2525
{{$oldCommitLink := printf "<a href='%[1]s'><b>%[2]s</b></a>" (Escape $oldCommitUrl) (Escape $oldShortSha)}}
2626

27-
{{$newCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.Link .Comment.NewCommit}}
27+
{{$newCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.HTMLURL .Comment.NewCommit}}
2828
{{$newShortSha := ShortSha .Comment.NewCommit}}
2929
{{$newCommitLink := printf "<a href='%[1]s'><b>%[2]s</b></a>" (Escape $newCommitUrl) (Escape $newShortSha)}}
3030

@@ -72,7 +72,7 @@
7272
<ul>
7373
{{range .Comment.Commits}}
7474
<li>
75-
<a href="{{$.Comment.Issue.PullRequest.BaseRepo.Link}}/commit/{{.ID}}">
75+
<a href="{{$.Comment.Issue.PullRequest.BaseRepo.HTMLURL}}/commit/{{.ID}}">
7676
{{ShortSha .ID.String}}
7777
</a> - {{.Summary}}
7878
</li>

templates/mail/release.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
</head>
1313

14-
{{$release_url := printf "<a href='%s'>%s</a>" (.Release.Link | Escape) (.Release.TagName | Escape)}}
15-
{{$repo_url := printf "<a href='%s'>%s</a>" (.Release.Repo.Link | Escape) (.Release.Repo.FullName | Escape)}}
14+
{{$release_url := printf "<a href='%s'>%s</a>" (.Release.HTMLURL | Escape) (.Release.TagName | Escape)}}
15+
{{$repo_url := printf "<a href='%s'>%s</a>" (.Release.Repo.HTMLURL | Escape) (.Release.Repo.FullName | Escape)}}
1616
<body>
1717
<p>
1818
{{.locale.Tr "mail.release.new.text" .Release.Publisher.Name $release_url $repo_url | Str2html}}

0 commit comments

Comments
 (0)