diff options
author | wxiaoguang | 2023-03-03 22:43:30 +0800 |
---|---|---|
committer | GitHub | 2023-03-03 22:43:30 +0800 |
commit | 807e8e280c02b4e9082899c7e364731b44d09143 (patch) | |
tree | dae24cf8f54b8fa133111dd256256c021f8728e4 | |
parent | 2f49b55c193faf7a1ab59d91fc707f2010143483 (diff) |
Revert relative links to absolute links in mail templates (#23267)
Follow #21986 , fix regression.
The mail templates should always use `AppURL` (the full absolute URL)
-rw-r--r-- | templates/mail/issue/assigned.tmpl | 2 | ||||
-rw-r--r-- | templates/mail/issue/default.tmpl | 6 | ||||
-rw-r--r-- | templates/mail/release.tmpl | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/templates/mail/issue/assigned.tmpl b/templates/mail/issue/assigned.tmpl index 232a41b56..05bed6902 100644 --- a/templates/mail/issue/assigned.tmpl +++ b/templates/mail/issue/assigned.tmpl @@ -8,7 +8,7 @@ <title>{{.Subject}}</title> </head> -{{$repo_url := printf "<a href='%s'>%s</a>" (Escape .Issue.Repo.Link) (Escape .Issue.Repo.FullName)}} +{{$repo_url := printf "<a href='%s'>%s</a>" (Escape .Issue.Repo.HTMLURL) (Escape .Issue.Repo.FullName)}} {{$link := printf "<a href='%s'>#%d</a>" (Escape .Link) .Issue.Index}} <body> <p> diff --git a/templates/mail/issue/default.tmpl b/templates/mail/issue/default.tmpl index 3bda408a0..64dbb3df6 100644 --- a/templates/mail/issue/default.tmpl +++ b/templates/mail/issue/default.tmpl @@ -20,11 +20,11 @@ {{if eq .ActionName "push"}} <p> {{if .Comment.IsForcePush}} - {{$oldCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.Link .Comment.OldCommit}} + {{$oldCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.HTMLURL .Comment.OldCommit}} {{$oldShortSha := ShortSha .Comment.OldCommit}} {{$oldCommitLink := printf "<a href='%[1]s'><b>%[2]s</b></a>" (Escape $oldCommitUrl) (Escape $oldShortSha)}} - {{$newCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.Link .Comment.NewCommit}} + {{$newCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.HTMLURL .Comment.NewCommit}} {{$newShortSha := ShortSha .Comment.NewCommit}} {{$newCommitLink := printf "<a href='%[1]s'><b>%[2]s</b></a>" (Escape $newCommitUrl) (Escape $newShortSha)}} @@ -72,7 +72,7 @@ <ul> {{range .Comment.Commits}} <li> - <a href="{{$.Comment.Issue.PullRequest.BaseRepo.Link}}/commit/{{.ID}}"> + <a href="{{$.Comment.Issue.PullRequest.BaseRepo.HTMLURL}}/commit/{{.ID}}"> {{ShortSha .ID.String}} </a> - {{.Summary}} </li> diff --git a/templates/mail/release.tmpl b/templates/mail/release.tmpl index 425043352..b2acdce8b 100644 --- a/templates/mail/release.tmpl +++ b/templates/mail/release.tmpl @@ -11,8 +11,8 @@ </head> -{{$release_url := printf "<a href='%s'>%s</a>" (.Release.Link | Escape) (.Release.TagName | Escape)}} -{{$repo_url := printf "<a href='%s'>%s</a>" (.Release.Repo.Link | Escape) (.Release.Repo.FullName | Escape)}} +{{$release_url := printf "<a href='%s'>%s</a>" (.Release.HTMLURL | Escape) (.Release.TagName | Escape)}} +{{$repo_url := printf "<a href='%s'>%s</a>" (.Release.Repo.HTMLURL | Escape) (.Release.Repo.FullName | Escape)}} <body> <p> {{.locale.Tr "mail.release.new.text" .Release.Publisher.Name $release_url $repo_url | Str2html}} |