mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Add the ability to explore organizations (#3573)
* Add ability to explore organizations * Use right icon for org explore links
This commit is contained in:
		@@ -17,9 +17,10 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
	HOME          base.TplName = "home"
 | 
			
		||||
	EXPLORE_REPOS base.TplName = "explore/repos"
 | 
			
		||||
	EXPLORE_USERS base.TplName = "explore/users"
 | 
			
		||||
	HOME                  base.TplName = "home"
 | 
			
		||||
	EXPLORE_REPOS         base.TplName = "explore/repos"
 | 
			
		||||
	EXPLORE_USERS         base.TplName = "explore/users"
 | 
			
		||||
	EXPLORE_ORGANIZATIONS base.TplName = "explore/organizations"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func Home(ctx *context.Context) {
 | 
			
		||||
@@ -180,6 +181,21 @@ func ExploreUsers(ctx *context.Context) {
 | 
			
		||||
	})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func ExploreOrganizations(ctx *context.Context) {
 | 
			
		||||
	ctx.Data["Title"] = ctx.Tr("explore")
 | 
			
		||||
	ctx.Data["PageIsExplore"] = true
 | 
			
		||||
	ctx.Data["PageIsExploreOrganizations"] = true
 | 
			
		||||
 | 
			
		||||
	RenderUserSearch(ctx, &UserSearchOptions{
 | 
			
		||||
		Type:     models.USER_TYPE_ORGANIZATION,
 | 
			
		||||
		Counter:  models.CountOrganizations,
 | 
			
		||||
		Ranger:   models.Organizations,
 | 
			
		||||
		PageSize: setting.UI.ExplorePagingNum,
 | 
			
		||||
		OrderBy:  "updated_unix DESC",
 | 
			
		||||
		TplName:  EXPLORE_ORGANIZATIONS,
 | 
			
		||||
	})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func NotFound(ctx *context.Context) {
 | 
			
		||||
	ctx.Data["Title"] = "Page Not Found"
 | 
			
		||||
	ctx.Handle(404, "home.NotFound", nil)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user