aboutsummaryrefslogtreecommitdiffstats
path: root/routers/user/home.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/user/home.go')
-rw-r--r--routers/user/home.go18
1 files changed, 11 insertions, 7 deletions
diff --git a/routers/user/home.go b/routers/user/home.go
index b82daed291..e6b789e2f3 100644
--- a/routers/user/home.go
+++ b/routers/user/home.go
@@ -18,10 +18,10 @@ import (
)
const (
- DASHBOARD base.TplName = "user/dashboard/dashboard"
- ISSUES base.TplName = "user/dashboard/issues"
- PROFILE base.TplName = "user/profile"
- ORG_HOME base.TplName = "org/home"
+ tplDashborad base.TplName = "user/dashboard/dashboard"
+ tplIssues base.TplName = "user/dashboard/issues"
+ tplProfile base.TplName = "user/profile"
+ tplOrgHome base.TplName = "org/home"
)
// getDashboardContextUser finds out dashboard is viewing as which context user.
@@ -86,6 +86,7 @@ func retrieveFeeds(ctx *context.Context, ctxUser *models.User, userID, offset in
ctx.Data["Feeds"] = feeds
}
+// Dashboard render the dashborad page
func Dashboard(ctx *context.Context) {
ctxUser := getDashboardContextUser(ctx)
if ctx.Written() {
@@ -150,9 +151,10 @@ func Dashboard(ctx *context.Context) {
if ctx.Written() {
return
}
- ctx.HTML(200, DASHBOARD)
+ ctx.HTML(200, tplDashborad)
}
+// Issues render the user issues page
func Issues(ctx *context.Context) {
isPullList := ctx.Params(":type") == "pulls"
if isPullList {
@@ -308,9 +310,10 @@ func Issues(ctx *context.Context) {
ctx.Data["State"] = "open"
}
- ctx.HTML(200, ISSUES)
+ ctx.HTML(200, tplIssues)
}
+// ShowSSHKeys ouput all the ssh keys of user by uid
func ShowSSHKeys(ctx *context.Context, uid int64) {
keys, err := models.ListPublicKeys(uid)
if err != nil {
@@ -373,9 +376,10 @@ func showOrgProfile(ctx *context.Context) {
ctx.Data["Teams"] = org.Teams
- ctx.HTML(200, ORG_HOME)
+ ctx.HTML(200, tplOrgHome)
}
+// Email2User show user page via email
func Email2User(ctx *context.Context) {
u, err := models.GetUserByEmail(ctx.Query("email"))
if err != nil {