Skip to content

Add .profile README to organization pages #27125

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

Closed
wants to merge 4 commits into from

Conversation

hazycora
Copy link
Contributor

Currently, user profiles can have README markdown files displayed. Organizations can have this same thing on GitHub, so why not Gitea?

In adding this, I've also realised that since the user tab template is used by some organization pages, currently if a .profile repository and a README.md file exist on an organization, an Overview tab is shown on some pages even though it simply redirects to the repositories page:
Screenshot from an organization's Package tab, showing that the Overview tab is visible in the UI despite being unimplemented here
So this PR also makes these work as they should!

Screenshots

Before:
The organizations page, showing a tab list without an Overview tab, and a list of repositories below it, including a .profile repository as is used for user profiles in Gitea
After:
The organizations page with the Overview tab focused, and its README, saying "heyy!!" rendered on the page

I've also added the overview tab everywhere the organization tabs are visible (of course, only when the .profile repo and a README file exist, matching the behaviour for user profile pages)

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 19, 2023
@puni9869
Copy link
Member

Ready for review?

@hazycora
Copy link
Contributor Author

hazycora commented Sep 20, 2023

Ready for review?

I think so, I've completed the feature :)

@lunny lunny added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Sep 20, 2023
@lunny lunny added this to the 1.22.0 milestone Sep 20, 2023

language := ctx.FormTrim("language")
ctx.Data["Language"] = language
func PrepareOrgProfileTabData(ctx *context.Context, profileGitRepo *git.Repository, profileReadme *git.Blob) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func PrepareOrgProfileTabData(ctx *context.Context, profileGitRepo *git.Repository, profileReadme *git.Blob) {
func prepareOrgProfileTabData(ctx *context.Context, profileGitRepo *git.Repository, profileReadme *git.Blob) {

defer profileClose()
ctx.Data["HasProfileReadme"] = profileReadmeBlob != nil

PrepareOrgProfileTabData(ctx, profileGitRepo, profileReadmeBlob)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PrepareOrgProfileTabData(ctx, profileGitRepo, profileReadmeBlob)
prepareOrgProfileTabData(ctx, profileGitRepo, profileReadmeBlob)

@jolheiser
Copy link
Member

It looks like #27955 also implemented this and has been merged. Thank you for the PR! ❤️

@jolheiser jolheiser closed this Dec 10, 2023
@GiteaBot GiteaBot removed this from the 1.22.0 milestone Dec 11, 2023
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Mar 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants