aboutsummaryrefslogtreecommitdiff
path: root/routers/repo/single.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-03-17 20:05:29 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-03-17 20:05:29 +0800
commitf2b0dc18b5cc7e9f42bfc2e45f37ffb45d478fd2 (patch)
treeb7713538cd7681cdd5dd9c4a41a3a530340a6eba /routers/repo/single.go
parenta30e72323d1f8f6be7716a0548d99ef06807172b (diff)
parentf90e37ade0bcb82a8381e861730b87399e4a3b45 (diff)
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'routers/repo/single.go')
-rw-r--r--routers/repo/single.go16
1 files changed, 6 insertions, 10 deletions
diff --git a/routers/repo/single.go b/routers/repo/single.go
index f47a2f7b..cf64cc6b 100644
--- a/routers/repo/single.go
+++ b/routers/repo/single.go
@@ -88,21 +88,16 @@ func Single(ctx *middleware.Context, params martini.Params) {
var readmeFile *models.RepoFile
for _, f := range files {
- if !f.IsFile() {
+ if !f.IsFile() || len(f.Name) < 6 {
continue
- }
-
- if len(f.Name) < 6 {
- continue
- }
-
- if strings.ToLower(f.Name[:6]) == "readme" {
+ } else if strings.ToLower(f.Name[:6]) == "readme" {
readmeFile = f
break
}
}
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
@@ -136,8 +131,9 @@ func Setting(ctx *middleware.Context, params martini.Params) {
ctx.Render.HTML(200, "repo/setting", ctx.Data)
}
-func Commits(ctx *middleware.Context) string {
- return "This is commits page"
+func Commits(ctx *middleware.Context) {
+ ctx.Data["IsRepoToolbarCommits"] = true
+ ctx.Render.HTML(200, "repo/commits", ctx.Data)
}
func Issues(ctx *middleware.Context) string {