1
0
Fork 0
forked from forgejo/forgejo

[GITEA] Make reference URL absolute

- Backport of #2100
- Make the reference URL in the "Reference in New issue" feature
absolute again as it wouldn't render as a link otherwise.
- Adds integration test.
- Regression by 769be877f2
- Resolves #2012

(cherry picked from commit c74bae2897)
This commit is contained in:
Gusted 2024-01-05 20:00:13 +01:00
parent 0fbf761d19
commit a8ce03660f
No known key found for this signature in database
GPG key ID: FD821B732837125F
2 changed files with 30 additions and 2 deletions

View file

@ -5,9 +5,9 @@
<div class="menu">
{{$referenceUrl := ""}}
{{if .issue}}
{{$referenceUrl = printf "%s#%s" .ctxData.Issue.Link .item.HashTag}}
{{$referenceUrl = printf "%s#%s" .ctxData.Issue.HTMLURL .item.HashTag}}
{{else}}
{{$referenceUrl = printf "%s/files#%s" .ctxData.Issue.Link .item.HashTag}}
{{$referenceUrl = printf "%s/files#%s" .ctxData.Issue.HTMLURL .item.HashTag}}
{{end}}
<div class="item context js-aria-clickable" data-clipboard-text-type="url" data-clipboard-text="{{$referenceUrl}}">{{ctx.Locale.Tr "repo.issues.context.copy_link"}}</div>
{{if and .ctxData.IsSigned (not .ctxData.Repository.IsArchived)}}