mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-19 17:01:12 +00:00
feat(ui): add links to review request targets in issue comments (#8239)
- Add links to review request targets in issue comments - Fix links to ghost users/orgs/teams to be empty Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8239 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Robert Wolff <mahlzahn@posteo.de> Co-committed-by: Robert Wolff <mahlzahn@posteo.de>
This commit is contained in:
parent
82daae4c7c
commit
7643bdd2b5
11 changed files with 256 additions and 21 deletions
|
@ -296,6 +296,9 @@ func (u *User) CanImportLocal() bool {
|
|||
|
||||
// DashboardLink returns the user dashboard page link.
|
||||
func (u *User) DashboardLink() string {
|
||||
if u.IsGhost() {
|
||||
return ""
|
||||
}
|
||||
if u.IsOrganization() {
|
||||
return u.OrganisationLink() + "/dashboard"
|
||||
}
|
||||
|
@ -304,16 +307,25 @@ func (u *User) DashboardLink() string {
|
|||
|
||||
// HomeLink returns the user or organization home page link.
|
||||
func (u *User) HomeLink() string {
|
||||
if u.IsGhost() {
|
||||
return ""
|
||||
}
|
||||
return setting.AppSubURL + "/" + url.PathEscape(u.Name)
|
||||
}
|
||||
|
||||
// HTMLURL returns the user or organization's full link.
|
||||
func (u *User) HTMLURL() string {
|
||||
if u.IsGhost() {
|
||||
return ""
|
||||
}
|
||||
return setting.AppURL + url.PathEscape(u.Name)
|
||||
}
|
||||
|
||||
// OrganisationLink returns the organization sub page link.
|
||||
func (u *User) OrganisationLink() string {
|
||||
if u.IsGhost() || !u.IsOrganization() {
|
||||
return ""
|
||||
}
|
||||
return setting.AppSubURL + "/org/" + url.PathEscape(u.Name)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue