summaryrefslogtreecommitdiffstats
path: root/templates/mail/issue
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-02-07 02:09:18 +0800
committerGitHub <noreply@github.com>2023-02-06 12:09:18 -0600
commit769be877f2ce572b94b7c0a85853a2f7836075ac (patch)
tree05b203548fe61dbb6c95b5ffec2da6915a84df34 /templates/mail/issue
parent189d5b7045b2200fa55c20707a39138cfb8cf0ed (diff)
downloadgitea-769be877f2ce572b94b7c0a85853a2f7836075ac.tar.gz
gitea-769be877f2ce572b94b7c0a85853a2f7836075ac.zip
Use link in UI which returned a relative url but not html_url which contains an absolute url (#21986)
partially fix #19345 This PR add some `Link` methods for different objects. The `Link` methods are not different from `HTMLURL`, they are lack of the absolute URL. And most of UI `HTMLURL` have been replaced to `Link` so that users can visit them from a different domain or IP. This PR also introduces a new javascript configuration `window.config.reqAppUrl` which is different from `appUrl` which is still an absolute url but the domain has been replaced to the current requested domain.
Diffstat (limited to 'templates/mail/issue')
-rw-r--r--templates/mail/issue/assigned.tmpl2
-rw-r--r--templates/mail/issue/default.tmpl6
2 files changed, 4 insertions, 4 deletions
diff --git a/templates/mail/issue/assigned.tmpl b/templates/mail/issue/assigned.tmpl
index 05bed69022..232a41b56f 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.HTMLURL) (Escape .Issue.Repo.FullName)}}
+{{$repo_url := printf "<a href='%s'>%s</a>" (Escape .Issue.Repo.Link) (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 64dbb3df68..3bda408a05 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.HTMLURL .Comment.OldCommit}}
+ {{$oldCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.Link .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.HTMLURL .Comment.NewCommit}}
+ {{$newCommitUrl := printf "%s/commit/%s" .Comment.Issue.PullRequest.BaseRepo.Link .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.HTMLURL}}/commit/{{.ID}}">
+ <a href="{{$.Comment.Issue.PullRequest.BaseRepo.Link}}/commit/{{.ID}}">
{{ShortSha .ID.String}}
</a> - {{.Summary}}
</li>