From ebc0943713196abe939e445f35e0f726f5cbee1e Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 10 Mar 2017 15:13:48 -0500 Subject: templates/repo: only show Git stats in repository home page (#3518) Move 'Commits' and 'Releases' tabs down to body. This patch also reduces page load time for pages that do not need to use commits count anywhere. Get commits count can hurt performance badly for huge repositories that has tens of thousands commits like Linux Kernel. --- templates/repo/header.tmpl | 6 ------ templates/repo/home.tmpl | 20 ++++++++++++++++---- 2 files changed, 16 insertions(+), 10 deletions(-) (limited to 'templates/repo') diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index fe3f30d6..5ad5139c 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -62,12 +62,6 @@ {{.i18n.Tr "repo.pulls"}} {{.Repository.NumOpenPulls}} {{end}} - - {{.i18n.Tr "repo.commits"}} {{.CommitsCount}} - - - {{.i18n.Tr "repo.releases"}} {{.Repository.NumTags}} - {{if .Repository.EnableWiki}} {{.i18n.Tr "repo.wiki"}} diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index f059ea19..1a8e0432 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -3,10 +3,22 @@ {{template "repo/header" .}}
{{template "base/alert" .}} -

- {{if .Repository.DescriptionHtml}}{{.Repository.DescriptionHtml}}{{else}}{{.i18n.Tr "repo.no_desc"}}{{end}} - {{.Repository.Website}} -

+ {{if .PageIsRepoHome}} +

+ {{if .Repository.DescriptionHtml}}{{.Repository.DescriptionHtml}}{{else}}{{.i18n.Tr "repo.no_desc"}}{{end}} + {{.Repository.Website}} +

+ + {{end}}