]> source.dussan.org Git - gitea.git/commit
Use link in UI which returned a relative url but not html_url which contains an absol...
authorLunny Xiao <xiaolunwen@gmail.com>
Mon, 6 Feb 2023 18:09:18 +0000 (02:09 +0800)
committerGitHub <noreply@github.com>
Mon, 6 Feb 2023 18:09:18 +0000 (12:09 -0600)
commit769be877f2ce572b94b7c0a85853a2f7836075ac
tree05b203548fe61dbb6c95b5ffec2da6915a84df34
parent189d5b7045b2200fa55c20707a39138cfb8cf0ed
Use link in UI which returned a relative url but not html_url which contains an absolute url (#21986)

partially fix #19345

This PR add some `Link` methods for different objects. The `Link`
methods are not different from `HTMLURL`, they are lack of the absolute
URL. And most of UI `HTMLURL` have been replaced to `Link` so that users
can visit them from a different domain or IP.

This PR also introduces a new javascript configuration
`window.config.reqAppUrl` which is different from `appUrl` which is
still an absolute url but the domain has been replaced to the current
requested domain.
43 files changed:
models/activities/action.go
models/activities/action_test.go
models/activities/notification.go
models/issues/comment.go
models/issues/issue.go
models/issues/pull.go
models/packages/descriptor.go
models/project/project.go
models/repo/release.go
models/repo/repo.go
modules/structs/repo.go
routers/web/feed/convert.go
routers/web/repo/pull.go
routers/web/repo/repo.go
templates/code/searchresults.tmpl
templates/mail/issue/assigned.tmpl
templates/mail/issue/default.tmpl
templates/mail/release.tmpl
templates/package/shared/list.tmpl
templates/package/view.tmpl
templates/repo/branch/list.tmpl
templates/repo/diff/box.tmpl
templates/repo/diff/comment_form.tmpl
templates/repo/editor/edit.tmpl
templates/repo/header.tmpl
templates/repo/issue/comment_tab.tmpl
templates/repo/issue/view_content.tmpl
templates/repo/issue/view_content/comments.tmpl
templates/repo/issue/view_content/context_menu.tmpl
templates/repo/issue/view_content/pull.tmpl
templates/repo/issue/view_title.tmpl
templates/repo/projects/view.tmpl
templates/repo/release/new.tmpl
templates/repo/view_file.tmpl
templates/repo/wiki/new.tmpl
templates/shared/issuelist.tmpl
templates/swagger/v1_json.tmpl
templates/user/dashboard/repolist.tmpl
templates/user/notification/notification_div.tmpl
web_src/js/features/clipboard.js
web_src/js/test/setup.js
web_src/js/utils.js
web_src/js/utils.test.js