|
|
|
@@ -44,6 +44,11 @@ const ( |
|
|
|
func Home(ctx *context.Context) { |
|
|
|
ctx.Data["PageIsHome"] = true |
|
|
|
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled |
|
|
|
setRecommendURL(ctx) |
|
|
|
ctx.HTML(200, tplHome) |
|
|
|
} |
|
|
|
|
|
|
|
func setRecommendURL(ctx *context.Context) { |
|
|
|
addr := setting.RecommentRepoAddr[10:] |
|
|
|
start := strings.Index(addr, "/") |
|
|
|
end := strings.Index(addr, "raw") |
|
|
|
@@ -52,7 +57,6 @@ func Home(ctx *context.Context) { |
|
|
|
} else { |
|
|
|
ctx.Data["RecommendURL"] = setting.RecommentRepoAddr |
|
|
|
} |
|
|
|
ctx.HTML(200, tplHome) |
|
|
|
} |
|
|
|
|
|
|
|
func Dashboard(ctx *context.Context) { |
|
|
|
@@ -85,7 +89,7 @@ func Dashboard(ctx *context.Context) { |
|
|
|
ctx.Redirect(setting.AppSubURL + "/user/login") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
setRecommendURL(ctx) |
|
|
|
ctx.Data["PageIsHome"] = true |
|
|
|
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled |
|
|
|
ctx.HTML(200, tplHome) |
|
|
|
|