Skip to content

Conversation

@mithileshgupta12
Copy link

@mithileshgupta12 mithileshgupta12 commented Oct 29, 2025

No description provided.

@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Oct 29, 2025
@silverwind
Copy link
Member

silverwind commented Oct 29, 2025

@wxiaoguang should this use PageTitleCommon added in https://github.com/go-gitea/gitea/pull/35772/files? I wonder why its not named PageTitle.

@wxiaoguang
Copy link
Contributor

I wonder why its not named PageTitle.

PageTitle conflicts with Title when reading

@wxiaoguang
Copy link
Contributor

should this use PageTitleCommon added in https://github.com/go-gitea/gitea/pull/35772/files?

I think the current code is good enough. PageTitleCommon is a suffix when Title exists.

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())
Copy link
Contributor

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?

Copy link
Author

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.

Copy link
Member

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.

Copy link
Author

@mithileshgupta12 mithileshgupta12 Oct 29, 2025

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

Copy link
Author

@mithileshgupta12 mithileshgupta12 Oct 30, 2025

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: ContextUser refers to the organization
  • For user projects: ContextUser refers to the individual user

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants