diff --git a/modules/base/template.go b/modules/base/template.go index 5268da649..e596d1dad 100644 --- a/modules/base/template.go +++ b/modules/base/template.go @@ -58,4 +58,7 @@ var TemplateFuncs template.FuncMap = map[string]interface{}{ "Mail2Domain": func(mail string) string { return "mail." + strings.Split(mail, "@")[1] }, + "SubStr": func(str string, start, length int) string { + return str[start : start+length] + }, } diff --git a/routers/repo/repo.go b/routers/repo/repo.go index fb54d4ef8..b38473b18 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -13,11 +13,11 @@ import ( func Create(ctx *middleware.Context, form auth.CreateRepoForm) { ctx.Data["Title"] = "Create repository" + ctx.Data["PageIsNewRepo"] = true // For navbar arrow. + ctx.Data["LanguageIgns"] = models.LanguageIgns + ctx.Data["Licenses"] = models.Licenses if ctx.Req.Method == "GET" { - ctx.Data["PageIsNewRepo"] = true // For navbar arrow. - ctx.Data["LanguageIgns"] = models.LanguageIgns - ctx.Data["Licenses"] = models.Licenses ctx.HTML(200, "repo/create", ctx.Data) return } diff --git a/routers/repo/single.go b/routers/repo/single.go index 0bfc8ffb2..285c5277a 100644 --- a/routers/repo/single.go +++ b/routers/repo/single.go @@ -186,6 +186,8 @@ func Commits(ctx *middleware.Context, params martini.Params) { ctx.Error(404) return } + ctx.Data["Username"] = params["username"] + ctx.Data["Reponame"] = params["reponame"] ctx.Data["Commits"] = commits ctx.HTML(200, "repo/commits", ctx.Data) } diff --git a/templates/repo/commits.tmpl b/templates/repo/commits.tmpl index 53c14d364..04ca19afc 100644 --- a/templates/repo/commits.tmpl +++ b/templates/repo/commits.tmpl @@ -13,41 +13,28 @@
Author | -Commit | - -Date | -|||
---|---|---|---|---|---|
Author | +Commit | + +Date | +|||
CommitUser | -d91b380 | - -3 years ago | -|||
CommitUser | -d91b380 | - -3 years ago | -|||
CommitUser | -d91b380 | - -3 years ago | +{{.Committer.Name}} | +{{SubStr .Id.String 0 7}} | + +{{TimeSince .Committer.When}} |