-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Fix #35763: Add proper page title for project pages #35773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix #35763: Add proper page title for project pages #35773
Conversation
|
@wxiaoguang should this use |
|
I think the current code is good enough. |
routers/web/org/projects.go
Outdated
| ctx.Data["Project"] = project | ||
| ctx.Data["IssuesMap"] = issuesMap | ||
| ctx.Data["Columns"] = columns | ||
| ctx.Data["Title"] = fmt.Sprintf("%s - %s", project.Title, ctx.Org.Organization.DisplayName()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will panic if the project is not in an org?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wxiaoguang I added a check to ensure the project is in organisation. That will make sure that it will not panic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you still need to support setting the title for user repos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will do that as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@silverwind I fixed the code. Now it handles both user projects and org projects.
Just to clarify the final implementation:
I'm now using ctx.ContextUser.DisplayName() which handles both cases:
- For organization projects:
ContextUserrefers to the organization - For user projects:
ContextUserrefers to the individual user
fbf3e17 to
43a30b6
Compare
No description provided.