forgejo/templates/repo/issue/view_content/sidebar/reference.tmpl
jank1619 011e876f5c fix: use correct format for pull request references (#8890)
Use `!` instead of `#` for references in the sidebar of pull requests. This is useful when the repository uses a external issue tracker to avoid it being redirected to the external issue tracker.

Resolves forgejo/forgejo#8713

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8890
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: jank1619 <jank1619@noreply.codeberg.org>
Co-committed-by: jank1619 <jank1619@noreply.codeberg.org>
2025-08-15 14:18:00 +02:00

19 lines
710 B
Go HTML Template

<div class="ui reference">
{{$issueReferenceLink := ""}}
{{if .Issue.IsPull}}
{{$issueReferenceLink = printf "%s!%d" .Issue.Repo.FullName .Issue.Index}}
{{else}}
{{$issueReferenceLink = printf "%s#%d" .Issue.Repo.FullName .Issue.Index}}
{{end}}
<span class="text">
<strong>
{{ctx.Locale.Tr "discussion.sidebar.reference"}}
</strong>
</span>
<div class="ui equal width compact grid">
<div class="row tw-items-center" data-tooltip-content="{{$issueReferenceLink}}">
<span class="text column truncate">{{$issueReferenceLink}}</span>
<button class="ui two wide button column tw-p-2" data-clipboard-text="{{$issueReferenceLink}}">{{svg "octicon-copy" 14}}</button>
</div>
</div>
</div>