summaryrefslogtreecommitdiffstats
path: root/routers/home.go
diff options
context:
space:
mode:
authorDaniel Oaks <daniel@danieloaks.net>2016-09-01 23:08:05 +1000
committer无闻 <u@gogs.io>2016-09-01 09:08:05 -0400
commitb3d9ca4ccd7c4353db0971b61bbcbffd126cb61d (patch)
tree2187f2c6631385bc0247af11e26648f5717b8acf /routers/home.go
parent4efaf8e882dad4bffbb84104aec6df25d15b4f87 (diff)
downloadgitea-b3d9ca4ccd7c4353db0971b61bbcbffd126cb61d.tar.gz
gitea-b3d9ca4ccd7c4353db0971b61bbcbffd126cb61d.zip
Add the ability to explore organizations (#3573)
* Add ability to explore organizations * Use right icon for org explore links
Diffstat (limited to 'routers/home.go')
-rw-r--r--routers/home.go22
1 files changed, 19 insertions, 3 deletions
diff --git a/routers/home.go b/routers/home.go
index 0876e3a3d9..22a131a626 100644
--- a/routers/home.go
+++ b/routers/home.go
@@ -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)