Переглянути джерело

Add Home Routes documentation

Erwan ROUSSEL 7 роки тому
батько
коміт
501c8c662e
1 змінених файлів з 10 додано та 0 видалено
  1. 10 0
      routes/home.go

+ 10 - 0
routes/home.go

@@ -18,6 +18,7 @@ const (
 	EXPLORE_ORGANIZATIONS = "explore/organizations"
 )
 
+//Home is the handler for "/"
 func Home(c *context.Context) {
 	if c.IsLogged {
 		if !c.User.IsActive && setting.Service.RegisterEmailConfirm {
@@ -40,6 +41,8 @@ func Home(c *context.Context) {
 	c.Success(HOME)
 }
 
+//ExploreHome is the handler for "/explore/home"
+// BUG : Return 404
 func ExploreHome(c *context.Context) {
 	c.Data["Title"] = c.Tr("explore")
 	c.Data["PageIsExplore"] = true
@@ -75,6 +78,7 @@ func ExploreHome(c *context.Context) {
 	c.Success(EXPLORE_HOME)
 }
 
+//ExploreRepos is the handler for "/explore/repos"
 func ExploreRepos(c *context.Context) {
 	c.Data["Title"] = c.Tr("explore")
 	c.Data["PageIsExplore"] = true
@@ -110,6 +114,7 @@ func ExploreRepos(c *context.Context) {
 	c.Success(EXPLORE_REPOS)
 }
 
+//ExploreTrending is the handler for "/trending"
 func ExploreTrending(c *context.Context) {
 	c.Data["Title"] = c.Tr("explore.trending")
 	c.Data["PageIsTrending"] = true
@@ -134,6 +139,7 @@ func ExploreTrending(c *context.Context) {
 	c.Success(EXPLORE_TRENDING)
 }
 
+//UserSearchOptions is the structure of the options choosed by the user
 type UserSearchOptions struct {
 	Type     models.UserType
 	Counter  func() int64
@@ -143,6 +149,7 @@ type UserSearchOptions struct {
 	TplName  string
 }
 
+//RenderUserSearch renders user search
 func RenderUserSearch(c *context.Context, opts *UserSearchOptions) {
 	page := c.QueryInt("page")
 	if page <= 1 {
@@ -184,6 +191,7 @@ func RenderUserSearch(c *context.Context, opts *UserSearchOptions) {
 	c.Success(opts.TplName)
 }
 
+//ExploreUsers is the handler for "/explore/users"
 func ExploreUsers(c *context.Context) {
 	c.Data["Title"] = c.Tr("explore")
 	c.Data["PageIsExplore"] = true
@@ -199,6 +207,7 @@ func ExploreUsers(c *context.Context) {
 	})
 }
 
+//ExploreOrganizations is the handler for "/explore/organisations"
 func ExploreOrganizations(c *context.Context) {
 	c.Data["Title"] = c.Tr("explore")
 	c.Data["PageIsExplore"] = true
@@ -214,6 +223,7 @@ func ExploreOrganizations(c *context.Context) {
 	})
 }
 
+//NotFound renders 404 page if page not found
 func NotFound(c *context.Context) {
 	c.Data["Title"] = "Page Not Found"
 	c.NotFound()