Skip to content

Commit a1f97f1

Browse files
sebastian-sauerAbdulrhmnGhanem
authored andcommitted
Use pulls url if issue is a pull request (go-gitea#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 go-gitea#16102 Signed-off-by: Sebastian Sauer <[email protected]>
1 parent fbaaee3 commit a1f97f1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

templates/repo/issue/view_content/context_menu.tmpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
<div class="menu">
77
{{ $referenceUrl := "" }}
88
{{ if .issue }}
9-
{{ $referenceUrl = Printf "%s%s/issues/%d#%s" AppUrl .ctx.Repository.FullName .ctx.Issue.Index .item.HashTag }}
9+
{{ if .ctx.Issue.IsPull}}
10+
{{ $referenceUrl = Printf "%s%s/pulls/%d#%s" AppUrl .ctx.Repository.FullName .ctx.Issue.Index .item.HashTag }}
11+
{{ else }}
12+
{{ $referenceUrl = Printf "%s%s/issues/%d#%s" AppUrl .ctx.Repository.FullName .ctx.Issue.Index .item.HashTag }}
13+
{{ end }}
1014
{{ else }}
1115
{{ $referenceUrl = Printf "%s%s/pulls/%d/files#%s" AppUrl .ctx.Repository.FullName .ctx.Issue.Index .item.HashTag }}
1216
{{ end }}

0 commit comments

Comments
 (0)