|
|
@ -88,21 +88,16 @@ func Single(ctx *middleware.Context, params martini.Params) { |
|
|
|
var readmeFile *models.RepoFile |
|
|
|
var readmeFile *models.RepoFile |
|
|
|
|
|
|
|
|
|
|
|
for _, f := range files { |
|
|
|
for _, f := range files { |
|
|
|
if !f.IsFile() { |
|
|
|
if !f.IsFile() || len(f.Name) < 6 { |
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} else if strings.ToLower(f.Name[:6]) == "readme" { |
|
|
|
|
|
|
|
|
|
|
|
if len(f.Name) < 6 { |
|
|
|
|
|
|
|
continue |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if strings.ToLower(f.Name[:6]) == "readme" { |
|
|
|
|
|
|
|
readmeFile = f |
|
|
|
readmeFile = f |
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if readmeFile != nil { |
|
|
|
if readmeFile != nil { |
|
|
|
|
|
|
|
ctx.Data["ReadmeExist"] = true |
|
|
|
// if file large than 1M not show it
|
|
|
|
// if file large than 1M not show it
|
|
|
|
if readmeFile.Size > 1024*1024 || readmeFile.Filemode != git.FileModeBlob { |
|
|
|
if readmeFile.Size > 1024*1024 || readmeFile.Filemode != git.FileModeBlob { |
|
|
|
ctx.Data["FileIsLarge"] = true |
|
|
|
ctx.Data["FileIsLarge"] = true |
|
|
@ -136,8 +131,9 @@ func Setting(ctx *middleware.Context, params martini.Params) { |
|
|
|
ctx.Render.HTML(200, "repo/setting", ctx.Data) |
|
|
|
ctx.Render.HTML(200, "repo/setting", ctx.Data) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func Commits(ctx *middleware.Context) string { |
|
|
|
func Commits(ctx *middleware.Context) { |
|
|
|
return "This is commits page" |
|
|
|
ctx.Data["IsRepoToolbarCommits"] = true |
|
|
|
|
|
|
|
ctx.Render.HTML(200, "repo/commits", ctx.Data) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func Issues(ctx *middleware.Context) string { |
|
|
|
func Issues(ctx *middleware.Context) string { |
|
|
|