Add the ability to explore organizations (#3573)

* Add ability to explore organizations

* Use right icon for org explore links
This commit is contained in:
Daniel Oaks 2016-09-01 23:08:05 +10:00 committed by 无闻
parent 4efaf8e882
commit b3d9ca4ccd
6 changed files with 940 additions and 1104 deletions

View file

@ -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)