From f90e37ade0bcb82a8381e861730b87399e4a3b45 Mon Sep 17 00:00:00 2001 From: slene Date: Mon, 17 Mar 2014 19:56:33 +0800 Subject: [PATCH] fixed --- routers/repo/single.go | 1 + templates/repo/single.tmpl | 2 ++ 2 files changed, 3 insertions(+) diff --git a/routers/repo/single.go b/routers/repo/single.go index acbf9dd0a..cf64cc6b5 100644 --- a/routers/repo/single.go +++ b/routers/repo/single.go @@ -97,6 +97,7 @@ func Single(ctx *middleware.Context, params martini.Params) { } if readmeFile != nil { + ctx.Data["ReadmeExist"] = true // if file large than 1M not show it if readmeFile.Size > 1024*1024 || readmeFile.Filemode != git.FileModeBlob { ctx.Data["FileIsLarge"] = true diff --git a/templates/repo/single.tmpl b/templates/repo/single.tmpl index c22f129fb..561deb253 100644 --- a/templates/repo/single.tmpl +++ b/templates/repo/single.tmpl @@ -83,6 +83,7 @@ + {{if .ReadmeExist}}
README.md @@ -97,6 +98,7 @@
{{end}}
+ {{end}} {{template "base/footer" .}} \ No newline at end of file