diff options
Diffstat (limited to 'routers/repo/view.go')
-rw-r--r-- | routers/repo/view.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go index f56c524359..9183aea030 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -457,6 +457,16 @@ func Home(ctx *context.Context) { ctx.NotFound("Home", fmt.Errorf(ctx.Tr("units.error.no_unit_allowed_repo"))) } +func renderLanguageStats(ctx *context.Context) { + langs, err := ctx.Repo.Repository.GetTopLanguageStats(5) + if err != nil { + ctx.ServerError("Repo.GetTopLanguageStats", err) + return + } + + ctx.Data["LanguageStats"] = langs +} + func renderCode(ctx *context.Context) { ctx.Data["PageIsViewCode"] = true @@ -497,6 +507,11 @@ func renderCode(ctx *context.Context) { return } + renderLanguageStats(ctx) + if ctx.Written() { + return + } + if entry.IsDir() { renderDirectory(ctx, treeLink) } else { |