forked from forgejo/forgejo
Backport #28716 by wxiaoguang
Gitea prefers to use relative URLs in code (to make multiple domain work
for some users)
So it needs to use `toAbsoluteUrl` to generate a full URL when click
"Reference in New Issues"
And add some comments in the test code
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit def178ce32
)
Conflicts:
tests/integration/issue_test.go
https://codeberg.org/forgejo/forgejo/issues/2158
This commit is contained in:
parent
d416f94b70
commit
01285dc47c
2 changed files with 21 additions and 1 deletions
|
@ -4,6 +4,7 @@ import {showTemporaryTooltip, createTippy} from '../modules/tippy.js';
|
|||
import {hideElem, showElem, toggleElem} from '../utils/dom.js';
|
||||
import {setFileFolding} from './file-fold.js';
|
||||
import {getComboMarkdownEditor, initComboMarkdownEditor} from './comp/ComboMarkdownEditor.js';
|
||||
import {toAbsoluteUrl} from '../utils.js';
|
||||
|
||||
const {appSubUrl, csrfToken} = window.config;
|
||||
|
||||
|
@ -527,7 +528,7 @@ export function initRepoIssueReferenceIssue() {
|
|||
const $this = $(this);
|
||||
const content = $(`#${$this.data('target')}`).text();
|
||||
const poster = $this.data('poster-username');
|
||||
const reference = $this.data('reference');
|
||||
const reference = toAbsoluteUrl($this.data('reference'));
|
||||
const $modal = $($this.data('modal'));
|
||||
$modal.find('textarea[name="content"]').val(`${content}\n\n_Originally posted by @${poster} in ${reference}_`);
|
||||
$modal.modal('show');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue