Skip to content
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

org projects page menu is incorrect and have different style of header's background color and url #22676

Closed
yp05327 opened this issue Jan 31, 2023 · 1 comment · Fixed by #22705
Labels

Comments

@yp05327
Copy link
Contributor

yp05327 commented Jan 31, 2023

Description

org projects page menu is incorrect:

  1. build the last version and run gitea server
  2. after the init proccess, create a new org
  3. access projects , people and team tab is missing

org projects

the right one
org packages

different style of header's background color and url:

Page Style Url
projects template/user/overview/header.tmpl orgname/-/projects
package template/user/overview/header.tmpl orgname/-/packages
people template/org/header.tmpl org/orgname/members
team template/org/header.tmpl org/orgname/teams

org people
org teams

Gitea Version

4011821

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

build in local

Database

None

@yp05327
Copy link
Contributor Author

yp05327 commented Jan 31, 2023

IsOrganizationMember and IsOrganizationOwner is not defined in the projects page rendering function.
Then {{if .IsOrganizationMember}} and {{if .IsOrganizationOwner}} will always return false, and will not render People and Teams

I'm trying to fix this.

jolheiser pushed a commit that referenced this issue Mar 10, 2023
Fixes #22676

Context Data `IsOrganizationMember` and `IsOrganizationOwner` is used to
control the visibility of `people` and `team` tab.

https://github.com/go-gitea/gitea/blob/2871ea08096cba15546f357d0ec473734ee9d8be/templates/org/menu.tmpl#L19-L40

And because of the reuse of user projects page, User Context is changed
to Organization Context. But the value of `IsOrganizationMember` and
`IsOrganizationOwner` are not being given.

I reused func `HandleOrgAssignment` to add them to the ctx, but may have
some unnecessary variables, idk whether it is ok.

I found there is a missing `PageIsViewProjects` at create project page.
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Mar 10, 2023
Fixes go-gitea#22676

Context Data `IsOrganizationMember` and `IsOrganizationOwner` is used to
control the visibility of `people` and `team` tab.

https://github.com/go-gitea/gitea/blob/2871ea08096cba15546f357d0ec473734ee9d8be/templates/org/menu.tmpl#L19-L40

And because of the reuse of user projects page, User Context is changed
to Organization Context. But the value of `IsOrganizationMember` and
`IsOrganizationOwner` are not being given.

I reused func `HandleOrgAssignment` to add them to the ctx, but may have
some unnecessary variables, idk whether it is ok.

I found there is a missing `PageIsViewProjects` at create project page.
jolheiser pushed a commit that referenced this issue Mar 10, 2023
Backport #22705 by @yp05327

Fixes #22676

Context Data `IsOrganizationMember` and `IsOrganizationOwner` is used to
control the visibility of `people` and `team` tab.

https://github.com/go-gitea/gitea/blob/2871ea08096cba15546f357d0ec473734ee9d8be/templates/org/menu.tmpl#L19-L40

And because of the reuse of user projects page, User Context is changed
to Organization Context. But the value of `IsOrganizationMember` and
`IsOrganizationOwner` are not being given.

I reused func `HandleOrgAssignment` to add them to the ctx, but may have
some unnecessary variables, idk whether it is ok.

I found there is a missing `PageIsViewProjects` at create project page.

Co-authored-by: yp05327 <576951401@qq.com>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant