[GITEA] Fix issue card links on projects

- Don't expect that rendering is done on a repository, use the given
issue to figure out the repository link.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1321

(cherry picked from commit 63f16652ca21809d2e088c46ddb88b84c08a5ad6)
(cherry picked from commit 821785d0af2fc2a41997675fc2809e1e45c0cdd8)
(cherry picked from commit 345742a0dc2b505a5bdc0747d4e2cda7136e735d)
(cherry picked from commit 2a37b91d7ced112b06d04950a9970cbd2d52f0f2)
(cherry picked from commit 9d40b409d715d336f68ec6306d8a928c171c85fc)
(cherry picked from commit c4c377e73312f36111d5f874195c9aebbb9c8635)
(cherry picked from commit dc149daafefcd4bf8cbb26fee70b78cf35d301d2)
(cherry picked from commit 418b0ff439dfb44ee7e6110cffbabe3426719163)
(cherry picked from commit a98cc429c7)
This commit is contained in:
Gusted 2023-09-13 21:36:21 +02:00 committed by Earl Warren
parent 631c87cc23
commit 44ae3b1b0c
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -33,7 +33,7 @@
</div>
{{if .MilestoneID}}
<div class="meta gt-my-2">
<a class="milestone" href="{{$.Page.RepoLink}}/milestone/{{.MilestoneID}}">
<a class="milestone" href="{{.Repo.Link}}/milestone/{{.MilestoneID}}">
{{svg "octicon-milestone" 16 "gt-mr-2 gt-vm"}}
<span class="gt-vm">{{.Milestone.Name}}</span>
</a>
@ -42,7 +42,7 @@
{{if $.Page.LinkedPRs}}
{{range index $.Page.LinkedPRs .ID}}
<div class="meta gt-my-2">
<a href="{{$.Page.RepoLink}}/pulls/{{.Index}}">
<a href="{{$.Issue.Repo.Link}}/pulls/{{.Index}}">
<span class="gt-m-0 text {{if .PullRequest.HasMerged}}purple{{else if .IsClosed}}red{{else}}green{{end}}">{{svg "octicon-git-merge" 16 "gt-mr-2 gt-vm"}}</span>
<span class="gt-vm">{{.Title}} <span class="text light grey">#{{.Index}}</span></span>
</a>
@ -61,7 +61,7 @@
{{if or .Labels .Assignees}}
<div class="extra content labels-list gt-p-0 gt-pt-2">
{{range .Labels}}
<a target="_blank" href="{{$.Page.RepoLink}}/issues?labels={{.ID}}">{{RenderLabel ctx .}}</a>
<a target="_blank" href="{{$.Issue.Repo.Link}}/issues?labels={{.ID}}">{{RenderLabel ctx .}}</a>
{{end}}
<div class="right floated">
{{range .Assignees}}