diff options
author | sebastian-sauer <sauer.sebastian@gmail.com> | 2021-06-22 22:13:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-22 21:13:31 +0100 |
commit | 66f8da538a8b1bd63ea1a0f97202ee0d46c15c4f (patch) | |
tree | 7b4adfa29bc789695a92e8e54578808da59e593f /templates | |
parent | d55b5eb0d3f1d129eb4d03cc7ddb56a59b4db8ff (diff) | |
download | gitea-66f8da538a8b1bd63ea1a0f97202ee0d46c15c4f.tar.gz gitea-66f8da538a8b1bd63ea1a0f97202ee0d46c15c4f.zip |
Use pulls url if issue is a pull request (#16230)
if a pull request is displayed use the /pulls path
if a pull requests diff is displayed use the /pulls/{id}/files url
if an issue is displayed use the issues url
Fixes #16102
Signed-off-by: Sebastian Sauer <sauer.sebastian@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/issue/view_content/context_menu.tmpl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/templates/repo/issue/view_content/context_menu.tmpl b/templates/repo/issue/view_content/context_menu.tmpl index e3001cddce..fdefde979d 100644 --- a/templates/repo/issue/view_content/context_menu.tmpl +++ b/templates/repo/issue/view_content/context_menu.tmpl @@ -6,7 +6,11 @@ <div class="menu"> {{ $referenceUrl := "" }} {{ if .issue }} - {{ $referenceUrl = Printf "%s%s/issues/%d#%s" AppUrl .ctx.Repository.FullName .ctx.Issue.Index .item.HashTag }} + {{ if .ctx.Issue.IsPull}} + {{ $referenceUrl = Printf "%s%s/pulls/%d#%s" AppUrl .ctx.Repository.FullName .ctx.Issue.Index .item.HashTag }} + {{ else }} + {{ $referenceUrl = Printf "%s%s/issues/%d#%s" AppUrl .ctx.Repository.FullName .ctx.Issue.Index .item.HashTag }} + {{ end }} {{ else }} {{ $referenceUrl = Printf "%s%s/pulls/%d/files#%s" AppUrl .ctx.Repository.FullName .ctx.Issue.Index .item.HashTag }} {{ end }} |