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