summaryrefslogtreecommitdiffstats
path: root/routers/user/home.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-06-22 23:11:12 -0400
committerUnknown <joe2010xtmf@163.com>2014-06-22 23:11:12 -0400
commit314193029a246c2498c6d54c085d57f7589c8dbe (patch)
tree302cacb210a972d8050dbf1882a89c5ace1e6218 /routers/user/home.go
parent9c820730918443ca2b498dfa71b3131d73cec526 (diff)
downloadgitea-314193029a246c2498c6d54c085d57f7589c8dbe.tar.gz
gitea-314193029a246c2498c6d54c085d57f7589c8dbe.zip
Use constants to name template file
Diffstat (limited to 'routers/user/home.go')
-rw-r--r--routers/user/home.go18
1 files changed, 13 insertions, 5 deletions
diff --git a/routers/user/home.go b/routers/user/home.go
index a9674ac242..7d0333cb4e 100644
--- a/routers/user/home.go
+++ b/routers/user/home.go
@@ -17,6 +17,14 @@ import (
"github.com/gogits/gogs/modules/middleware"
)
+const (
+ DASHBOARD base.TplName = "user/dashboard"
+ PROFILE base.TplName = "user/profile"
+ ISSUES base.TplName = "user/issue"
+ PULLS base.TplName = "user/pulls"
+ STARS base.TplName = "user/stars"
+)
+
func Dashboard(ctx *middleware.Context) {
ctx.Data["Title"] = "Dashboard"
ctx.Data["PageIsUserDashboard"] = true
@@ -52,7 +60,7 @@ func Dashboard(ctx *middleware.Context) {
feeds = append(feeds, act)
}
ctx.Data["Feeds"] = feeds
- ctx.HTML(200, "user/dashboard")
+ ctx.HTML(200, DASHBOARD)
}
func Profile(ctx *middleware.Context, params martini.Params) {
@@ -87,7 +95,7 @@ func Profile(ctx *middleware.Context, params martini.Params) {
}
}
- ctx.HTML(200, "user/profile")
+ ctx.HTML(200, PROFILE)
}
func Email2User(ctx *middleware.Context) {
@@ -254,13 +262,13 @@ func Issues(ctx *middleware.Context) {
} else {
ctx.Data["ShowCount"] = issueStats.OpenCount
}
- ctx.HTML(200, "user/issue")
+ ctx.HTML(200, ISSUES)
}
func Pulls(ctx *middleware.Context) {
- ctx.HTML(200, "user/pulls")
+ ctx.HTML(200, PULLS)
}
func Stars(ctx *middleware.Context) {
- ctx.HTML(200, "user/stars")
+ ctx.HTML(200, STARS)
}